the file should appear in the DDMS file explorer. Not that the location on the Android phone (the “/sdcard/” part) needs to have “unix-style” forward slashes, so keep that in mind if you’re running on Windows.Īnd that’s it. The following command pushes the file to your sdcard: adb push myfile.mp3 /sdcard/ Open the file explorer and you should be able to open the sdcard:Īdd files to the sdcard: There are two options: either you can use the two icons in the top right corner of the DDMS tools ( ) or you can use the command line tools. If the DDMS isn’t in the list, click “Other…” and choose it from there. To access it: click on the open perspective button: The best way to do this is in the DDMS tool. Next start the emulator and verify that the SD card is loaded. Open the “Run configurations…” dialogue and configure the image as follows (don’t forget to put in the correct directory) In there you need to specify the image on the command line. I’m going to assume you’re using the Eclipse tools. If you want to access the image, the emulator must be running with the image loaded. For instance: mksdcard -l mysdcard 128M sdcard.img Creating an image is done via the mksdcard tool.
This is comparable to, for instance, an ISO image of a CD-ROM. MTP file types are set automatically based on file type detection using libmagic. The goal is to create a well behaved filesystem, allowing tools like find and rsync to work as expected.
The emulator can emulate this, but you need to jump through a few hoops:įirst, you will need to create an SD card image file. It was specifically designed for exchaning files between Linux (and Mac OS X) systems and newer Android devices that support MTP but not USB Mass Storage. For instance, if you want to load MP3 files on a “real” Android phone, you’ll probably insert an SD card into the phone. The first issue I ran into was trying to load files into the Android emulator.
Only for beginners and intermediate Android developers. So I’m going to try and document a few of the basic things that you’ll probably need to know to start developing Android applications.
The information is there, it’s just hidden behind a few layers of Android theory. Many of the tools have little documentation and no usage examples. However, the documentation has a few blind spots. There’s extensive documentation and information on the architecture, the different components and best practices. In a previous post, I mentioned how user-friendly Android is for developers.