Skip to main content

Posts

Showing posts with the label how to write data into android sd card

save data to sd card in android

In android you can save data by using the shared preference and files. But if the data size is much large, then using files or shared preferences is not a suitable option. You can save a large data from an android application into the external sd card available in that device. By using the external sd card for saving the large data, you got the following advantages. 1. You can share the app data to other devices. 2. You can save data of any size by expanding the external sd card memory size. 3. You can easily backup your data. In an android application for saving data into the external sd card you have to follow the steps given bellow. Step 1: Obtain the path of the sd card Use the getExternalStorageDirectory() method for getting the full path of the sd card. For real devices it return "/sdcard" and "/mnt/sdcard" for android virtual devices(AVD). Example:   File sdcard = Environment.getExternalStorageDirectory(); Step 2: Create a directory on t...