NEWS

Google Android Studio 4.1 official version released: directly run the Android emulator



Naija Tech News (NTN) on 22, and in content, Google Android Studio 4.1 official version released: directly run the Android emulator, Android, Android Emulator, Android Studio 4.1, emulator, Google, Studio 4.1 .

Google officially stated that it has recently released the stable version of Android Studio 4.1, bringing you a series of functions for common editing, debugging and optimization tasks. One of the key appeals of version 4.1 is to help you follow best practices and improve code writing efficiency when using the Android Jetpack library (ie, Android’s development library suite). Based on your feedback, many commonly used Android libraries are directly integrated into the IDE, thereby improving the experience of writing code .

Android Studio 4.1https://developer.android.google.cn/studio

Android Jetpack: https://developer.android.google.cn/jetpack

Naijatechnews.com understands that some of the highlights of Android Studio 4.1 are as follows: the introduction of a new Database Inspector for querying the application’s database; support for browsing projects that use Dagger or Hilt for dependency injection; support for using TensorFlow Lite models in Android projects, Further enhanced support for machine learning on the device side. We also updated Apply Changes to speed up deployment. We have made some changes based on your feedback and introduced a new native memory performance analyzer and independent analysis tools to help game developers.

Hilt: https://developer.android.google.cn/training/dependency-injection/hilt-android

Download Android Studio 4.1: https://developer.android.google.cn/studio

All the new features in Android Studio 4.1 are listed below according to the key development process.

design

Material Design component update

Now, the Android Studio template in the New Project dialog box uses the Material Design component (MDC), and supports the latest version of the theme and style design guidelines by default. In this way, developers can more easily use the recommended Material style mode and support modern interface features (such as dark themes).

Google Android Studio 4.1 official version released: directly run the Android emulator

△ The Material Design component updates in the project template include:

  • MDC: The project uses com.google.android.material:material in build.gradle. The basic application theme uses the Theme.MaterialComponents.* parent and overrides the updated MDC color and “on” attribute.
  • Color resources: Use literal names for color resources in colors.xml (for example, use purple_500 instead of colorPrimary).
  • Theme resources: The theme resources are located in themes.xml (not styles.xml) and use the name Theme.<ApplicationName>.
  • Dark theme: The basic application theme uses DayNight parent and is divided into res/values ​​and res/values-night.
  • Theme attributes: In layouts and styles, color resources are called theme attributes (for example, ?attr/colorPrimary) to avoid hard-coding colors.

Development

Database Inspector

We hope to use the new Database Inspector to simplify the inspection, query and modification operations of the application database. First, deploy your application to a device running API 26 or higher, and then select View> Tool Windows> Database Inspector from the menu. Whether your application directly uses the Jetpack Room development library or the Android platform version of SQLite, you can now easily check the database and tables in the running application, or run custom queries.

Since Android Studio maintains a real-time connection when you inspect the application, you can also use the Database Inspector to modify the values ​​and view the results in the running application. If you use the Room persistent library, Android Studio will also insert a run button next to each query in the code editor to help you quickly run the query defined in the @Query annotation.

Document:  Use Database Inspector to debug the database

https://developer.android.google.cn/studio/inspect/database

Google Android Studio 4.1 official version released: directly run the Android emulator

△ Use Database Inspector to inspect, query and modify application databases

Run the Android emulator directly in Android Studio

Now you can run the Android emulator directly in Android Studio. This feature helps to save screen space. You can use hotkeys to quickly navigate between the simulator and editor windows, and organize your IDE and simulator workflow in one application window. You can manage common emulator operations such as snapshots and rotation and screenshots in Studio, but you still need to use a stable emulator to use all the options. You can enable this function by following this menu path: File → Settings → Tools → Emulator → Launch in Tool Window.

Google Android Studio 4.1 official version released: directly run the Android emulator

△ Run Android Emulator in Android Studio

Dagger navigation support

Dagger is a commonly used dependency injection library on Android. Android Studio provides new gutter operations and expands the support in the Find Usages window, making it easier to navigate between Dagger related codes. For example, clicking the gutter action next to the method using a given type will navigate you to the location where that type is available. Conversely, clicking the https://developer.android.google.cn/training/dependency-injection/dagger-basics

