J2ME local files

J

johnlittlepeap

Hi,

Does anybody know if its possible to access the files in a phones
memory from a Java App. For instance, instead of http://, is it
possible to use file:/// as the location.

Specifically I'm talking about nokia phones (eg 3220).

I've looked into the FileConnection API but that API doesn't seem to
be on the 3220 phone.

John
 
F

Freeman

You may simply use InputStream to read a text file inside a jar.
e.g. InputStream in = this.getClass().getResourcesAsStream("TextFileName");
I use this method to develop my j2me game.

Http protocol is a standard for all Java phones. However, most phones do
not support "file" protocol.

Freeman
www.mobilefunland.com
 
F

Freeman

You may simply use InputStream to read a text file inside a jar.
e.g. InputStream in = this.getClass().getResourcesAsStream("TextFileName");
I use this method to develop my j2me game.

Http protocol is a standard for all Java phones. However, most phones do
not support "file" protocol.

Freeman
www.mobilefunland.com
 
D

Darryl L. Pierce

Freeman said:
You may simply use InputStream to read a text file inside a jar.
e.g. InputStream in = this.getClass().getResourcesAsStream("TextFileName");
I use this method to develop my j2me game.

The OP indicated that he wanted access files on the phone, not files in
the JAR.
 
F

Freeman

Due to security, a java program cannot access any files in phone outside
the jar. The only exception is files in the "Media center" (ie.
wallpaper, ringtone, etc). Of course, it depends on the phone model.
Most of them do not support this feature.

Freeman
Mobilefunland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top