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

LIVE Day Trading Morning Show for Tuesday!

LIVE Day Trading Morning Show for Tuesday! via YouTube https://www.youtube.com/watch?v=vgagRBXRJM0 Android Tips and Tricks working hard to get the latest and useful tips and techniques that help you to solve a problem or improve your productivity.

How to unhide or show folders in mx player list

In this blog post, I tell you about how to Show or Hide folders from MX player list. There are two methods to Show folder from MX Player list. Method 1: Unhide / show folders If you want to temporarily Show / Unhide hidden folder from MX Player list, then go to Settings and untick Recognize .nomedia ".  Method 2: Permanently unhide / show folder: Open memory by any file explorer and I recommend X-Plore, and open the folder that is Hidden and find the file " .nomedia ". If you didn't find it, you should first enable "Show files hidden files that starts with .(dot)". Delete the file and you just need to refresh MX Player list to take changes. Note: MX Player always hide those folders which file " .nomedia " exists.

How to use AWS – a simple guide for beginners

Amazon Web Services (AWS) is Amazon’s powerful, market-leading solution for cloud computing. The platform offers a suite of products for businesses: security, cloud backup, machine learning, IoT solutions, and more. In this post, we will explore how to use AWS. What you need to know Many entrepreneurs and small businesses may assume that AWS is not for them. Perhaps the pricing will be too prohibitive, or it will require too much technical know-how. While both of these issues certainly do crop up from time-to-time, the truth is that Amazon’s offerings are extremely wide-reaching and include options at many different price points and levels of complexity. That is to say, that while some products might be off-limits, others are not. Some AWS products are completely free and very simple to get to grips with! See also: AWS vs Azure vs Google Cloud – Which certification is best for professionals? AWS includes over 175 different products, some of which don’t even require an AWS accou...