Proper way to maintain an extended android media database a la MediaStore?
Based on the results of my query in this thread, I've decided that I need to maintain my own database of metadata for the media that I'll be accessing. It seems like MediaStore is a very good start for this, as it will give me a good deal of information and is regularly updated by the MediaScanner. In an ideal world, I would add a few columns to the MediaStore database and modify the MediaScanner to scan the relevant sources of metadata to update thos开发者_如何学编程e columns (ideal for me - maybe not ideal in terms of resource allocation).
For those who understand the way media is stored in Android - what are my options? Should I create my own ContentProvider database or is there a way to do something akin to adding a table to the MediaStore database (i.e. a new table with entries corresponding to every relevant ID and columns for each new piece of information I'd like to store)? Is there a way to ask the MediaScanner to update my database when it is updating the normal media database, and if so would that be considered bad form (i.e. should I wait until my app is opened to update my database)? What are the best practices for something like this?
Doing kind of the same thing, so far, I have decided to go the hard way (I did not find anything easier): synchronize my own database with the media store on a regular basis.
I am for now struggling with genres. But I manage to get some rather good results for synchronisation (still need to test performance more toroughly though).
精彩评论