Hilt: https://developer.android.google.cn/training/dependency-injection/hilt-android

Document:  Dagger navigation support https://developer.android.google.cn/studio/releases#dagger-navigation

Google Android Studio 4.1 official version released: directly run the Android emulator

△ Use gutter operations to navigate between Dagger related codes

Use TensorFlow Lite model

Currently, Android developers are using machine learning to create novel and practical experiences. TensorFlow Lite is a common development library for writing mobile machine learning models. We hope to simplify the process of importing these models into Android applications. Similar to view binding, Android Studio generates easy-to-use classes to help you streamline the code required to run the model and improve type safety. The current implementation of ML Model Binding supports image classification and style transfer models, provided they are enhanced through metadata.

Practical and innovative experience: https://developer.android.google.cn/helpful-innovation

TensorFlow Lite: https://www.tensorflow.org/lite

To view the details of the imported model and how to use it in the application, double-click the .tflite model file in the project to open the model viewer page.

Document:  Use TensorFlow Lite model https://developer.android.google.cn/studio/write/mlmodelbinding

Google Android Studio 4.1 official version released: directly run the Android emulator

△ View TensorFlow Lite model metadata in Android Studio 4.1

Build and test

Android emulator-foldable device hinge information support

Android Studio

In addition to the recently added 5G mobile network testing function, we also added support for foldable devices in the Android emulator. In Android emulator 30.0.26 and higher, you can use multiple folding designs and configurations to set up foldable devices. After setting, the simulator will provide hinge angle sensor and attitude change information, which is convenient for you to test the response of these models.

Emulator support for 5G https://developer.android.google.cn/about/versions/11/behavior-changes-all#emulator-5g

Use the Android emulator to develop on Android 11 https://medium.com/androiddevelopers/developing-for-android-11-with-the-android-emulator-a9486af2d7ef

Google Android Studio 4.1 official version released: directly run the Android emulator

Apply Changes update

Faster builds help developers change applications more easily and quickly. To help you improve the efficiency of application iteration, we have made several enhancements to Apply Changes on Android 11 or higher devices.

We have invested heavily in optimizing the iteration speed and developed a method to deploy and save changes on the device without installing an app. Now, after the initial deployment is completed, the speed of subsequent deployments to Android 11 devices through Apply Code Changes or Apply Changes and Restart Activity is greatly improved. We also added support for other code changes in Apply Changes. Now, after you add a method, you can click the Apply Code Changes or Apply Changes and Restart Activity buttons to deploy these changes to the running application.

Structural class redefinition and Apply Changes https://medium.com/androiddevelopers/structural-class-redefinition-and-apply-changes-30f96f1962e6

Export C/C++ dependencies from AAR

Android Gradle Plugin 4.0 adds the ability to import Prefab packages in AAR dependencies. We hope to extend this feature to share native libraries. AGP 4.1 supports exporting libraries from external native builds in the AAR of the Android library project. To export the native library, add the following to the android block of the library project’s build.gradle file:

Use native dependencies https://developer.android.google.cn/studio/build/native-dependencies

buildFeatures  { 
    prefabPublishing  true } 
prefab  { 
    mylibrary  { 
        headers  "src/main/cpp/mylibrary/include" } 
    myotherlibrary  { 
        headers  "src/main/cpp/myotherlibrary/include" } }

    
    

Native code crash report symbolic analysis

When the native code crashes or ANR occurs, the system generates a stack trace, which is a snapshot of the sequence of nested functions called before the program crashes. These snapshots can help you identify and fix problems in the source code, but they must first be symbolized to convert the computer address back to a human-readable function name.

If your application or game is developed using native code such as C++, you can now upload the debugging symbol files of each version of the application to the Play Management Center. The Play Management Center uses these debug symbol files to symbolize the stack trace of your application, thereby simplifying crash and ANR analysis. If you want to include debugging symbols in the App Bundle, please add the following to the project’s build.gradle file:

android.buildTypes.release.ndk.debugSymbolLevel =’SYMBOL_TABLE’

optimization

System Trace interface improvements

In Android Studio 4.1, we have made a comprehensive improvement to System Trace, an optimization tool that allows you to understand the application’s use of system resources in real time. The frame selection mode can also make it easier to select trace records. In addition, we have added a new analysis tab and added more frame rendering data to help you investigate rendering issues in the application interface.

