15. Reading and Writing Files
MIDP devices often have some kind of hierarchical file system. Data lives in files that belong to directories. Directories can contain other directories. File system roots contain all the directories.
JSR 75, the PDA Optional Packages, defines a FileConnection API that provides access to a device’s file system. It is a mandatory part of MSA and MSA subset.
For the actual work of reading files and writing files, you use the familiar stream classes from java.io. The FileConnection API gives you the streams you need from the device’s file system.
Remember, though, that using FileConnection means your application must be signed. If you are sure you need the FileConnection API, make sure your project budget includes the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access