Use Activit's openFileOutput() method to save the file, and the file is placed inside the phone;
Note: Create an SDCard card image file in the emulator. You can create the emulator. You can also create the android SDK installation path tools directory in the Dos window. Enter the following command: mksdcard 2048M D:\AndroidTool\
To access SDCard in the program, you need to use the followingPermissions:
Permissions to create and delete files in SDCard
<uses-permission android:name=".MOUNT_UNMOUNT_FILESYSTEMS" />
Write data permissions in SDCard
<uses-permission android:name=".WRITE_EXTERNAL_STORAGE" />
public void saveToSDCard(String filename, String filecontent) throws IOException {
File file = new File((),filename); //Get the path to SDCard
FileOutputStream outStream = new FileOutputStream(file);
(());
();
}
// Determine whether the SD card exists and can be read and written
//if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
// (filenamestr, filecontentstr);
// (getApplicationContext(),, 1).show();
// } else {
// (getApplicationContext(),, 1).show();
// }