Friday, May 6, 2011

Android emulator

Android emulator

(1) How to install emulator only (that is no JDK, Eclipse IDE or compiler)

(a) Download Android SDK from
http://code.google.com/android/download_list.html

The current version is
android-sdk-windows-1.0_r1.zip (windows)
android-sdk-linux_x86-1.0_r1.zip (linux)

unzip it and put the folder (android-sdk-windows-1.0_r1) to say under

Windows OS

D:\Android\


Linux / Mac OS X

~/Android/


(b) start the emulator in command windows (windows-R -> cmd) / (Linux/Mac OS X -> Terminal) for the first time to setup data directory

Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
emulator -datadir D:\Android


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./emulator -datadir ~/Android


(2) How to create sdcard for emulator (e.g. 500M)
e.g. To create a sdcard image of 500M with filename sd500m.img

Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
mksdcard -l SD500M 500M D:\Android\sd500m.img


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./mksdcard -l SD500M 500M ~/Android/sd500m.img


when starting the emulator and adding -sdcard option
Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
emulator -sdcard D:\Android\sd500m.img [.... other options]


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./emulator -sdcard ~/Android/sd500m.img [.... other options]


(3) How to scale the emulator size when the emulator screen is out of view of your computer

when starting the emulator and adding -scale option (range from 0.1 to 3)

e.g. start the emulator with a scale of 0.5
Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
emulator -scale 0.5 [.... other options]


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./emulator -scale 0.5 [.... other options]


(4) How to copy Musics and Pictures to the sdcard image for Android emulator

The sdcard image is a FAT32 image. You just double click the file in Mac OSX to mount it.
Inside it, create folders called Musics and Pictures and put your mp3 files and pictures as per screen dump below

(5) How to copy files to sdcard while the emulator is running or when you cannot mount it.

You can mount the sdcard image while the emulator is running, but sometimes you want to copy files to the sdcard in command line mode run this

Make Sure that the emulator is running
Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
adb push mynotebookphoto.png sdcard/Pictures/


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./adb push mynotebookphoto.png sdcard/Pictures/


However, the emulator will need to restart so that it can acknowledge the new file. This is currently the limitation of the emulator

when copying back from emulator sdcard to local file
Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
adb pull sdcard/Pictures/image01.jpg images01_fromsdcard.jpg


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./adb pull sdcard/Pictures/image01.jpg images01_fromsdcard.jpg


(6) How to get shell access to emulator
The emulator must be running, and run this
Windows OS

D:
cd D:\Android\android-sdk-windows-1.0_r1\tools
adb shell


Linux / Mac OS X

cd ~/Android/android-sdk-linux_x86-1.0_r1/tools
./adb shell


(7) How to add path of the emulator tools directory to Windows OS, so as no need to change directory to sdk directory
On Windows, right click on My Computer, and select Properties. Under the Advanced tab, hit the Environment Variables button, and in the dialog that comes up, double-click on Path under System Variables and add this to end of the text
Windows OS

D:\Android\android-sdk-windows-1.0_r1\tools;


Please take note that you have to restart the command window for the path to become effective

(8) How to change skin for the emulator
You can download some iPhone skins for Android emulator here

http://www.anddev.org/emulator_iphone_skin_-_qvga-hvga_landscape-portrait-t109.html

(9) How to change wallpaper, add new icons to homescreen and move/delete icons.

At Home Screen, press Menu

+ Add -> for adding icons to home screen
Wallpaper -> to change wallpaper

You can flip the homescreen to left and right and add icons there

To delete the icon just click and hold the button and a trash will appear above the menu button then you can drag the icon to the trash and delete it

To move the icon, click and hold the icon and then drag to new position.



Watch YouTube Video Link with your iPhone Safari Browser


8 comments:

  1. Do you have a spam issue on this site; I also am a blogger, and I was wanting to know your situation; many
    of us have created some nice procedures and we are looking to swap methods with others, why
    not shoot me an e-mail if interested.

    Also visit my webpage; http://www.a-diba.net

    ReplyDelete
  2. I read this post fully concerning the resemblance of latest and earlier technologies, it's awesome article.

    Look into my website: nothoney.com

    ReplyDelete
  3. I was curious if you ever thought of changing the
    structure of your site? Its very well written; I love
    what youve got to say. But maybe you could a little more in the way of content so people could
    connect with it better. Youve got an awful lot of text for only having 1 or 2 pictures.
    Maybe you could space it out better?

    My webpage ... basearticles.com

    ReplyDelete
  4. Thanks for finally talking about > "Android emulator" < Liked it!

    Also visit my weblog: digitaldividenetwork.
    org

    ReplyDelete
  5. Very nice article. I certainly appreciate this site. Keep writing!


    My page; money Lending

    ReplyDelete
  6. I blog quite often and I truly thank you for your content.
    The article has really peaked my interest. I will book mark your blog and keep checking for new details about once per week.
    I opted in for your Feed too.

    Here is my homepage ... payday loans

    ReplyDelete
  7. This is a topic which is close to my heart... Best wishes!
    Exactly where are your contact details though?

    Look into my blog post ... moneylenders Singapore

    ReplyDelete