Page 1 of 2

Where is the song database stored on Android

PostPosted: 19 Dec 2016, 17:04
by mmediaman
Can anyone advise where the song database for Cross DJ is stored on Android?

Looking for a way to import Cue points from Virtual DJ, Serato or Mixed in Key. I know the PC version of Cross DJ has a 3rd party import feature, but what about the Android or iOS version for that matter?

Re: Where is the song database stored on Android

PostPosted: 19 Dec 2016, 17:27
by RoJeC
It's the mediabase of Android.

Re: Where is the song database stored on Android

PostPosted: 19 Dec 2016, 17:55
by mmediaman
Thanks @RoJeC you mean "mediastore" like the one here: /data/data/com.android.providers.media/databases/internal.db

...which it appears you can't get to unless your device is rooted. If anyone has any suggestion on how to hack into this file it will be greatly appreciated. :lol:

Re: Where is the song database stored on Android

PostPosted: 23 Jan 2017, 15:31
by vespadj
The database in under /data/data/com.mixvibes... that is protected by root.
If you want modified it you need root access and good knowledge of SQLite.
There is no another way, adb or backup included.
All of that it's not suggested.
Also I would like database in an accessible path, it be usefull also for backup or transfer sd and db from a device to another new.

Re: Where is the song database stored on Android

PostPosted: 23 Jan 2017, 15:45
by RoJeC
It seems a simple request. Unfortunately Android makes it a not so simple situation.
Even if you 'copy' from one identical version to an other device there is the problem that multiple processes control the mediabase.
So if you add tracks these are detected and added at once. If you restore the backup the references to files are already there by other keys.
If you first restore the mediabase, it will detect missing tracks and delete them before you can add them.

Just making a full Cross database will result in significant increase of stored data. And it will frequently cause the mediabase processes to run in parallel with Cross, causing cpu load.

Re: Where is the song database stored on Android

PostPosted: 24 Jan 2017, 09:47
by vespadj
Yes, crossdjdb is syncronized with android media db, but after that all information you need are in the crossdjdb.
I know very well SQL so I do it last year, but to do it I had to root my device and it's not always possible nor recommended.

In db, the path of mp3 is in field "_data".
My mediastore was corrupted for pics and videos, I regenerated it cleaning media provider app. So all media was renumerated and CrossDj2 db erases all values.

Position of songs ("_data") are the same so I repopulate crossdj db from a backup (db2), coping db on Windows:
Code: Select all
UPDATE main.collection
SET
   bpm = (SELECT c2.bpm
      FROM db2.collection as c2
      WHERE c2._data = main.collection._data )
, harmonic_key = (SELECT c2.harmonic_key
      FROM db2.collection as c2
      WHERE c2._data = main.collection._data )
, cue_loops = (SELECT c2.cue_loops
      FROM db2.collection as c2
      WHERE c2._data = main.collection._data )
      
WHERE
   EXISTS (
      SELECT *
      FROM db2.collection as c2
      WHERE c2._data = main.collection._data
   )
;


if paths change, a replace can be used in filter:
Code: Select all
-- TEST
select
c1._data,
c2.bpm
from collection as c1,
db2.collection as c2
where
c2._data = replace(c1._data, '/sdcard1/','/sdcard0/')
limit 0,100


In a similar way I imported bpm from db of another application (just for sort songs) and it works.

Developers never accepts that user read nor write in db, but someone with the right skills may need it.

Re: Where is the song database stored on Android

PostPosted: 24 Jan 2017, 11:25
by daniel clark
vespadj wrote:
but to do it I had to root my device and it's not always possible nor recommended.

Developers never accepts that user read nor write in db, but someone with the right skills may need it.[/b]


:idea: proceed with caution ,,unless you know what you are doing .
this info is not given by mixvibes ,nor any of it moderators/users ,,so proceed at your own peril :cool:

Re: Where is the song database stored on Android

PostPosted: 24 Jan 2017, 20:15
by mmediaman
Thanks for the replies.

As @vespadj eluded to, most things are possible given enough determination and skill.

In this case, it is such a waste of time to set cues etc. when they have been set in other software. I did a project to copy cue points from VirtualDJ to SeratoDJ and it worked like a charm, although it required too many steps.

The point is that it would be so much more convenient and even inviting if cue point import is possible between softwares. I have to imagine CrossDJ Android/iOS would be much more inviting to potential users if this were possible.

Anyhow, based on what @vespadj said, it looks like this import is possible with root access.

Re: Where is the song database stored on Android

PostPosted: 25 Jan 2017, 09:33
by vespadj
About cue point there is one more problem: each software speaks each own language: probably cue_point is not expressed in time, but in numer of samples from the begin of file. Any files may be in 44100 or 48000 samples/rate per seconds, ... many and many steps occours...

I would have liked to import cue_point but I have not even tried, I don't feel it so necessary, ... djing is using fantasy :)

Re: Where is the song database stored on Android

PostPosted: 26 Jan 2017, 05:38
by mmediaman
@vespadj of course it may not be important to you, but if you have invested a lot of time setting cues in one software and have a need to use another software for whatever reason, then it becomes very painful to re-cue 1000s of songs.

The logic of each software can be programmed. A simple calculation whether it is based on samples or other logic. In the case of samples, the factor can be auto programmatically from the media itself.

As I said, I did it for copying cues from VirtualDj to SeratoDJ. The harder part was figuring out how to write Serato cues to GEOB tags... crazy complicated. Anyhow, would not have to worry about stuff like that if devs for each software already made a feature to import Cues from external.... which is what I would have loved to see for CrossDJ Android. Heck, Browsers do it for bookmarks :D :biggrin: :lol: