I have recently done the unthinkable and taken the plunge into full time use of Android Studio over Eclipse for my Android development. This was not willingly mind you, but as a necessity since the project I was to work on was using Android Studio along with its Gradle build system.
After several months of using Android Studio as my full time IDE I have just one thing to say:
I will never go back to Eclipse
Through the years Eclipse has treated me fairly well and is a robust IDE that I have become quite expert at, but anyone that has used it for any length of time for Android development is aware of some of its shortcomings:
- It has a tendency to get slower and crash more often with each successive release
- In order for it to run for more than a few hours you need to edit the config files to give it massive amounts of RAM
- It tends to run out of memory and crash when you are trying to export an APK
- It requires a massive amount of CPU power to use it without getting a please wait beach ball every few seconds. I built a quad core 4.5 GHz machine just to make it usable as my daily driver.
- Theme support is fairly mediocre, there are plugins to add support however none of them theme anything but the code window.
- Creating UI for Android is extremely clunky
- Anytime you touch a file outside of Eclipse you need to tell it to refresh itself. Anyone that works on multiple code branches every day will quickly realize it is very easy to forget to do this.
- There is a mysterious need to constantly “clean” the project. Changed a file not using the editor? Better refresh then clean. Modified just an XML file but not any code files? Better clean or that XML modification probably won’t make it in the build, or worse yet the string values will all offset by one from what they should be.
Welcome our new robot overlords
Android Studio is a welcome change that addresses many of this laundry list of issues in Eclipse and installation is as simple as downloading and dragging it to your applications folder. The first thing you will notice is you can now theme the entire program and it looks beautiful!
Some key improvements
- Full theming takes away much of the eye strain I was getting with Eclipse
- Very stable and does not leak memory forcing constant reboots
- The UI creation tools are vastly improved
- No refreshing! The editor automatically updates itself whenever files are changed outside of the editor. No need to refresh every time I change branches.
- There is no need to constantly clean my projects!
- Command clicking on Android related items actually works. For instance command click on an android id and it opens the XML file it is defined in.
Android Studio has multiple builds in the wild including canary, dev, and beta. I do not recommend running the canary build as it tends to be quite buggy. I recommend running the dev build. After running the dev builds for over four months now I can say that it is a much more stabile development environment than Eclipse. Performance is good and I have never had to close and reopen the program because it was slowing leaking more and more memory and getting slower and slower.
For the Eclipse Convert
An incredible feature is the ability to set your hotkeys to the same that are used in Eclipse. For myself, the main reason I had held out was an intense fear of having to relearn all of the hotkeys I use daily.
UI Creation is Better
Creating UI in Eclipse is painful; not only do you have to constantly toggle between the XML tab and the rendering tab to check your work, but you have to do it twice every time because of a bug where the first time it doesn’t always render correctly. In Android Studio you can actually see the UI rendered as you type the XML. Not only that, but you can click on the fields in the rendering and jump right to the XML. Additionally there is support for design time attributes which allows you to add things like text in each of your TextViews to aid in designing your XML. No longer do you have to design everything with canned data so its not invisible only to have to delete it before you actually commit your code.
Gradle Gradle Gradle
The biggest hurdle to overcome with your transition to Android Studio is that is uses a different build environment in Gradle. While there is absolutely a learning curve here most of the common questions have already been answered on StackOverflow. In addition Eclipse has a new option to aid in migrating from Eclipse to Gradle and migration is generally pretty straightforward.
The first time you try to add a library project or jar file you will need to relearn the process, but once you have it really is pretty trivial. One drawback is many open source libraries do not have Gradle support yet so you will need to use Eclipse to export and add Gradle support. While you are at it why not upload them back to the source repo? Its a great way to move things forward and get some easy Github cred.
Gradle has some real advantages over what you are used to in Eclipse:
- The build process is scripted, meaning you can add useful dynamic features to it
- Adding a GUI toggle for build variants is pretty easy. Want an internal build and a store build? An Amazon and Google build?
- You can export APKs with the version number in the filename
- You can run a script when your APK is created; for instance to automatically upload the APK to TestFlight for internal testing
Do you find this sort of work interesting? Do you love quaint Bucks County Pennsylvania? Are you an amazing Android Developer? Then we would love to hear from you!