Google's new Android development environment pairs rich layout and build capabilities with IntelliJ IDEA's famous ease
Life for an Android developer has always been pretty straightforward. You downloaded Eclipse and installed the Android Developer Tools. The tools did the job, and they worked more or less as any Eclipse developer might expect. But now, Google is disrupting things by shipping the new Android Studio, an IDE that promises a leap forward to Android developers everywhere.
Although the branding is "Android Studio" and the software comes directly from Google's servers, most Java developers will immediately recognize the toolkit as a version of IntelliJ IDEA, the IDE from JetBrains with a fanatical following. I've known developers who will prattle on about the virtues of running a purely open source shop but change their tune when it comes to IntelliJ. One almost sneered at me for not being professional enough to invest $699 in a great tool that can save hours of work.
[ Also on InfoWorld: Review: Xamarin 2.0 works mobile development magic. | Learn how to work smarter, not harder, with InfoWorld's roundup of all the tips and trends programmers need to know in the Developers' Survival Guide. | Keep up with the latest developer news with InfoWorld's Developer World newsletter. ]
Google knows Eclipse isn't everyone's favorite tool. By distributing a free version of IntelliJ configured for Android development, Google not only taps into the stream of IntelliJ zealots, but also gives Android developers a development environment that's easier to install and use, and it has all the bells and whistles. Yet the bigger deal may be what comes next.
A smarter Android IDE
Android Studio is built on top of IntelliJ's community version. The enhancements are a mixture of cosmetic and analytical. Many of the IntelliJ lovers speak fondly of the sophisticated editor and the clean looks. Indeed, Studio runs quickly and offers a responsive interface. Well, the editor does. The Android simulators continue to amaze me with their ability to run Android apps dramatically slower on my six-core desktop than on my tiny, two-year-old not-so-smartphone running Android 2.2. Android Studio only integrates with the simulators, though, so it's not really fair to grouse about them here. Still, the debug cycle pauses when you're waiting for the Android Virtual Device to start up.
The IDE also offers a deep set of analytical tools that will help you fill out your code and analyze it before shipping. The Android API, for instance, is now marked up with more meta information about which routines could send back a null pointer. The Android Studio will use this to try to highlight potential bugs if you forget to catch these exceptions. I took some code that looked fairly clean, but Studio quickly found a hundred or more ways that the code could be made a bit cleaner and, perhaps, quicker. The IntelliJ team spends a long time writing code that analyzes the code you write in the editor so that you can refactor it and make it faster.
One of Android Studio's main contributions is a drag-and-drop set of tools for designing your Android layouts. You can drag around the widgets and the Studio will massage the XML underneath.
Another nice feature lets you pop up the design in six or so devices of various sizes. You can tweak the layout and see how it will be displayed in a Nexus phone or tablet. This is a wonderful innovation for Android developers who must design their apps to fit a large number of different screens. The Android stack does a pretty good job helping the widgets flow into the right places. The most important part of the debugging cycle is testing them. Being able to quickly view the design in multiple screen configurations is a godsend.
Adopting the tool requires a bit of relearning if you're coming to it from Eclipse. Not only are some of the buttons in different places, but Android Studio is heavily integrated with Gradle, the latest build tool. If you're still stuck on Ant or Maven, you'll have to adjust to yet another innovative solution to building your software where everything is slightly different. From the arrangement of the files to the languages, everything has morphed a bit.
A cloudy future
Not everything is ready yet. The Web pages promise, for instance, that Gradle will make it easier to create multiple build variants, but this won't happen until the future. I think the more flexible Gradle build system will be a welcome addition because apps are getting more complicated. When I tested the Studio, I built three different apps that started with a very similar code base. I used three different projects because that was simpler. This kind of work will be more common as we try to gather together more and more parts of a project under one umbrella.
It's worth noting that Gradle is the latest baroque instantiation of a trend toward domain-specific languages that are sometimes described as "mini-languages" with just enough custom structure to handle the job. In this case, Gradle is a Groovy DSL, which means you have to shift gears to think in Groovy and shift gears again to think in Gradle. But then deep in Android Studio you're really writing Java, which means you're writing and thinking in three slightly different but structurally similar languages. While I've always appreciated the idea behind DSLs, the complexity started to wear on me with Android Studio.
Alas, building an app has gotten so complex that we need a Turing-complete build language, so we might as well use the latest and greatest build tools -- today that may be Gradle. Only a tired, old Java hand would want to keep typing out all of those semicolons just to be consistent. The good news is that the cloud-based tools such as Hudson and Jenkins are embracing Gradle, so we can expect more and more projects to use it.
The most interesting part of Android Studio may be the promises of what's to come. The website makes it clear it's an "early access preview," which must be the term that's come to replace the devalued "beta." I didn't run into any serious problems or any issues building a few basic apps, but I did notice a few places where the documentation would blend into the documentation for using Eclipse. One minute I was clicking on something for Android Studio, and the next minute I was in Eclipse land.
The promises for the future and the hints for what's around the corner are sprinkled throughout the Web pages. They highlight the way that Gradle will grow more powerful and better integrated with the cloud. Google is already talking about adding more features to the Android publishing environment. You can, for instance, quickly translate your app using Google's cloud so that it's ready for foreign markets. Android Studio won't be a lone cowboy standing by itself on a desktop, but will have plenty of support from Google's cloud.
This is just one of the announcements showing how Google imagines that Android Studio will become less and less a simple IDE and more and more a portal into a cloud-based development ecosystem where beta testers will have easy access to the code and everybody is a bit freer to create. For now, it's still very much a rich, sophisticated IDE living mainly in the desktop, but one that's ready to change quickly.
This article, "First look: Android Studio eclipses Eclipse," was originally published at InfoWorld.com. Follow the latest developments in application development and mobile technology at InfoWorld.com. For the latest business technology news, follow InfoWorld.com on Twitter.
Read more about application development in InfoWorld's Application Development Channel.
This story, "First look: Android Studio eclipses Eclipse" was originally published by InfoWorld.
Apple's iPhone 8 will likely launch in September, despite other reports to the contrary.
Microsoft removes and depreciates features in its Windows 10 Creators Update that apply to commercial...
A review of 18 companies that offer free cloud storage
When the Internet Engineering Task Force meets this week in Chicago it will have a new chair – Cisco...
Developers require a powerful development environment, such as public cloud. They'll get what they need...
Catching an insider taking confidential information doesn't happen by chance, and policies and...
Old gear, bad locations and overcrowded volume top the poor choices that many companies make when it...