Android is the prime OS for developing applications in today for many reasons. The main reasons being that it is Open Source and Intuitive. In addition it uses Java for development, which is quite an easy language to get used to and develop in. This being said, a lot of you have great ideas for Android applications or applications in general but don’t know where to start. This series will take you behind the scenes and introduce you to the software that will be your best friend while developing for android. On this journey we will start with a “Hello World” and move on from there to create a database driven application with a touch and scroll interface. The final result will look something like this:
Working with tools to develop Android applications will be your greatest asset as you will come to realize early on. All of the tools I use will be listed to make development speedy and efficient while still looking good along the way. At best you will need to acquire Eclipse, I recommend the Eclipse IDE for Java EE Developers version as it is amazing for other types of development as well. The next tools you will get are the Android SDK, which allows you to hook the SDK into eclipse to reference its API and design an efficient functioning program. After that, this part is optional, look into DroidDraw which is essentially a GUI for designing the interface side of things so that you don’t have to blindly hack your way through the Android SDK and Java jungle.
Eclipse is fairly straightforward to setup and start using the Android SDK, you just have to download a package to include the SDK to Eclipses referenced files. To do this we will go to Help and then to Install New Software. We want to click Add to be able to look up just Google’s packages they want us to download. In the location field enter https://dl-ssl.google.com/android/eclipse and click OK. Check both boxes and proceed to the next screen. You should make sure Android DDMS and Android Development Tools are both listed before going on. Accept license agreements and click Finish. You will have to restart Eclipse but after that your hook in is ready to be setup.
Android SDK is fairly straight forward to download for any system but updating it and hooking it into Eclipse is the key. After downloading the zip file (I’m using Windows/Linux but Windows examples will be default), unzip it to your C Drive and label the folder it will enter AndroidSDK. After entering said folder double click on the setup icon which will take you to the screen that shows you all the updates available for download. Download the latest updates and proceed to the top option Virtual Devices where you will make your first emulator. NOTE: if an update list does not show you will have to set the setup client to use http instead of https. When creating the emulator the name doesn’t matter and all you really need to set is a version you want to develop on. We will pick Android 1.5 from the list because if you decide to market an application you can reach more people and for the API’s we will use we don’t need 2.1 or 2.2. After setting up your emulator you are ready to have the two meet for the first time.
Going into Eclipse you will click the Window button and navigate to the Preferences option and click it. Select the Android option on the left and there will appear in the right side of the window a blank screen with a browse button. Click the button and find your AndroidSDK directory in the C drive and select that folder. Clicking Apply will make the blank window you were looking at show many different versions of the Android SDK and if you are able to see it you are on the right track. Click OK and we are ready to start developing.
NOTES: DroidDraw will be spoken about in another post in this series and we will use it to make part of our interface and the other half we will code ourselves. For everyone else developing in Linux I have found an awesome post that will describe how to set up your environment for Ubuntu and can possibly be transitioned for Red Hat and the like. Anyone who is having trouble feel free to let me know the issues you are having and I will try my best to not leave you behind before the next post.
If you can’t wait for the next post, browse the examples on the Android Developers website.
Articles used for reference:
Android Developers – Installing ADT Plugin
Continue on to Part 1, Hello world.