Android Studio is an official IDE ( Integrated Development Environment ) for Android application development which is announced in Google I/0 2013.
Android Studio is developed on the top of JetBrain’s Intellij IDEA a well known IDE for Java application development.
This article explains how to setup, configure and create an Android application in Android Studio IDE in the Linux distribution Ubuntu 12.04. This also explains some of the commonly occurred errors while working with Android Studio IDE.
Setting up Android Studio
1. Download Android Studio
We can download Android Studio from the given below link :
2. Extract the downloaded file to /usr/local
$sudo tar -xvzf /usr/local/android-studio-bundle-130.677228-linux.tgz
3. Set the environment variable JAVA_HOME to installation directory of Oracle ( Sun ) Java Development Kit
$JAVA_HOME=/usr/java/jdk1.7.0_21 $export JAVA_HOME
Note : In order to set the environment variable permanently, add the above commands to the file [users_home]/.profile.
4. Start Android Studio
We can start the Android Studio IDE by entering the given below commands :
$cd /usr/local/android-studio/bin $./studio.sh
Import Settings Screen is shown in Figure 1 :
Splash screen of the Android Studio is shown in the Figure 2 :
Cnfiguring Android Studio
5. Configure Android Studio IDE
Now click “Apply” and then “OK”
Creating a new Android Application Project in Android Studio
6. Select “Create Project” from Welcome dialog window
8. Download Gradle Build System
For the first time, Android Studio will download and install Gradle build system, but may take some time
9. Enter Project details
10. Design application launcher icon
11. Create a blank activity
12. Enter MainActivity details
13. Preview the application layout
Creating an Android Virtual Device
14. Open AVD manager from the menu Tools -> Android->AVD Manager
15. Create an AVD by clicking “Create” button in AVD manager dialog window
Running the application
16. Choose Android Device
We can run the application from the menu “Run -> Run ‘HelloWorld-HelloWorld’
17. Screenshot of the application in execution
Download source code
18. Download source code
Common Errors & Quick Fixes
19. ‘tools.jar’ is not in Android Studio classpath
This error is usually occurs, if the environment variable JAVA_HOME is not set.
Please ensure that the Step 3 explained above is followed correctly.
20. Plugin com.intellij failed to initialize and will be disabled: null . Please restart Android Studio
This error may be fixed by installing Java Development kit in the path /usr/java
21. Your Android SDK is out of date or missing templates. Please ensure you are using SDK version 22 or later.
One of the method to fix this error is to configure the Android Studio ide as mentioned in the Step 5.
I am George Mathew, working as software architect and Android app developer at wptrafficanalyzer.in
You can hire me on hourly basis or on project basis for Android applications development.
For hiring me, please mail your requirements to firstname.lastname@example.org.
My other blogs