
Android Studio 2.0 Released - ingve
http://android-developers.blogspot.com/2016/04/android-studio-2-0.html
======
DCKing
It's great that they improved Android emulator performance. Major frustration
when developing Android apps is all the time spent waiting for the emulator or
device deployment.

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...](https://github.com/vladikoff/chromeos-
apk/blob/master/archon.md)

~~~
gregschlom
I may be totally wrong on this but I was under the impression that since
Google started publishing x86 builds of Android the "emulator" is now much
more like a simulator (unless you choose to run the ARM version, of course).

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.

~~~
umanwizard
The iOS simulator isn't an emulator, though. It's running the apps as regular,
native process on the OS X host. There's no VM.

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.

~~~
rubber_duck
Is virtualization cost that bad ? If the GPU drivers are good it should not be
over 2-3x - which - when considering you are emulating mobile phone on a at
least 2-3x more powerful hardware - should be perfectly acceptable.

ARM emulation is probably an order of magnitude slower

------
mikestew
_The new emulator runs ~3x faster than Android’s previous emulator, and with
ADB enhancements you can now push apps and data 10x faster to the emulator
than to a physical device._

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.

~~~
MrBra
Does anyone know how that compares to the Xamarin Player?
[https://www.xamarin.com/android-player](https://www.xamarin.com/android-
player)

