What’s new in Android studio 2.3

TapanHP
reverseBits
Published in
5 min readMar 3, 2017

Yet another stable release of android studio.

WebP image support

Android Studio can now convert PNG, BMP, JPG, and static GIF files to WebP format, WebP is an image file format from Google that provides lossy compression (like JPEG) as well as transparency (like PNG) but can provide better compression than either JPEG or PNG. For more information.
See how you can convert and create WebP images here

Also see support for WebP images in android studio, what you can do and how 2.3 release supports it here

Lint baseline support

That allows you to use a snapshot of your project’s current set of warnings as a baseline for future inspection runs so only new issues are reported. The baseline snapshot lets you start using lint to fail the build for new issues without having to go back and address all existing issues first. see here

New lint checks, including the following:

  • Obsolete SDK_INT Checks: Android Studio removes obsolete code that checks for SDK versions.
  • Object Animator Validation: Lint analyzes your code to make sure that your ObjectAnimator calls reference valid methods with the right signatures and checks that those methods are annotated with @Keep to prevent ProGuard from renaming or removing them during release builds.
  • Unnecessary Item Decorator Copy: Older versions of the RecyclerView library did not include a divider decorator class, but one was provided as a sample in the support demos. Recent versions of the library have a divider decorator class. Lint looks for the old sample and suggests replacing it with the new one.
  • WifiManager Leak: Prior to Android 7.0 (API level 24), initializing the WifiManager with Context.getSystemService() can cause a memory leak if the context is not the application context. Lint looks for these initializations, and if it cannot determine that the context is the application context, it suggests you use Context.getApplicationContext() to get the proper context for the initialization.
  • Improved Resource Prefix: The existing resourcePrefix lint check had many limitations. You can now configure your project with a prefix, such as android { resourcePrefix 'my_lib' }, and lint makes sure that all of your resources are using this prefix. You can use variations of the name for styles and themes. For example for the my_lib prefix, you can have themes named MyLibTheme, myLibAttr, my_lib_layout, and so on.
  • Switch to WebP: This check identifies images in your project that can be converted to WebP format based on your project’s minSdkVersionsetting. An associated quickfix can automatically convert the images, or you can convert images to WebP manually.
  • Unsafe WebP: If your project already includes WebP images, this check analyzes your project to ensure that your minSdkVersion setting is high enough to support the included images. For more information about WebP support in Android and Android Studio, see Which browsers natively support WebP?

New annotations

The new @RestrictTo annotation for methods, classes, and packages lets you restrict an API.
The updated@VisibleForTesting annotation now has an optional otherwise argument that lets you designate what the visibility of a method should be if not for the need to make it visible for testing. Lint uses the otherwise option to enforce the intended visibility of the method

Learn how to use support annotations here

Material icon by categories

importing vector asset in android studio

When adding a material icon using the Vector Import Dialog (File > New > Vector Asset), you can now filter the list of available icons by category or by icon name. see below how you can play with material icon

Favorite properties in Layout Editor

The Layout Editor also now lets you create a list of favorite attributes so you don’t have to click View all attributes to access the attributes you use most.

To add properties, click View All Properties and then click the star that appears when you hover your mouse over the left side of a property name.

At bottom now you should able to see your favorite properties.

Added Constraint Layout features:

The Layout Editor now includes support for two new ConstraintLayout features:

  • Define a view size based on an aspect ratio.
  • Create packed, spread, and weighted linear groups with constraint chains.

App Links Assistant

What are app links?

Android App Links to your app into a step-by-step wizard. Android App Links are HTTP URLs that bring users directly to specific content in your Android app. Tools > App Links Assistant.

How to use app links in your app?

CHANGES AND FIXES

A separate button to push changes with Instant Run: After deploying your app, you now click Apply Changes

to quickly push incremental changes to your running app using Instant Run. The Run

and Debug

buttons are always available to you when you want to reliably push your changes and force an app restart.

The AVD Manager and SDK Manager buttons are now included in the lean Navigation Bar as well as the full Toolbar. To use the lean Navigation Bar, click View to open the View menu, then ensure that Navigation Bar is selected and Toolbar is not selected.

The GPU Debugger has been removed from Android Studio as of version 2.3. An open-source, standalone version of the tool will be made available soon on GitHub

All templates now use ConstraintLayout as the default layout.

Android tool time video from android developers featuring Android studio 2.3

--

--