A newbie guide to android development
One of the reasons I wanted an Android based smart phone was that I was feeling the need to try something different from the daily php based work . It was time to learn something new , something a little exiting and on the forward edge.
Any time access to the web from mobile platform’s is without doubt the culmination of the dream. This is the killer app aspect of the Internet and people are waking up to this reality. Smart phones , net book’s and in the near future pad style devices will change the way we interact with the cloud. By its open nature I believe android will play a big part in this.
First task then was to get the environment set-up.
To do this we need two pieces of software installed eclipse the popular cross platform IDE and the Android SDK. You will also need to ensure you have Java installed and set-up on your machine.
I tried to set this up using the version of eclipse available to FC10 via Yum but encountered real issues late in the process so I downloaded the classic version from the eclipse website http://www.eclipse.org/downloads/, which just needs extracting and then runs with out any futher installation .
Download the Android SDK from Google and install it
This is easy enough just unpack the download into a directory. Like eclipse the software runs in place
Set up your path
While not an essential step adding the location of the CLI android tools to your path will probably make life a little easier.
To do this edit your ~/.bashrc file and add a line to the bottom:
export PATH=${PATH}:/home/matt/android/android-sdk-linux_86/tools
Install the Android Development Tools (ADT) for Eclipse
Firstly launch Eclipse.
Follow the excellent instructions at http://developer.android.com/sdk/eclipse-adt.html to install the development tools.
Install packages for eclipse
Next you need to install a bunch of packages . In Eclipse, click “Window->Android SDK and AVD Manager.” In the resulting window, on the left-hand side will be an “Available Packages” option. Click that, then click the checkbox beside the “repository.xml” package to select all available packages and then click “Install Selected“. Once this has completed your ready to begin developing your first android application
Create you first application
The traditional starting point for learning any new language is the humble ‘Hello world’ and is android is no different. Follow the tutorial at
http://developer.android.com/guide/tutorials/hello-world.html for a nice introduction to the android architecture.
Set up a connection to your hardware
The hello world tutorial introduces you to the emulator included with the SDK. But if you have an Android powered handset you’ll find it a lot less pain to set up a debug/test connection to your hardware.
To do this first, set your phone for USB debugging.
In your Android phone, go to Settings -> Applications -> Development menu, and make sure “USB debugging” is checked (activated).
Connect the phone to your computer via USB cable.
In a terminal type the lsusb command to list all USB devices.
Identify the VendorID and ProductID of your device
Bus 001 Device 065: ID 22b8:2d66 Motorola PCS
VendorID in my case is 22b8 the ProductID is 2d66
As root type
vi /etc/udev/rules.d/51-android.rules
to create a new file and paste the following rule into the file
UBSYSTEMS=="usb", ATTRS{idVendor}=="22b8", ATTRS{idProduct}=="2d66", MODE="0666"
Re-connect your phone.
Your phone should be detected if you unplug and reconnect it to the computer.
Restart the ADB server
adb kill-server
adb devices
You should see your device listed.
You can now access your phone from the Eclipse IDE and run/debug applications on it.
Useful links
http://www.mattcutts.com/blog/install-android-on-ubuntu/
http://developer.android.com/guide/tutorials/hello-world.html
http://www.futuredesktop.org/developing_android_apps_on_ubuntu.html
This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.






















Recent Comments