Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I've noticed that Android keeps the same music playlists across music apps. Where are these playlists stored? How (in what format) are they stored? Can I access them remotely via the USB storage link, or is there instead an app I can use to access them?

Related question: Music transfer and playlists

share|improve this question

1 Answer 1

up vote 12 down vote accepted

They're stored in your music.db file - mine is /data/data/com.google.android.music/databases; I'm not sure if this is exactly the same across all devices but I'd guess it probably is.

They live in a combination of the LISTS and LISTITEMS tables, which are defined as such:

sqlite> .schema lists
.schema lists
CREATE TABLE LISTS(Id INTEGER PRIMARY KEY AUTOINCREMENT, Name TEXT NOT NULL, 
    SourceAccount INTEGER, SourceId TEXT, _sync_version TEXT, 
    _sync_dirty INTEGER NOT NULL DEFAULT 0, MediaStoreId INTEGER, 
    ListType INTEGER NOT NULL DEFAULT 0, ListArtworkLocation TEXT);
CREATE INDEX LIST_SYNC_INDEX on LISTS(SourceAccount,SourceId);
sqlite>

sqlite> .schema listitems
.schema listitems
CREATE TABLE LISTITEMS(Id INTEGER PRIMARY KEY AUTOINCREMENT, 
    ListId INTEGER NOT NULL REFERENCES LISTS, MusicSourceAccount INTEGER NOT NULL,  
    MusicSourceId TEXT NOT NULL, ClientPosition INTEGER NOT NULL, 
    ServerPosition INTEGER NOT NULL DEFAULT 0, SourceAccount INTEGER, SourceId TEXT,
    _sync_version TEXT, _sync_dirty INTEGER NOT NULL DEFAULT 0, 
    ServerOrder TEXT DEFAULT '', ClientId TEXT);
CREATE INDEX LISTITEMS_ORDER_INDEX ON LISTITEMS (ListId, ServerOrder, ClientPosition);
CREATE INDEX LISTITEMS_SYNC_INDEX on LISTITEMS(SourceAccount,SourceId);
sqlite>

Interestingly, if you're using the new Google Music Beta, playlists that you create don't seem to appear in other apps but they do have entries in the DB. It looks like this is possibly because the MusicSourceAccount field is set to your Google Music account id; other apps set it to 0, and those appear across all apps that take data from the DB.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.