This is part one of our Programming for Android series. See part two: Programming for Android with Eclipse.
Setting up the Emulator
Today I decided to crack open the Android SDK and mess around a little bit to see if I wanted to try to develop for it. I'm running Ubuntu 8.04 so I went over to the android site and downloaded it for Linux. My main goal for today was to set up the emulator and have a look around the phone.
Make sure you have JDK 5 or 6. The SDK is surprisingly easy to get going, just extract it to any folder. I chose ~/Programs/android-sdk-linux_x86-1.0_r1/
Getting the emulator to run was really easy. First you have to set the directory where the image is kept. I just made a folder called android in ~/Programs then ran this code:
~/Programs/android-sdk-linux_x86-1.0_r1/tools/emulator -datadir ~/Programs/android
Every time you want to run it after you don't need to set the data directory. Now you should see it booting up. It took me a good minute before it popped up, on a friends old laptop it took at least fifteen minutes.

Here is a picture of the phone when it first boots. It shows that I have no service (of course), the time, the date, and the charge left (which always stays at 50%).

Click menu and you are in! Here is the home screen.
A Look Around

You can mess around with all the applications and test stuff out, as well as get access to some of the development tools. Here is a screen of the menu going up.

The browser works and the sites look nice in it. It doesn't try to resize anything, but will fit the text to the width of your screen. I like it better than most phone browsers I've used.
Setting Up An SD Card
Next I made an SD card for the device. I did that by running the following code:
~/Programs/android-sdk-linux_x86-1.0_r1/tools/mksdcard -l myfirstcard 1000mb ~/Programs/android/myfirstcard
This named it myfirstcard, set it to be 1000 megabytes, and put the file to store it all in ~/Programs/android/. Now you can save pictures, music, and anything else to the emulation.
Next post I'll install Eclipse and the development plugins and run a hello world. So far, Google has made this pretty easy to set up. If that continues to be true maybe I'll start a new project for it.
This is part one of our Programming for Android series. See part two: Programming for Android with Eclipse.