System Trace https://developer.android.google.cn/topic/performance/tracing

Documentation: Android Studio System Trance update https://medium.com/androiddevelopers/whats-new-in-android-studio-system-trace-5841465c5935

Frame selection: In the Threads section, you can now drag the mouse to frame a rectangular area, and click the Zoom to Selection button in the upper right corner (or use the keyboard shortcut M) to enlarge the area. After you drag and drop similar threads together, you can box select across multiple threads to check all threads at the same time.

Google Android Studio 4.1 official version released: directly run the Android emulator

△ Use the frame selection mode to more easily select the trace record Summary tab: The new Summary tab in the Analysis panel will display the following:

  • Summary statistics for all instances of a particular event, such as instance count and minimum/maximum duration.
  • The tracking event statistics of the selected instance.
  • Data about the distribution of thread states.
  • The longest running instance within the selected trace event.

Google Android Studio 4.1 official version released: directly run the Android emulator

△ View summary statistics in the Summary tab

Display data: In the Display section, the new timeline of SurfaceFlinger and VSYNC can help you investigate rendering issues in the application interface.

SurfaceFlinge https://source.android.google.cn/devices/graphics/surfaceflinger-windowmanager

VSYNC https://source.android.google.cn/devices/graphics/implement-vsync

Standalone analyzer

The Android Studio Analyzer can now be accessed in a separate window from the main Android Studio window. This feature is very useful when optimizing Android games built with other tools such as Unity or Visual Studio.

To run the standalone analyzer, do the following:

1. Make sure that your system is not running the analyzer in Android Studio.

2. Go to the installation directory and navigate to the bin directory:

Windows / Linux : < studio - installation - folder > \b in 
macOS : < studio - installation - folder > /Contents/ bin 
     
    

3. According to your operating system, run profiler.exe or profiler.sh

The standalone analyzer can be connected to the Android Emulator or other connected devices.

Google Android Studio 4.1 official version released: directly run the Android emulator

△ Use independent Android Studio analyzer to optimize your application

Native memory performance analyzer

Tracking the usage of native memory is very important for game developers and other developers who use C++, so they can optimize the memory usage of their applications. Android Studio memory profiler (Memory Profiler) now includes a native memory profiler (Native Memory Profiler), specifically for applications running on Android 10 or higher physical devices. The native memory performance analyzer can track the allocation/destruction of objects in the native code within a specific period of time, and provide information on the overall memory allocation and the remaining size of the system heap.

To start recording, click Record native allocations at the top of the Memory Profiler window:

Google Android Studio 4.1 official version released: directly run the Android emulator

△ Use native memory performance profiler to view native memory allocation

to sum up

To briefly review, Android Studio 4.1 includes the following new and improved features:

design

  • Material Design component update

Development

  • Database Inspector
  • Run the Android emulator directly in Android Studio

Dagger navigation support

  • Use TensorFlow Lite model

Build and test

  • Android emulator-foldable device hinge information support

Apply Changes update

  • Export C/C++ dependencies from AAR
  • Native code crash report symbolic analysis

optimization

  • System Trace interface improvements

Standalone analyzer

  • Native memory performance analyzer
DOWNLOAD Our Mobile App



If you think this post can be helpful to somebody else, please share it on Twitter, Facebook or Whatsapp it to friends. There are buttons below for this (easy to use too)! Join Over 5,000 + Readers. Get a free daily update via Email HERE


For the latest tech news across the world, latest PC and Mobile games, tips & tricks, top-notch gadget reviews of most exciting releases follow Naijatechnews' FacebookTwitter, Instagram & Telegram. Subscribe our Google News, & YouTube Cannel.

YOU MAY LIKE

Download Netify VPN Apk 2019 For Android 1

Click to comment ❤️

Leave a Reply

8 + two =



Note: off comments will be trashed and you will be marked as Spam! use contact us, if it's required.

TRENDING POSTS

Copyright © 2020 Naijatechnews. All rights reserved.Technology is developing very rapidly. We’ll keep you posted on all the latest news in technology and lifestyle. Spread the word!

To Top