SD card for Android Simulators

Source: Internet
Author: User

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/unix_fans/archive/2009/08/20/4465038.aspx

1. Create an image file

Run cmd to enter the tools directory of the android SDK and run mksdcard to create the SDK.

For example, my tools directory is: e: \ Skyland \ android-sdk-windows-1.0_r2 \ tools>

Then: e: \ Skyland \ android-sdk-windows-1.0_r2 \ tools> mksdcard 128 M sdcard. img

The first parameter is the size of the sdcard to be created (determined by the size), and the second parameter is the name of the sdcard.

2. Start the android simulator with sdcard

In the DOS interface just now, E: \ Skyland \ android-sdk-windows-1.0_r2 \ tools> emulator-sdcard. img

In this way, a folder named sdcard. IMG. Lock is generated dynamically under the tools directory, and disappears when the simulator is disabled.

Note: Do not close this DOS window. Otherwise, the simulator will be closed and the subsequent step cannot be executed.

3. Add a file to sdcard

In addition, to open a DOS window (CMD), you still need to CD it to the tools directory of the android SDK, and use the ADB push command to add

E: \ Skyland \ android-sdk-windows-1.0_r2 \ tools> ADB push new. jpg/sdcard

The first parameter is the full name of the image (mp3) to be added. If there is a space in the name, enclose it with double quotation marks.

For example: e: \ Skyland \ android-sdk-windows-1.0_r2 \ tools> ADB push "first startcard"/sdcard

The second parameter is the newly created sdcard.

4. view the added file

In this step, you may need to restart the android simulator with sdcard to view the resource file you just added. That is, you must first turn off the simulator,

Then E: \ Skyland \ android-sdk-windows-1.0_r2 \ tools> emulator-sdcard. img

After the simulator is started, click the arrow --> Dev tools --> raw image Viewer on the menu to display the slides.

See the newly added

Image file, and then control the Image Browsing by following the following left and right

Some people say that the arrow --> Dev tools --> media plugin on the menu can be used to view the added MP3 file.

Yes. If any, leave a message...

My method is: the arrow --> music --> songs on the menu shows the added MP3 file. Click enjoy.

The first English name was originally used, but I don't know why it was garbled. The name of the file I added is different from the name of the display song.

================================== Use sdcard in myeclipse ==============

If the. imgfile is not created, go back to the beginning and do step 2.

Note: If you do not start the simulator in step 1 but do the following, an error will be reported saying that sdcard is a read-only file,

Failed to add

1. Start mueclipse and choose Window> perspective> Other> ddms.

Select the sdcard and click push to add the image resources to the sdcard.

2. Use sdcard resources to compile Android shouldProgram

If you need to use sdcard resources when compiling Android applications

Right-click Run as --> open run dialog --> Target

Add the startup parameter to the aditional emulator command line options of the target tag.

-Sdcard E: \ Skyland \ android-sdk-windows-1.0_r2 \ tools \ sdcard

Note: it is an absolute path.

If the simulator is not started in step 2, the corresponding sdcard In the permissions column will be "---------"

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/ligaoyang/archive/2009/08/25/4484046.aspx

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.