Is there a way to store android application data on the SD card instead of in the internal memory?
I know how to transfer the application sqlite database from the internal memory to the SDCard, but what if the internal memory gets full in the first place? How does everyone handle this?
Is there a way to store android application data on the SD card instead
Share
Warning: This answer is out-dated. You should use Environment.getExternalStorageDirectory() to get the root path of the SD card as mentioned in the answers below.
Old Answer so the comments on this make sense:
Adding
/sdcard/to the root your path should direct your Android application to use the SD card (at least it works that way with the G1). Android’s file system objects give you the ability to check file sizes… so it should be possible (if tricky) to write some fail-over code. This code would adjust your root path if the internal memory filled up.