How to install SD card on Android emulator (1.6)

I want to install an SD card on an Android emulator (1.6). I am using Eclipse 3.4.0

I found one command to install the SD card:

mksdcard

But where to execute it, I don’t get ??

I tried using Dev tools → Terminal Emulator

But he gives an error: permission denied

Thank..

+5
source share
5 answers

this is the easiest way to make sure your SD card is properly connected to your emulator instance - this is to create an AVD with an SD card. Do it this way: in Eclipse: Window => Android SDK and AVD manager => Create:

-give AVD ( )
-give SDK
-give SD-
- AVD

, , AVD, SD-: (windows/linux?) cd sdk/tools :
mksdcard 256M NameOfYourCard
( , )

" ":

-sdcard fullPathToYourCard

. ,

+11

android, , SDK/tools/.

, .

+2

Eclipse. > Android SDK AVD Manager > (). SD-.

0

/tools sdk

Android SD-

android.bat create avd -n jonas2 -t 1 -c 256M

emulator.exe -avd jonas2
0

Eclipe, " Android", " Android", AVD, , " " , SD- , ": 256 512 1024" , " ", "". "Run Configuration" AVD-, AVD , SD- "".

.

SD-, :

:

1) Android . 2) , , . 3) , SD-:

File sdCard = Environment.getExternalStorageDirectory();

4) , :

File dir = new File (sdcard.getAbsolutePath() + "/folder1/folder2");
dir.mkdirs();
File file = new File(dir, "example_file");

5) "/folder1/folder2" , . , . , "example_file" , .

6) SD-:

FileOutputStream f = new FileOutputStream(file);

, 7:

Save the file, then compile it and test the application using the Android emulator software or device.

It will work !!!; -)

0
source

All Articles