I recently got a hold of an Android Development phone. One of the projects I am working on at the iSchool is to port a geolocation demo I made from the iPhone to the Android platform. Calling the task a "port" is being generous: the Apple iPhone development environment is, in many ways, very different from Google's Android SDK. That being said, there are certainly many similarities as well, including similar paradigms for accessing GPS data.
In general, both environments seem to live and die by their ancestral roots. An iPhone App's structure is basically an extension of the Cocoa environment that is used to build applications for desktop Macs. iPhone Apps are written in Objective-C, a language I grew quite fond of after just a few "Hello Worlds." Android Apps are built using plain vanilla Java, along with a huge library of Android specific classes. The Android utility and build tools are great. I love being able to plug the phone into my Ubuntu box, start a shell, and be able to run standard Unix commands directly on the phone.
But no doubt, if you chose to read this post based on the title alone, you've heard all of this before. I got stuck for a little bit trying to understand how to use the Android phone without having an extra SIM card. And no, don't just stick your iPhone SIM card in that thing. These instructions assume you have installed the Android SDK, and you have access to the command line programs in the "tools" directory (such as adb). So, let's just get to business... here is how you do it:
- Plug your Android Dev Phone into your computer via USB.
- Get into the Phone's OS... Open up a terminal and type: adb -d shell
- Now, change to the Phone's settings database directory, type: cd /data/data/com.android.providers.settings/databases/
- Give yourself admin permissions by typing: su
- Now, you are going to use sqlite to alter the phone setting database, and turn provisioning on, so type: sqlite3 settings.db
- Ok, now you should be in the sqlite program. Use this SQL command to alter the settings database: INSERT INTO system (name, value) VALUES ('device_provisioned', 1);
- Now, exit sqlite by typing this (don't forget the "."): .quit
- Reboot the Phone by typing: reboot
When the phone reboots, you need to open up the settings screen to activate your WiFi settings.
- First, get back into the Phone's OS by typing: adb shell
- Now, run this command to open up the settings screen on the Phone, which will allow you to turn on WiFi: am start -a android.intent.action.MAIN -n com.android.settings/.Settings
That's it... from here you can create your Google account, start developing, and even install Skype and make some phone calls over WiFi. For more information about this, check out the "Android Blogging Network."