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
New Developer
Posts: 5
Registered: ‎07-31-2009
My Device: Not Specified

API Access Media Library

 

Ok, I am trying to figure out if it is possible to access the list of music loaded on the device using an API?  I know that the device indexes the music on the SDCard, how to get at that list if it possible?  

 

I want to write an app that plays a random song from the list and do not want to search the music for myself if I do not have to.

 

Thanks,

-frank

 

Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: API Access Media Library

Use System.getProperty to get the path to the music folder, then use FileConnection.list to get all the songs in the folder.

---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: 3,951
Registered: ‎07-15-2008
My Device: Not Specified

Re: API Access Media Library

Adding to rcmaniac25, you could give a look at the fileexplorer demo application shipped with JDE, you will get a good knowledge on usage of FileConnection APIs.


Use Search. "Accept Solution" If the problem is resolved.
New Developer
Posts: 5
Registered: ‎07-31-2009
My Device: Not Specified

Re: API Access Media Library

Thanks, I know how to do file connections, I just thought there was a DB already somewhere since when I go into the media player, it already has my files sorted by artist, album, etc anything in the meta information.  I wanted to access what I assume is a pre-existing DB that the Blackberry already indexes when you insert the SD card.

 

-frank

 

 

 

Highlighted
Developer
Posts: 1,807
Registered: ‎04-28-2009
My Device: Z10 (STL100-4)-10.3.2.858, Z10 (STL100-3)-10.3.1.2576, Z30 (STA100-5)-10.3.1.2582, Passport (SQW100-1)-10.3.1.2576, PlayBook (16GB)-2.1.0.1917
My Carrier: Verizon

Re: API Access Media Library

I don't think it is possible to get that information.

---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.