Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917
Accepted Solution

Non-string resources

I created a project in the Blackberry JDE, wrote my code, and added an mp3 (in a folder) to the project. The final goal is to play the mp3 using the javax.microedition.media classes. The problem is that I cannot seem to figure out how to access the mp3 from the folder in the project.

 

I read that when I try to open the file, the app will search for the file. When I try this it doesn't work an I get an error.

 

Since it is not possible to get the current directory of the app, what do I have to do to open the file?

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.
Developer
Posts: 4,764
Registered: ‎07-21-2008
My Device: Not Specified

Re: Non-string resources

See this thread for code that retrieves an MP3 as a resource that was added to the COD file.

 

http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&message.id=11616&query.id=29...

Developer
Posts: 1,805
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.2.1.3253, Z10 (STL100-3)-10.3.1.997 Dev OS, Z30 (STA100-5)-10.3.1.997 Dev OS, Passport (SQW100-1)-10.3.0.1418, PlayBook (16GB)-2.1.0.1917

Re: Non-string resources

Thank you, that worked.

 

I have a Storm and am running into the same issue they did (audio not playing through speaker, only headphone) but I am going through the post you gave to fix the problem.

---Spends time in #blackberrydev on freenode (IRC)----
Three simple rules:
1. Please use the search bar before making new posts.
2. "Like" posts that you find helpful.
3. If a solution has been found for your post, mark it as solved.
--I code too much. Well, too bad.