BT

New Early adopter or innovator? InfoQ has been working on some new features for you. Learn more

New in Android Studio 2.0: Instant Run and Cloud Test Lab

| by Abel Avram Follow 4 Followers on Apr 08, 2016. Estimated reading time: 2 minutes |

Android Studio 2.0 comes with several new features and improvements: Instant Run, integration with a Google service for testing on real devices, faster emulator, faster builds, GPU profiler and debugger, support for deep linking and others.

Being built on the latest IntelliJ IDEA 2016.1, Android Studio 2.0 has been recently made available to developers. We detailed some of the new features in Android Studio 2.0 when it hit the canary channel almost 6 months ago, so we won’t repeat that post here, focusing now on what is new or improved.

Android Studio 2.0 uses the latest stable Android platform and APIs, but it does not include support for Android N Developer Preview, which requires Studio 2.1 Preview. Installing the tools for Android N development require some manual work and details can be found on Set up the Preview page.

One of the interesting features in Android Studio 2.0 is Instant Run. After the first deployment of an application either on a real device or an emulator, Instant Run pushes most code or resource changes without building a new APK. Android Studio does that using one of the three types code swapping:

  • Hot Swap – this is the fastest approach without reinitializing objects in the running application. In some cases, the activity affected is automatically restarted. Hot swap is used when the content of an existing method changes.
  • Warm Swap – This requires the restart of the current activity and an image flicker may be noticed. The application is not restarted. Used when a resource changes or it is removed.
  • Cold Swap – Requires application restart. A new APK is still not created. Used for a longer list of edits including adding/removing/changing of annotations, instance fields, static fields, signature of static methods, parent class, the list of implemented interfaces, and others.

A new APK is built and deployed when editing the manifest. Instant Run is not available when deploying simultaneously to multiple devices because it uses different techniques for swapping on various API levels.

Another new feature in Android Studio 2.0 is integration with Cloud Test Lab Beta, a Google service providing the possibility of testing an Android application on real devices running in Google’s datacenters. Developers can write their own tests using Espresso, UI Automator 2.0, or Robotium. If no test is created, Google will still run Robo Test, a set of basic tests that attempt to see if the application crashes. Robo Test simulates user activity, going through the interface and performing various tasks. A video of the automated simulation is recorded. Also, tests can be instrumented to take screenshots at various moments during testing. The resulting logs, videos or screenshots are made available through the Developer Console. At this point the Cloud Test Lab service is provided at no charge. The wording on their pricing page suggests that Google will charge for it in the future.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT