World-class code editing, debugging, performance tooling, a flexible build system, and an instant build/deploy system all allow you to focus on building unique and high quality apps.
Push code and resource changes to your app running on a device or emulator and see the changes instantly come to life. Instant Run dramatically speeds up your edit, build, and run cycles, keeping you “in the flow.”
Intelligent code editor
Write better code, work faster, and be more productive with an intelligent code editor that helps you each step of the way. Android Studio is built on IntelliJ and is capable of advanced code completion, refactoring, and code analysis.
Fast and feature-rich emulator
Install and run your apps faster than with a physical device and test your app on virtually any Android device configuration: Android phones, Android tablets, Android Wear, and Android TV devices. The new Android Emulator 2.0 is faster than ever and allows you to dynamically resize the emulator and access a suite of sensor controls.
Robust and flexible build system
Easily configure your project to include code libraries and generate multiple build variants from a single project. With Gradle, Android Studio offers high-performance build automation, robust dependency management, and customizable build configurations.
This update to Android Studio 3.1 includes fixes for the following bugs:
- In some cases, Android Studio hung indefinitely during exit.
- Builds configured with source sets failed with the following message when Instant Run was enabled: “The SourceSet name is not recognized by the Android Gradle Plugin.”
- When Instant Run was enabled, builds of new Kotlin projects failed when triggered by the Run command.
- During editing of the build.gradle file, there was sometimes a noticeable delay between typing a character and the character appearing on the screen.
- Build failures occurred during dexing in some projects with large numbers of modules or external dependencies, with the following error message: “RejectedExecutionException: Thread limit exceeded replacing blocked worker”
- The computation of the D8 main DEX list was not taking into account some reflective invocations.
This update also includes changes that make running lint checks from Gradle much faster in some scenarios.
What’s new in Android Studio 3.1.0:
Android Studio 3.1.0 is a major release that includes a variety of new features and improvements.
- The core Android Studio IDE has been updated with improvements from IntelliJ IDEA through the 2017.3.3 release. Improvements include better control flow analysis for collections and strings, improved nullability inference, new quick fixes, and much more.
- For details, see the JetBrains release notes for IntelliJ IDEA versions 2017.2 and 2017.3, as well as the JetBrains release notes for bug-fix updates.
SQL editing improvements with Room
- When you use the Room database library, you can take advantage of several improvements to SQL editing:
- Code completion within a Query understands SQL tables (entities), columns, query parameters, aliases, joins, subqueries, and WITH clauses.
- SQL syntax highlighting now works.
- You can right-click a table name in SQL and rename it, which also rewrites the corresponding Java or Kotlin code (including, for example, the return type of the query). Renaming works in the other direction, too, so renaming a Java class or field rewrites the corresponding SQL code.
- SQL usages are shown when using Find usages (right-click and choose Find usages from the context menu).
- To navigate to an SQL entity’s declaration in Java or Kotlin code, you can hold Control (Command on Mac) while clicking the entity.
- For information on using SQL with Room, see Save data in a local database using Room.
Updates to data binding
- This update includes several improvements for data binding:
- You can now use a LiveData object as an observable field in data binding expressions. The ViewDataBinding class now includes a new setLifecycle() method that you use to observe LiveData objects.
- The ObervableField class can now accept other Observable objects in its constructor.
- You can preview a new incremental compiler for your data binding classes. For details of this new compiler and instructions for enabling it, see Data Binding Compiler V2.
- Benefits of the new compiler include the following:
- ViewBinding classes are generated by the Android Plugin for Gradle before the Java compiler.
- Libraries keep their generated binding classes when the app is compiled, rather than being regenerated each time. This can greatly improve performance for multi-module projects.
Compiler and Gradle
- The D8 compiler is now used by default for generating DEX bytecode.
- This new DEX compiler brings with it several benefits, including the following:
- Faster dexing
- Lower memory usage
- Improved code generation (better register allocation, smarter string tables)
- Better debugging experience when stepping through code
- You don’t need to make any changes to your code or your development workflow to get these benefits, unless you had previously manually disabled the D8 compiler. If you set android.enableD8 to false in your gradle.properties, either delete that flag or set it to true:
- For details, see New DEX compiler.