Skip to main content

Android Studio 4.1 – New features for devs

Android development

Android Studio 4.1 made it onto the stable channel last month, bringing a number of useful new features for Android developers. There are some interesting inclusions this time around, so read on to see what you need to know!

Embedded emulator

One of the most interesting updates comes to the Android emulator, which is now built right into the IDE itself. In other words, the emulator no longer opens as a separate app but rather in a tool window. This is said to “save screen real-estate” for all us peasants working on sub 4K, 42” monitors.

See also: Android Studio tutorial for beginners

While this is mostly a cosmetic change, it does make the experience feel more cohesive and intuitive. It’s also easier to monitor code while the app is running. It is a great stride toward a more integrated and seamless experience.

The feature is not turned on by default, however. To access it, you first need to update your preferences by going to File > Settings > Tools > Emulator > Preferences. Select “Launch in a tool window.” It’s probably worth mentioning that this crashed for me more than once, however.

Launch in a Tool Window Android Studio Tutorial

Credit: Adam Sinicki / Android Authority

The emulator also now includes more support for foldable devices: now supporting numerous fold designs and even allowing you to test different hinge angles!

Database inspector

The new database inspector lets users inspect, query, and modify databases in an app while it runs. This is supported on devices running API level 26+.

To begin, run the app and then choose View > Tool Windows > Database Inspector. This works whether your app uses the Jetpack Room library or SQLite directly. You can even modify values using the Inspector while the app is running.

See also: How to use SQLite for Android app development

Dagger navigation support

Dagger is a library for dependency injection on Android. In Android Studio 4.1, it’s now easier to jump between Dagger code and your main project using gutter actions and the beefed-up Find Usages window.

Material design components

This is a useful update that should make it easier for developers to conform to the material design guidelines that Google provides.

Essentially, the default templates found when starting a new project will more closely resemble the recommended stylings from Google. Projects depend on com.google.android.material:material in the Gradle build file.

Layout File 1 1

Credit: Adam Sinicki / Android Authority

Other changes also make life slightly easier: color resources now use literal names, for example.

Most importantly, the style templates more closely match Google’s most recent Material Design “2” sensibilities rather than the old MD1 and AppCompat themes. The differences aren’t night and day, but seeing the very dated-looking “Next” button replaced is certainly nice.

Native memory profiler

The Native Memory Profiler is built into Android Studio 4.1’s Memory Profiler and allows users to track memory allocations and deallocations of objects. This gives developers access to the objects’ size and number to assist with debugging memory issues.

TensorFlow Lite models

TensorFlow Lite allows developers to integrate machine running algorithms on-device. Android Studio 4.1 makes it easier to import these models directly. Android Studio will generate classes that can run the model with less code and better type safety.

Pre-trained models with metadata are available on the TensorFlow Hub and you can also add your own TensorFlow Lite models.

To get started, download the .tflite model file from the model details page. Choose a model with metadata. Then open the TnesorFlow Lite model import dialogue in Android Studio. To do this, navigate to File > New > Other > TensorFlow Lite Model.

Now choose the .tflite model file and click finish. The model will be imported and placed inside the ml/ folder of your project. Clicking on this file will open a model viewer to reveal further detail about the model.

There are more new updates and features to help improve workflow, especially . Check out the official blog post from Google for the full details.



source https://www.androidauthority.com/android-studio-4-1-1177491/

Comments

Popular posts from this blog

5 tips to Voice Speech Recognition in Android Marshmallow

Android Marshmallow landed on our Android devices. The opportunity for us to offer a small compilation of tricks to try immediately. The latest version of the Google OS starts (very gently, unhurriedly) to be offered on other devices as Nexus. You will find on Android TM, in the coming weeks, a compilation of the best tips for Android 6.0 Marshmallow. It starts slowly with a video featuring the 10 essential tips & tricks of this new version of the little green robot OS. To continue, we offer a selection of five "tricks" on the management of the battery on Android 6.0 Marshmallow. To enjoy longer your newly updated mobile. Follow the guide. then continue with 5 tips to tame the super-assistant Google Now on Tap. Here you will find 5 "tips" to manage in the best way your applications. We then discuss the quick tips to navigate more easily on this version of the Google OS. We enchanters with features focused on safety and the protection of personal data. We co...

Energy Android TV Play turns your TV into a Smart TV

ENERGY SISTEM Android Energy TV Play, you have a smart TV with Android operating system allows you to convert any traditional TV has announced the launch of a new product. Energy Android TV Play can be connected to the TV to enjoy f the size of a flash drive, a smart phone, a tablet and a computer unconsolidated is a lightweight device. System 1.6 GHz, DDR3 1GB of RAM and a dual-core processor can be expanded using external USB devices, which is the internal memory of 8 GB. It also integrates WiFi and a USB port for connecting external devices. One of its outstanding features, it is easily connected to the TV screen by screen cast application to display the contents of any terminal, making any phone or tablet is synchronized with iOS or Android. All ENERGY SISTEM products one click In addition, through streaming media service applications, images, video or other multimedia content, and game play is the ability to share. With integrated WiFi, the device you want from t...

How to run Python apps on any platform

Credit: Adam Sinicki / Android Authority Want to know how to run Python? It sounds simple, but it can actually be tricky to figure this out. In this post, we’ll discuss how to test your Python code, as well as how to run Python in other contexts: online for example, or as a packaged app. Sometimes, the thing holding you back from learning to code can be extremely simple. I remember wanting to learn to program when I was younger – or learning to take what I’d learned from BASIC on the ZX Spectrum and apply that to a modern environment. My problem? I didn’t know “where” to program. Once I understood C# or Java, where would I enter the code and how would I run it? And whenever I asked someone, they would look at me blankly. What kind of a question is that? Thing is, I had never needed an IDE or an interpreter before. Machines like the ZX Spectrum and Tatung Einstein (any other Einstein users out there?) simply booted up with a prompt to code into! Many people have a similar iss...