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

4 Surprising Ways Artificial Intelligence will Empower Consumers

Ever wonder what makes Siri search the items inside the iPhone and on the web by recognizing your voice? How does Google listening work? Artificial Intelligence and data science have already infused in this consumer-oriented generation, but we have not realized it yet. It has been quite a while that natural language processing, speech recognition, and gesture recognition system took over the market with their all new features, but what are the new things in AI that are yet to come? Few amazing transformations are: Retailing sector to become AI-ready Voice Recognition will change the game Search engines to become smarter Machine learning to bring revolutionary changes Recently we got to learn about a verbal spat between Elon Musk and Mark Zuckerberg over the probable risk and opportunities brought by AI . Believe it or not, but we already accustomed to Artificial Intelligence and probably waiting to witness jaw-dropping inventions. Some of AI inventions we have known till yet are: Mach

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 arrays in Python

Arrays in Python give you a huge amount of flexibility for storing, organizing, and accessing data. This is crucial, not least because of Python’s popularity for use in data science. But what precisely is an array? And how do you use arrays in Python? Also read: How to use dictionaries in Python Read on, and we’ll shed some light on the matter. What is an array? An array is a way to store multiple values in a single variable. That means that you can use a single “reference” in order to access your data. A list is also an example of a variable that stores multiple values, but has some slight differences. When using lists in Python, you store a series of values each with a numbered index. For example, this is how you would create a list of fruits in Python: fruits = [“apple”, “orange”, “pear”, “nectarine”] If we then say: print(fruits[3]) We will see “nectarine” appear on the screen (the first entry is stored as “0”). Also read: How to use lists in Python This is not an