Most native Android development these days occurs in either Eclipse (with plug-ins) or Android Studio. Eclipse has been around forever and has a much bigger installed base. Android Studio, which was first announced in May 2013, was in Beta for about a year and a half.
As reported here in December, Android Studio is now considered Production. In fact, Google strongly encourages developers begin using Android Studio, calling it “The official Android IDE” (Integrated Development Environment) for Android.
While this is definitely good news for Android developers, moving to a new platform is sure to cause some angst as other activities are put on hold as we climb the learning curve and work through inevitable issues. Not having a strong development background myself, some questions I have include, will Android Studio be easy for me to learn? How easy is it to import projects? If I purchase a template at Chupamobile and the available instructions are based on Eclipse, are there enough similarities that I can follow along and efficiently perform a reskin?
So before we even install Android Studio, let’s review what others are saying about it:
- Starting a Project – new Code Templates and ability to bring in Google code samples from GitHub
- More Efficient/Effective GUI – since Android Studio is focused on Android development, it does not carry all of the legacy baggage of Eclipse
- Better Management of Workspaces and Projects – a Project in Android Studio is sort of equivalent to a Workspace in Eclipse. Within your Project, things are considered Modules which can be your code or some libraries or even build scripts. Also, Android Studio’s installer sets up the correct SDK and development environment with a better emulator and set of code templates.
- Code Editor – better code completion, refactoring and analysis
- Dynamic Layout Preview – gives you the ability to see apps in multiple screen sizes with drag and drop functionality. This gives you the ability to see what your app would like not just on different phones and tablets, but also Google Glass, Android Auto and Android Wear.
- Gradle Integration – Gradle is a set of build tools that you could use with Eclipse, but it is an integral part of Android Studio
- Google Cloud Platform – Android Studio has native support for Google Cloud Platform which does allow some cool things. You can access Google Cloud Platform via Eclipse, but apparently things are more straightforward in Android Studio.
- More robust integration of build system, Lint tools (to deal with performance, compatibility and usability), ProGuard and more!
Can you still effectively perform your Android development work with Eclipse? Yes, but Eclipse is an old platform and now that Android Studio is in production, the contrast between the two platforms will become clearer and clearer as Android Studio receives more of Google’s attention. If you are planning to develop Android apps for some time, you will probably eventually migrate anyway. You might as well migrate now, and start reaping the benefits sooner and longer. As with anything, there will be a learning curve. But once you have spent some time in Android Studio, it sounds like Android Studio’s ease of use will allow for a more efficient and pleasant Android coding experience. So let’s give it a try.
Step 1 – The Download
Step 1A – Check System Requirements & Click the Download Button
Android Studio supports Windows, Mac OS X and Linux. To get started go to http://developer.android.com/sdk/index.html to verify System Requirements and when ready click the appropriate download button.
The webpage should recognize your operating system and word the button and tailor the installation itself to the correct OS. The remainder of this article describes my experience based on a Windows system. Experience with Mac or Linux will vary, but most information should be common across the three platforms.
Step 1B – Terms and Conditions & The Download
After clicking the download button, you are taken to a Terms and Conditions screen. If you already use Eclipse with the Android plug-in, I THINK you have already agreed to these terms of service. They are dated November 13, 2012, and indeed the word Studio does not appear in the Terms and Conditions at all. After reading the Terms and Conditions, I checked the box that says “I have read and agree to the above terms and conditions” and clicked the “Download Android Studio for Windows” button.
You will be prompted to designate a location for the downloaded executable file. The file is named android-studio-bundle-135.164.1136.exe. It is 828 MB and took several minutes to download.
Step 2 – Java Development Kit (JDK)
While the Android Studio executable is downloading, you should take care of your Java Development Kit or JDK. If you are going to develop for Lollipop (Android 5.0) you will need to be using version 7 or higher of the JDK. Go to http://www.oracle.com/technetwork/java/javase/downloads/index.html to download the latest version.
Apparently a common problem is the Android Studio launcher script cannot find Java even when using the correct version of the JDK. To avoid this problem, open Control Panel > System and Security > System > Advanced System Settings > Advanced > Environment Variables > New. For your Variable Name, type “JAVA_HOME” (without quotations) and for Variable value, type the path where you placed your JDK (see my example pictured below.)
Step 3 – The Android Studio Installation
Once your download of the Android Studio executable is complete and you have updated your JDK and the JAVA_HOME Environment Variable, you are ready to launch the .exe file. For me, this simply meant clicking the button that Chrome showed me. This launched the set-up wizard pictured below.
After clicking “Next”, the steps you are taken through are pretty straightforward and you will probably accept the defaults and recommendations that Google offers:
- You will first be asked to choose components (Android SDK and Android Virtual Device). Both are checked by default, which I left as-is.
- You are asked to agree to the License Agreement. I read the agreement and chose “I Agree”.
- The next screen is called “Configuration Settings” and it asks you where you would like
- Android Studio Installation Location – my installation defaulted to C:\Program Files\Android\Android Studio. I accepted this default.
- Android SDK Installation Location – my installation default location was C:\Users\dan\AppData\Local\Android\sdk. Again, I accepted the default.
- The next two screens (Emulator Setup and Start Menu Folder) are straightforward and I accepted recommendations and defaults.
The actual installation then takes place. For me, it took about four minutes. Click “Next” when notified of its completion and you are shown a screen allowing you to close Setup. It defaults to launch Android Studio.
Step 4 – Opening Android Studio the First Time
This is the point where you will know if your instance of Android Studio is correctly finding and interacting with your Java Developer Kit. If you get errors, perform a Google search of the specific error message you are seeing.
Upon successfully opening Android Studio, you are asked whether you have settings from a previous version that you would like to import. I chose no.
Android Studio then begins downloading the SDK Tools. In less than ten minutes the download was complete and I pressed the Finish button.
You then see a Welcome screen that gives you several options, including start a new project, open an existing one, import code samples and more. Congratulations – you’re in!
Each of the options of the Welcome screen has its own flow and nuances that will be explored in detail in upcoming articles. In the meanwhile, have you made the switch to Android Studio? Do you have any tips you would like to share with the Chupamobile Blog community? Please comment below.