~~~
shrewduser
use the visual studio one (doesn't need visual studio running to be used) or
genymotion.

~~~
MrBra
What? Visual Studio uses the emulator from the Android SDK, so I don't
understand what you mean by use the Visual Studio one?

------
cryptoz
This is really exciting!

> 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.

~~~
asimuvPR
Would this mean that I no longer need to run Genymotion?

~~~
whatever_dude
With the right architecture (x86, fast virtualization options on, Intel tools
installed) GenyMotion is not faster than the current Android emulator so
there's no advantage there. On top of that, with the 2.0 emulator, deploy
speeds are much faster.

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.

~~~
nimrody
With Genymotion you can run multiple emulators on a single machine. The Intel
tools you mention (Intel HAXM for fast virtualisation) seems to work only for
a single instance. The second instance does not benefit from fast
virtualisation and is painfully slow.

Don't know whether this problem has been addressed by this 2.0 release.

~~~
whatever_dude
A valid point. Haven't used it for bulk (automated?) testing, as I personally
never find myself running more than once instance at a time while debugging.

------
chinhodado
Everytime I tried to switch to Android Studio from Eclipse I switched back
because of how incredibly slow AS's build time is. Eclipse builds and deploys
my app in seconds, AS takes at least half a minute. I tried all the tricks I
can find on SO, etc. without success.

~~~
whatever_dude
I find AS to be much faster, more solid and stable than Eclipse in every
aspect. I've been using AS for a couple of years, and was on Eclipse for about
4 years before that.

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.

~~~
usrusr
Eclipse defaults to keeping all your tabs open, while AS defaults to
aggressive LRU pruning? Eclipse always working hard to keep a live updated and
as complete as possible bytecode model of your latest ctrl+s version available
for instant (or close to instant) whole workspace error reporting, where AS
only uses the compiler as a better linter, deferring non-local effects of code
changes to the next gradle run, where errors are not even clickable in the
console? The output of the IDE-internal "lint"-compiler run not even being
available for a simple, local unit test rerun? Compared to the ambitious,
smalltalk-derived vision of eclipse, AS sometimes feels like a glorified text
editor that is only faster because it does not even try to do things eclipse
does without much of a sweat.

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.

------
virmundi
How does this compare to running Android in VirtualBox via osboxes.com? I
pretty much have to do this in order to make my setup work (unless I want to
use my phone for testing).

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.

------
swsieber
I've seen some venting in the comments here about Gradle and general build
times. So I thought I would mention Buck[0] as an alternative build system.
Vine as a great article up about how they sped up their build when switching
from Gradle to Buck[1] - a large part of that was due to Buck's exopackage[2]
feature.

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.

[0] [https://buckbuild.com/](https://buckbuild.com/)

[1] [http://engineering.vine.co/post/117873038742/reducing-
build-...](http://engineering.vine.co/post/117873038742/reducing-build-times-
by-adopting-buck)

[2]
[https://buckbuild.com/article/exopackage.html](https://buckbuild.com/article/exopackage.html)

[3] [http://bazel.io/](http://bazel.io/)

~~~
on_and_off
As I understand it, some xooglers missed blaze/bazel so much that they built
copies in their new companies -> bucks & pants.

------
namelezz
How fast is the new emulator compared to Genymotion[1]? Is intel HAXM still
required?

[1] [https://www.genymotion.com/](https://www.genymotion.com/)

~~~
kryps
Not sure about the speed compared to Genymotion. HAXM is still required but
less buggy now.

------
levemi
> IntelliJ 15

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.

~~~
chickenbane
IntelliJ 15 was released in Nov, so we're talking 6 months. What features of
IDEA 2016.1 do you need for creating an Android application that aren't
present in AS 2.0? I use both frequently and it's hard for me to feel behind
(so far).

If you're interested in keeping up-to-date, Android Studio also has Chrome-
style Canary/Beta/Dev channels as well.

~~~
levemi
I don't have a feature that immediately comes to mind but I've run into it
before when developing a plugin for intellij. It's just something to keep in
mind. I don't understand why there's a separate IDE at all, why don't they
just make Android Studio and IntelliJ plugin and leave it at that. Then there
would be no issue. You can do so much with a plugin. There's really not much
you can't change in the UI with a plugin.

~~~
sangnoir
> why don't they just make Android Studio and IntelliJ plugin and leave it at
> that

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

~~~
genieyclo
Do you mean this?
[https://code.google.com/p/android/issues/detail?id=82716](https://code.google.com/p/android/issues/detail?id=82716)

------
z3t4
For those getting lost in the IDE I recommend trying command line. Here's a
good tutorial:
[http://geosoft.no/development/android.html](http://geosoft.no/development/android.html)
(you'll have to change some file paths due to SDK path changes though, just
search for the executable)

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.

~~~
brad0
This is really outdated IMO. Why not just build using latest and greatest with
gradle?

~~~
z3t4
I use a bash script.

~~~
adevine
Using gradle, especially with how it integrates with Android Studio, is a much
better solution. Google really got it right with gradle IMO, in that building
from the IDE builds EXACTLY the same as if it were built from the command line
with gradle. Building manually with bash like this just seems masochistic.

------
orbitingpluto
What's with the handholding when downloading? I'm trying to download the Linux
version on a Windows machine and it keeps trying to force the Windows version
down my throat... spoofing my user-agent fixed it.

~~~
vetinari
Just scroll down:

[http://developer.android.com/sdk/index.html#downloads](http://developer.android.com/sdk/index.html#downloads)

~~~
orbitingpluto
Oh sure I could do that. I could also fix the vacuum by plugging it in.
(Dammit. I was not on a FHD screen and that isn't the first time I've made an
above the fold mistake like that.)

------
johndoe90
AFAIK they used modified version of QEMU to run Android. Will the speed
enhance take any effect on the base QEMU? Or there were just OS optimizations?

------
therealmarv
OS X: just wanted to start my 3 weeks old Android Studio to update and
realized it wants Java 6 from Apple. Is this normal? I have Java 8 installed
here.

~~~
Ambroos
Apple's Java 6 uses Quartz for text rendering, which looks really good and is
pretty fast. Oracle's Java 7/8 do text rendering in software, which is slow
and looks extremely bad on OS X compared to, well, everything else.

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...

~~~
biafra
Did you try the openjdk that is bundled with intellij idea eap builds? It is
Java 1.8 with quartz font rendering. I use this version since December last
year to run AS without any problems.

------
jorgec
I am been using the 2.1 canary (beta) version for a long while that i didn't
noticed about the new version.

However, in sum, using a emulator is still a bad idea.

------
fulafel
How feasible would it be to run your own virtual Android device on a VM and
access it remotely like VNC or rdesktop? This could be nice for running
clients like WhatsApp or Snapchat and accessing them from a real computer with
less privacy worries to boot.

(Yes I know there are per app ways you can often archieve this if you tinker
around enough, not the point)

------
iLoch
Glad to hear emulator performance has improved so drastically. Did the Android
team take the time to tackle the, what, 5 year old bug that prevents retina
computers from seeing the screen clearly yet? Kinda of a huge pain in the ass
and makes me groan whenever I have to start the emulator and test my Android
apps.

~~~
iLoch
Update: Yes they did! Wow, what an improvement!

------
w8rbt
We've used the beta releases for a few small class projects already with good
results. No major issues.

------
esilverberg2
I was very excited for the improved emulator, but I also run Docker to
simulate my app server, and the Android emulator does not run simultaneously
with VirtualBox. Sticking to GenyMotion I guess...

------
vdfs
Does this support 32 bit linux?

~~~
Normal_gaussian
Why do you want 32bit linux support?

(not hating, just curious)

~~~
vdfs
I'm using ubuntu LTS, 32 bit is working good for me, only google chrome and
newest Android SDK is missing. I will switch to 64 bit when the next LTS is
released.

~~~
jat850
Sorry, just curious - doesn't 14.04 LTS have a 64-bit version? I think I ran
it for a while (I don't always stick to LTS though).

~~~
rhodysurf
Yes of course

------
awinter-py
any word on how 'warm swapping' compares to buck build?

~~~
whatever_dude
Not sure if there's any good 'official' link, but: it depends on what you need
to replace (adding methods? changing methods? changing resources?).

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.

------
rewqfdsa
.

~~~
vanderZwan
Did you actually mean Windows Millennium Edition, or was that a typo?

------
lostgame
Man, I just grabbed Studio today to install on my new MBP, and I was baffled
to see it had completely changed from the version I had installed on my old
one like...two days before?

Way to surprise me.

~~~
whatever_dude
The "stable" versions take a while to be released. The previous stable, 1.5,
was released in November 2015. The new one, 2.0, was released today.

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).

------
dmritard96
Did you see the compile to iOS plugin, thats so cool! OK just kidding. But
seriously waiting for it.

