RSS

Code to create folder in the emulator & also save the data to sdcard in Android

15 Aug

* Code to save the data to sdcard :
In this you can not see the folder in the emulator but its there in the sdcard folder.
You just have to follow below some steps:
1)open DDMS menu inside the eclipse.
2)You can see the File Explorer in that just select the sdcard folder and click on the image of mobile device
which you can see on the right side corner of the File Explorer.
3)then select the perticular file that you want to copy to the sdcard and click on open to save the file in sdcard.

* Code to create folder :
String newFolder = “FSAScandroid”;
String extStorageDirectory = Environment.getExternalStorageDirectory().toString();
File myNewFolder = new File(extStorageDirectory + newFolder);
myNewFolder.mkdir();

And also,in AndroidManifest.xml add one line as
uses-permission android:name=”android.permission.WRITE_EXTERNAL_STORAGE”

Advertisements
 
Leave a comment

Posted by on August 15, 2011 in Android Source Code

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: