This article describes the Android simulator to achieve the mobile phone to add files to the SD card method. Share to everyone for your reference, specific as follows:
Add files directly to the emulator SD card in DDMS if there is an error like this: Failed to push XXXXX.txt on emulator-: Read-only file system error because your SDcard permissions are not sufficient, You need to create a sdcard directly.
First, create SDcard I created the sdcard named: sdcard.img (name arbitrarily, end with IMG suffix name)
Go to Dos Point directory E:\android-sdk_r10-windows\android-sdk-windows\tools (this is the file that installs the Android SDK, the configuration of this environment variable is not necessary)
We enter in DOS:
Mksdcard-l SDcard 100M E:\sdcard\sdcard.img
(The location of this file can be put anywhere)
Explanation:
1. The SDcard command can use three dimensions: bytes, K, and M. If only numbers are used, bytes are represented. The following can also be followed by K, such as 262144K, also means 256M.
2. The minimum virtual file created by SDcard is 8M, that is, the emulator only supports virtual files larger than 8M.
3.-l command line parameters represent the volume label of the virtual disk and may not have this parameter.
4. The suffix of the virtual file. img
You can enter Mksdcard Help in DOS.
Second, after the creation of a good sdcard, we have to load the simulator SDcard
window-"AVD manager-" Select the simulator You use-"Edit"
Then select file in the SD card option and select the sdcard.img you just created, then click Edit AvD to save
Third, then add the file to the simulator SDcard no problem (Note: This is best to restart the simulation)
Four, restart the simulator, find dev tools in the simulator and start, and then find and run Media scanner to the newly added files scanned, display "finished" can exit, this time the added files can be used (For example: MP3 file, when the music player can be found).
For more information on Android-related content readers can view the site: "The Android thread and message mechanism usage Summary", "Android programming activity Operation Skills Summary", "Android debugging techniques and common problems solution summary", " Android Development Primer and Advanced tutorials, Android Multimedia how-to summary (audio, video, recording, etc), summary of Android Basic components usage, Android View view tips, Android layout layout tips and A summary of the usage of Android controls
I hope this article will help you with the Android program.