The first hurdle you need to take is to determine whether the Runtime Environment will allow you to access files. Generally this will require that the Java Micro Edition Runtimes implements JSR-75. If you have a smartphone with a pre-installed Java Runtime you can look up the specs on the manufacturer's site, but don't raise your hopes. If you are using IBM J9 you are in luck, JSR-75 is supported.
To enable JSR-75 for IBM-J9 you need to (taken from Markus Brosch's blog):
- Get this jar file http://service.boulder.ibm.com/ibmdl/pub/software/pervasive/updates/571/techs/features/com.ibm.weme.wm2003.arm.pdap-fc.runtime22_5.7.1/wsdd5.0.jar. It contains a folder fixed with Personal Profile and MIDP subfolders and under that a directory structure analogous to the directory structure of the J9 runtime.
- Copy: fixed\ive-2.2\runtimes\wm2003\arm\midp2\bin\fileconn.dll into this folder on you mobile device: YourJ9Folder\bin\
Copy: fixed\ive-2.2\runtimes\wm2003\arm\midp2\lib\jclMidp20\ext\fc.jar into this folder on you mobile device: YourJ9Folder\lib\jclMidp20\ext\
- If your Java Runtime was running, restart it.