Abugadro Blog

Because Developers are People Too!

Storing databases on SDCards

Posted by Nushio June - 30 - 2010 - Wednesday

Abugadro stores the database on the SDCard. Since all (current) Android devices have limited internal memory, storing “megabytes upon megabytes” of data for each application is unreasonable.

The problem with storing stuff on the SDCard is that there isn’t a single defined directory where developers can store stuff, and the user can easily back up.

Since I’m releasing 0.1.0 soon, and need to nuke the current database, I might as well use the nuke option to regenerate the db in a different place, but where?

I currently store stuff on /sdcard/data/net.k3rnel.abugadro/ (Unless there’s no SDCard, which means it’ll use the Internal Storage instead).

I noticed Google Scoreboard stores its db on the root of the sdcard, creating /sdcard/com.google.android.apps.scoreboard. I find that hard to organize and backup. Kindle creates its own “kindle” directory, as does Android Comic Viewer and Aldiko.

The Weather Widget included in CyanogenMod (And probably Android 2.x) creates a folder called Android, then data, then the path, with the result as: /sdcard/Android/data/com.google.android.apps.genie.geniewidget.news-content-cache

I think that as developers, we should come up with one shared path to store our files, so as to not ‘pollute’ the user’s sdcards with dozens of weirdly named directories. If the user knows that he can back up and restore the contents of Android safely, he’ll probably do so.

So, using what little powers I have, I’m asking devs to please use /sdcard/Android/data/your.package.name/ to store your files in there. I know I will, and based on some other Android users, so does CoolIris, Google Earth and other apps.

Thanks for your time.

Note: I mention /sdcard as a path, but actually use Environment.getExternalStorageDirectory()+”/Android/data/”. You should too.

Comments are closed.