YACINE REZGUI: Android Studio version 3.6 is now
available for download on the stable channel.
This new version of Android Studio
continues to bring bug fixes, build speed improvements,
and add new features--
a split code/design editor view, ViewBinding, Apply Changes
improvements, NDK update, an upgrade to the emulator
location component, and enhancement
to the Android Studio UI.
Android Gradle plugin version 3.6 includes support
for the Maven Publish Gradle plugin, which
allows you to publish build artifacts to an Apache Maven
repository.
The Android Gradle plugin creates a component for each
build variant artifact in your app or library module
that you can use to customize a publication to a Maven
repository.
When using Android Gradle plugin version 3.6 higher
to build a debug version of your app,
the plugin uses a new packaging tool called
Zipflinger to build your APK.
This new tool should provide build speed improvements.
However, if you experience issues, please report a bug.
You can also revert to using the old packaging
tool by including the following code in your Gradle property
file.
You can update Android Studio independently
from the Android Gradle plugin, but we highly
recommend you to update them both.
Android Studio now allows you to resume SDK components and tools
download using the SDK manager that were interrupted--
for example due to a network issue--
instead of restarting the whole download from the beginning.
This enhancement is especially helpful for large download
such as the Android Emulator or system images
when internet connectivity is unreliable.
In addition, if you have an SDK download task running
in the background, you can now pause or resume the download
using the controls in the status bar.
When using Android Studio without an internet connection,
you may want to enable Gradle's offline mode.
To do so, first select View, Tool, Windows, and Gradle
from the menu bar.
Then, near the top of the Gradle window,
click on the Toggle Offline Mode button.
Design editors such as the Layout Editor and Navigation
Editor now provide a split view that you
can enable to see both the design and code
views of the UI at the same time by clicking on the Split icon.
We know that editing multiple resource files in parallel
is a common scenario for developers.
Every file has different needs.
So you might want to edit one file on Design mode,
another in Split mode, and yet another in Code mode.
The editor will now preserve the editor state of each file
so you can switch between files without worrying
about losing the previous state, as well as the design state,
such as zoom level and selection.
If you are looking for a time and null safe solution
to find ViewBinding in your code,
but you don't want to go all into data binding,
we now have a lighter and faster alternative.
ViewBinding provide a compile-time safety
when referencing views in your code.
You can now replace find ViewBinding
with the auto-generated binding class reference.
To start using ViewBinding, include the following code
in each module's build.gradle file.
Being conscious of memory usage is
a priority for any developer.
Due to a popular request from developers,
the leak detection feature is now back
in the memory profiler.
When analyzing a heap dump in the memory profiler,
you can now feature profiling data
that Android Studio thinks might indicate memory
leaks for activity and fragment instances in your application.
It's able to flag activity and fragment instances that
have been destroyed or don't have a valid fragment measure,
but are still being referenced.
To use this feature, first capture heap
dump or import to heap dump file in Android Studio.
Then, to display the fragments and activities that
may be leaking memory, select the Activity Fragment Leaks
checkbox in the Heap Dump pane of the Memory Profiler.
When inspecting DEX files, the APK analyzer
now supports the obfuscating class and method bytecode.
You will need to load the ProGuard mapping
files of the APK that you are analyzing in the DEX file
viewer.
On Android Studio 3.5, we introduced implied changes,
which lets you push code and resource
changes to your running app without restarting it
by redefining classes on the fly.
With Android Studio 3.6, you can now add a class,
and then deploy that code with apply changes
without having to restart your whole application.
If you haven't given a try with Apply Changes yet,
let me show you how to use it.
First, you need to run your application
on the emulator or device.
Once you have modified code in the body of a method,
but you haven't modified any resources,
Apply Code Changes is your best option,
as it doesn't restart your activity.
If you have updated a resource, the Apply Changes and Restart
Activity option will attempt to apply both your resources
and code changes by restarting your activity,
but without restarting your application.
In some cases, Apply Changes will not be able to work,
like when you're deleting a class, a method,
or changing the method signature.
If you hit one of these cases, Android Studio
will prompt you to install and run your application again.
However, if you don't want to be prompted every time this
occurs, you can now configure Android Studio
to automatically rerun your application
when changes can't be applied.
To do so, open the Android Studio settings,
navigate to the Deployment menu, and select the checkboxes
to enable automatic run fallback for either of the Apply Changes
options.
When profiling or debugging an external APK,
you no longer have to recreate the project when the APK is
updated outside of the ID.
Android Studio detects changes in the APK,
and gives you the option to reimport it.
NDK also got updates.
It has a better support of Kotlin for several features
previously supported in Java only.
You can navigate from a JNI declaration
to the corresponding implementation function in C
or C++.
It will automatically create a stop implementation function
for JNI declaration.
Unused native implementation functions
are highlighted as a warning in the source code.
JNI declaration with missing implementations
are also highlighted as an error.
Signature will be checked for implicitly-bound JNI
implementation.
And when you're refactoring native implementation function
or corresponding JNI declaration are updated,
rename JNI declaration to update the native implementation
function.
The JNI got other improvements.
It can now get type hints for parameter,
and return values are shown in JNI implementation functions.
JNI-mangled function names can now be folded.
The emulator brings in new features called Google Maps UI.
This is meant for app developers who develop apps that
interface with device location.
Google Maps UI makes it easier to specify location,
and also to construct routes from pairs of location
by leveraging the Google Maps API.
You can define single location in the Single Points tab
by searching points of interest, just
as you would when using Google Maps on a phone or browser.
When you search for a place or click on location on the map,
you can save it by selecting Save Point
near the bottom of the map.
All of your saved locations are listed
on the right side of the Extended Controls window.
Similar to the Single Points tab,
the Routes tab provides a Google Maps
view that you can use to create a route between two
or more locations.
You can save routes, play their simulation
inside the emulator, set its speed,
as well as repeating the playback.
After December 2019, the Windows 32-byte version
of Android studio will no longer receive updates,
and it will no longer receive support after Dec 2020.
To be able to receive additional updates,
upgrade your workstation to a 64-bit version of Windows.
Enjoy Android Studio 3.6, and remember
that we're listening to your feedback on our Bug Tracker.
Check out early builds of Android Studio
4.0 on the Canary channel.
Don't forget to subscribe to our channel
to get notified, and share the video with your friends
and colleagues.
See you soon.
[THEME MUSIC]