06-07-2012 01:24 AM
Hi, i'm trying to develop a music player app for bb10, so I'm using the mmlibrary.db file to obtain information. But since I don't have a dev alpha yet, I'm having trouble adding music to the simulator and getting the mmlibrary file to update itself. I tried to download some tracks on the simulator via the browser but the mmlibrary file does not seem to update itself. Can someone with more knowledge provide some insight into how the database works and how to transfer files to the simulator. Thanks
06-07-2012 01:35 AM
You really shouldn't be looking at that database. It's private, yucky, useless, and undocumented.
Kidding aside, I'm pretty sure the only way that the database is populated is by the Music app itself. Pictures and videos are different, seems there is a background service that takes care of that. All of this may be completely different on the simulator, they may have removed those daemons. Unlikely, but possible.
See if you can load up the Music app into the simulator. I can't detail here how to do it, but if you search around, I'm sure you'll find a way...
06-07-2012 07:59 AM
06-07-2012 09:19 AM
I was kidding. Use the database, that's what it's there for.
06-07-2012 09:24 AM
06-07-2012 09:34 AM
The issue with loading the music player is two fold. First, you need to find the BAR file that contains it. That's the part that cannot really be discussed on this official forum, for various reasons. Use Google.
After that, you just need to deploy it like a regular app. It's getting that BAR file that's the issue.
Anyway, there's an easy way to figure out if there is a background daemon handling all of this.
1. Copy mmlibrary from the simulator to your desktop via ssh.
2. Download some music into the shared music folder in the simulator.
3. Wait a few minutes...
4. Copy the mmlibrary from the simulator to the computer again.,
5. Using an SQlite viewer, open the two copies of mmlibrary that you now have and explore, looking for changes and differences.
If there's a background daemon, you should see some differences. If not, then you likely need the music app to fill these values in for you. But I'm still unsure of how this would translate to the device because (and I'm not kidding this time) it is undocumented. Hopefully that will change.
06-08-2012 01:51 AM
The database is populated by the media indexer which monitors the /accounts/1000/shared directory for new files. It makes use of an event stream from the filesystem so there is no polling. It is possible that on the simulator, this functionality is not fully functional.
Rebooting should cause it to re-sync any files that it finds under that directory.