O'Reilly logo

Kicking Butt with MIDP and MSA: Creating Great Mobile Applications by Jonathan Knudsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required