is there a way to store android application data on the SDCard instead of 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?
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.
The problem with using the SDCard is that you cannot reliably assume that it will be present always when your application needs it. This is not the case with internal memory. As long as your application does not rely on this data to run it should be fine.
It's better practice to use Environment.getExternalStorageDirectory() than to hard code "/sdcard" It's not always certain that the folder name will be called that. Also, the Environment class offers a getExternalStorageState() method to check on if the external storage is even available.
user121196, sorry to ask a question within your question, but i see you said "I know how to transfer the application sqlite database from the internal memory to the SDCard". I been trying to look for a example/tutorial/code snippet of how this can be done. Can you guide me, please?
hi... am working on a video player project on android phone... but i dnt kno how to store videos in the application itself........ when the user installs this application he shud get the 3gp videos within the application ........user need nt can any one help me out pls..?and can anyone tel me the process of creating sdcard image for emulator