Jump to content
  • Advertisement
Sign in to follow this  
Farzelhaar

J2ME Loading a File

This topic is 4749 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi. Does anyone know how to read the content of a simple Textfile located on a mobile phone? As far as I know there ist no FileInputStream Method in the CLDC. Sourcecode would be great :)

Share this post


Link to post
Share on other sites
Advertisement
Most phones don't support reading from the phone's permanent memory, but only from your own jar file (using Class.getResourceAsStream(), and we are talking read-only here) and reading/writing to the RMS.

Only the newest devices will support JSR-75 which includes access to the file system, and for these you would do it using the general connection framework, so it's like getting/sending data from/to a remote server, except you pass a file:// url to Connector.open().

Some older phones support file access without JSR-75, but with these you'll have proprietary classes so it depends on the phone (for example, older Siemens phones have a proprietary File class).

shmoove

Share this post


Link to post
Share on other sites
Hi shmoove, sorry to hijack this thread... but could JSR 75 also be used to access the phones image gallery?
Thanks

Share this post


Link to post
Share on other sites
Yes, assuming you know the path to that directory, and the phone's manufacturer's haven't gone out of their way to block that capability. And the path would probably change from phone to phone. And you would also need to know what images are there, since there are no methods to get directory listings as far as I can remember.

shmoove

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!