Android Studio 2.0 Released
android-developers.blogspot.com
android-developers.blogspot.com
What always mystifies me about Android development is that there's no equivalent of the iPhone simulator (not emulator) of iOS development. I mean, Google has a perfectly fast Android runtime that allows you to run apps directly on your desktop at native speeds. It's currently built into Chrome OS, is already cross platform [0], and while it obviously doesn't give you to access some phone hardware features, it should be perfectly adequate for 90% of development scenarios. Why doesn't Google leverage that for click-and-run Android development?
[0]: https://github.com/vladikoff/chromeos-apk/blob/master/archon...
The thing that makes the emulator really slow is when it has to emulate ARM instructions on an x86, but if you pick an x86 arch then you're basically just running a VM, which should be comparable in perf to the iOS simulator.
Again, just guessing here, please correct me if I'm wrong.
As the other reply points out, the iOS emulator also doesn't emulate a full system. It just runs the required iOS APIs directly on OS X, just to give you an idea of a running app and the progress you're making on a feature. Again, for most development scenarios that is really all you need (and you use an actual device for more thorough testing or when you need hardware features).
The perf difference isn't as major as between x86-on-x86 virtualization and arm-on-x86 full blown emulation, but the difference is still there.
ARM emulation is probably an order of magnitude slower
They're both still emulators. The difference is that when using x86 images, it now uses fast, hardware-accelerated virtualization under the right conditions (e.g. HAXM[1]) so it doesn't feel like there's a fat middle layer anymore.
Virtualization has come a long way in recent years, and the new emulator reflects that. Of course, there's still major hurdles when emulating different architectures, so ARM emulation is still a pain.
[1] https://software.intel.com/en-us/android/articles/intel-hard...
About time. I don't know of any other aspect of Android development that gets as much hate as emulator perf (and I include Eclipse loathing when I say that). Though I'll say on latest with a recent MBP and SSD, the stock emulator isn't nearly as bad as it once was.
I am disappointed with a continuing lack of a decent test tools story. Whether UI automation or unit tests, I continue to run into "you need foo to get this to work, but the app's dependency on bar means you'll never get the two live in harmony". Espresso continues to look promising, but ramp up is still steep.
Also it drags in 20k+ methods (whole guava!) which can cause severe problems since instrumentation APKs currently cannot be multidexed or proguarded with Gradle.
> Finally, the new emulator has rich new features to manage calls, battery, network, GPS, and more.
Interesting! I've long wanted more sensor/hardware feature availability in the emulator, so this is a good start.
I can't wait to try out the Cloud Test Lab integration. If it works well, that would be awesome (and futuristic). Still looking for official support for WiFi debugging.
Personally I loved Genymotion and used it for all my emulator testing (although the vast majority of my testing was done on a real device). But with Android 2+, it's the opposite: 99% of my testing is done on the default emulator (the rest is using a device). It's that good.
Don't know whether this problem has been addressed by this 2.0 release.
With that said, your mileage may vary: Android Studio is one of those applications that seem to misbehave under certain specific conditions. Namely, if your main OS drive is not a SSD, things seem to slow down to a crawl.
Now for some perspective, i know i have a rather biased view in this: i came to AS from eclipse when switching from backend to android (still do my backend stuff in eclipse), so i am not tainted by the supposedly terrible quality of eclipse-based android tooling that came before AS. Also, i am highly suspect of subconsciously blaming the IDE for certain annoyances that actually are just extra stuff that any tooling would have to do for android dev. I never used full IntelliJ, so i am only talking about AS in the strictest sense and do assume that regular IntelliJ can be closer to eclipse in terms of direct compiler integration and even build tool builds will not only be much more flexible than the gradle guiderails in AS but also less heavyweight (i guess i'm only talking about the gradle android plugin in this part).
Now as AS2 claims to turn things upside down, i'd be glad to forget all this.
Gradle is a horrible thing that lets people do whatever they want - and people who think freedom == productivity flock to it for that reason only. History of course teaches otherwise.
(I'm not a fan)
(Used it via nVidia CodeWorks for Android when doing a mostly C++ project which also had some Java in it for Android.)
2) You're replacing something that... mostly works out of the box, with something you have to configure entirely yourself.
3) Requires intimate knowledge of the entire Android build chain to properly set up. I might know about ~90% of it after some nasty debugging sessions involving flaky USB connections and commands which return 'successfull' exit codes / stdout spam when they fail - so we'll call the bus factor of that setup 0.9 as my coworkers frankly did not want to know, for which I don't even remotely blame them.
4) Yet another build dependency to install on every dev and build machine (make. *nix isn't an answer either: too many Windows specific toolchains for gamedev to make non-Windows remotely feasible as a primary dev environment.)
5) Not actually solving the remaining bottlenecks. Switching to Gradle got us down to ~5 seconds / build / project for the Java and APK packaging portion of the build, which looked mostly like it was dependency scanning, zipping, and code signing - just like I'd need my Makefile to be doing anyways. I was skeptical that I could do much better. Next, I switched linkers and saved closer to 90 seconds / build / project for even the simplest typo fix in the C++ side of things.
And that's just what's wrong with replacing gradle with a makefile. If we wanted to replace the entire build pipeline and build our C++ with makefiles too:
6) Would need to replace extensive existing MSBuild configurations entirely, or duplicate work between two different build setups. Would need to learn other platform build chains sufficiently as well (XB1, PS4, Win8 Apps... I don't recall seeing full docs on this when I still had access, although over the years I pieced together a distressingly large chunk of the pie. We'll optimistically call it 70% of the pie, for a bus factor of 0.7.)
8) Even with dependency files and substitution magic, make will rebuild more than VS with the right settings. I've also only ever done it with GCC - trying to figure out how to coax a proper dependency file out of MSVC's compiler doesn't sound fun. Mixing and matching compilers sounds like an even worse idea - a great way to introduce subtle rebuild bugs due to built-in #define differences. No, I'm not going to try and target XB1 with clang.
9) Poorer VS integration. Simple things like Ctrl+F7ing to compile / syntax check single files won't work without setting up your own keybindings to (ab)use e.g. "External Commands".
That might be most of what's wrong for my use cases.
We replaced ant with gradle when we switched to Android studio.
How to import a library with some resources with ant ? -copy paste it somewhere accessible in your project. It makes importing and more importantly updating the support lib (or most libs really) a pain in the ass.
How does it work with gradle ? compile "com.android.support:appcompat-v7:23.2"
Between this and flavors, I might not love gradle, but it is still a big step up from ant.
The instant run in AS2 helps a lot, but without it, build times are unbearable.
I have ArangoDB running in VirtualBox to provide backend data. If I try to run the emulator, I can't because VirtualBox and the emulator don't play well. The only think I've found to get the emulator to work is to use an ARM version of the emulator, which makes it hard to use.
An all VirtualBox setup works fine. I'm not sure how to make the emulator phone like rather than tablet. Other than that, I'm ok.
For the curious, Google has a system like Buck - Bazel[3]. From what I know it served as the inspiration for Buck, but I could be wrong.
[1] http://engineering.vine.co/post/117873038742/reducing-build-...
[2] https://buckbuild.com/article/exopackage.html
[3] http://bazel.io/
That is not the most recent release of IntelliJ so it's at least one version behind. I should also note that IntelliJ has abandoned the version number name, the newest versions of the IntelliJ IDEs have the year now. The most recent IntelliJ IDEA is IntelliJ IDEA 2016.
That such a widely use fork of IntelliJ is behind a version is important for plugin developers who will be held back from adopting new features if they want to support Android Studio.
I think IntelliJ 15 shipped with its own JRE so it may be possible to write plugins in Java 8 instead of Java 6 for Android Studio though, so if that's true that's nice.
If you're interested in keeping up-to-date, Android Studio also has Chrome-style Canary/Beta/Dev channels as well.
Because they make changes to the core. HN recently linked to a JetBrains thread where a blind user opened a usability bug regarding using screen readers in IntelliJ[1]: a significant portion of the code to address that came from a Google Engineer working on Android Studio and merged upstream into IntelliJ.
1. On mobile, can't get the link right now
Yes, of course you can build Android with standard IntelliJ, but for making Android development more accessible AS is a great direction. Trying to get the old Ant + Eclipse + random tools in the sdk work together was very challenging, and - at least thus far - AS has been tracking IntelliJ pretty closely so I don't feel out of place. Not to mention IntelliJ doesn't have to be tied to the (very large) community of Android developers; Jetbrains can continue building their product to be more of a neutral all-around (fantastic) development environment.
- Android Studio doesn't support ndk-build based projects
- Android Studio turns my core duo, with 8GB RAM, 512 GB HD into a propeller airplane and Gradle builds take minutes versus seconds in Visual Studio (Ant/ndk-build)
- VS2015 has direct support for mobile cross platform, so I can from the same IDE target Android and WP
- Intelisense is faster and more accurate on Visual Studio than Android Studio
- I am yet to test the debugging support, including visualizers in Android Studio, because I lost my patience to keep on waiting minutes even for "hello world" builds
- Visual Studio C++ team tries to improve the experience and actively asks for feedback, Android Studio team just ignores NDK users.
On Linux, IntelliJ 2016.1 is still shipping with its own JRE (I don't know if they used to do this before) and that is very important for this release since they modified it so that the fonts don't look like shit anymore.
I wonder, is there any reason to use Android Studio over IntelliJ for android development?
NDK development would be a good reason. IntelliJ doesn't have free C++ support/plugin, does it?
And not all features available in AS are available as IntelliJ plugins either.
I find Android development very tedious though (compared to web-dev) both with and without the IDE. Especially the xml-files and "enterprise" Java code.
It only uses Java 6 for the IDE, Gradle and the other Android tools should still run with your regular modern Java 8 if I'm not mistaken.
It's not ideal, but after comparing the two I found Java 6 + Quartz by far the best solution for now...
However, in sum, using a emulator is still a bad idea.
(Yes I know there are per app ways you can often archieve this if you tinker around enough, not the point)
(not hating, just curious)
In 90% of the cases it's much faster, maybe by cutting build+deploy time by 90%, just because you don't have to rerun the app.
In 5% of the cases it's a bit more involved but still faster.
In 5% of the cases it fails miserably and you spend 200% more time just stopping everything, doing a clean build, and deploying it again just to be sure.
Way to surprise me.
For some people it may make sense to use the Beta, Dev, or Canary versions instead. Those, of course, have much more frequent updates (some near daily).