[java] How To access cell's mp3 file from a JAR file

Started by
4 comments, last by Palidine 19 years, 8 months ago
i've been sufferin wid dis prob dat how to access any file of mobile from my programmed JAR file by using MIDP 2.0 Its really urgent..........
Advertisement
i'm not 100% sure that MIDP would allow you access to the phones file system at all except in folders local or child to the one in which your app is installed. I'd read through the MIDP documentations about accessing the local file system and see what the API has to say about restrictions for doing that, etc.

you can find some of the relevant docs here:
http://java.sun.com/j2me/docs/index.html

the rest you can find on google.

-me
I've been looking at this myself just now. Not mp3, just data files in the jar.

As far as I can tell, put the file in the "res" folder for your project, then use code like this to open it:

InputStream is = getClass().getResourceAsStream("/file.mp3");

I don't know what you should do for your mp3 now.
Quote:Original post by siaspete
I've been looking at this myself just now. Not mp3, just data files in the jar.

As far as I can tell, put the file in the "res" folder for your project, then use code like this to open it:

InputStream is = getClass().getResourceAsStream("/file.mp3");

I don't know what you should do for your mp3 now.


well its like dunno wht mp3 files da user may hav on his mobile soo its like i want ma program to be good enough to load da current mp3 files from da mobile memory. So i guess dis puttin files in "res" folder wont do ane good........
Quote:Original post by Palidine
i'm not 100% sure that MIDP would allow you access to the phones file system at all except in folders local or child to the one in which your app is installed. I'd read through the MIDP documentations about accessing the local file system and see what the API has to say about restrictions for doing that, etc.

you can find some of the relevant docs here:
http://java.sun.com/j2me/docs/index.html

the rest you can find on google.

-me


well if MIDP 2.0 does'nt support file accessin den it cannot be capable of makin sms readers type programs too, but i've seen sum good programs which r alternates of readin sms of yr mobile dan da one build-in in da mobile. I wish i could get da code of dese programs but i guess i've to wait for u guyz to figure dis prob for me.

n i've been goin through da whole documentation of J2ME or MIDP2.0 but could'nt find anething at all
Quote:Original post by Volverine
n i've been goin through da whole documentation of J2ME or MIDP2.0 but could'nt find anething at all


did you try google yet? i found some stuff pretty quickly:

http://www.google.com/search?q=midp+file+system&sourceid=firefox&start=0&start=0&ie=utf-8&oe=utf-8

-me

This topic is closed to new replies.

Advertisement