Thursday, August 1, 2013

Android Development- Setting Up development environment and Hello World Application

I have decided to start new post series on Android Application development. Before starting the android application development, we need to set up our development environment.

Here I am using the Eclipse IDE for the android application development. In order to set up the android development environment in the existing Eclipse IDE, it is required to install few software tools (Android SDK, ADT plugin etc). I feel like it will take some time and effort to install that in my existing Eclipse IDE. Therefore I downloaded the ADT bundle and extract it. That can be downloaded through the following URL. Make sure that you are downloading the correct version that is compatible with your operating system of the computer.

http://developer.android.com/sdk/index.html

After extracting it ,i was able to find the Eclipse IDE version with build in ADT(Android Development Tools) and components that are essentially required to develop the android apps. I would like to thank to the contributors and the team members of the ADT bundle project team to save my time. By the way, if you wish to configure your existing Eclipse IDE as android development environment, you can refer the following links to do so.

http://developer.android.com/sdk/installing/installing-adt.html

Lets start with the project development now.  As a practice we will try to develop a simple  “Hello World” application to understand the android project structure. You can refer the following link to
create the simple App.

https://developer.android.com/training/basics/firstapp/creating-project.html

once the project is built, it took a long time to load the application on the AVD(Android Virtual Device) emulator and I felt like uncomfortable of wasting such time. Therefore I tried to test the app in my mobile and it took only few seconds. But first time I was deploying my app on the mobile it gives me the following error.

INSTALL_FAILED_INSUFFICIENT_STORAGE

The INSTALL_FAILED_INSUFFICIENT_STORAGE error is the bane of every Android developer's life. It happens regardless of app size, or how much storage is available.

There is a simple workaround. If your test device is running Android 2.2 or later then add the android:installLocation attribute to your application's manifest file, with the value "preferExternal". This will force the app to be installed on the device's external storage, such as a phone's SD card.
For example:

 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.andrewsmith.android.darkness"
    android:installLocation="preferExternal"

I hope that this will be helpful for the new android developers to start their android development on the correct track. If you have any question, you can contact me on chathuranga.t@gmail.com or www.chathurangaonline.com

Cheers
Chathuranga

No comments:

Post a Comment