分享好友 最新动态首页 最新动态分类 切换频道
Android Studio 4.1 (August 2020)
2024-12-26 23:35

Android Studio 4.1 is a major release that includes a variety of new features and improvements.

Inspect, query, and modify your databases in your running app using the new Database Inspector. To get started, deploy your app to a device running API Level 26 or higher, and select View > Tool Windows > Database Inspector from the menu bar.

To learn more, see Debug your database with the Database Inspector.

You can now run the Android Emulator directly in Android Studio. Use this feature to conserve screen real estate, to navigate quickly between the emulator and the editor window using hotkeys, and to organize your IDE and emulator workflow in a single application window.

To learn more, see the Android Emulator documentation.

ML Model Binding makes it easy for you to directly import model files and use them in your projects. Android Studio generates easy-to-use classes so you can run your model with less code and better type safety.

The current implementation of ML Model Binding supports image classification and style transfer models, provided they are enhanced with metadata. Over time, support will be expanded to other problem domains, like object detection, image segmentation, and text classification.

A wide range of pre-trained models with metadata are provided on TensorFlow Hub. You can also add metadata to a TensorFlow Lite model yourself, as is outlined in Adding metadata to TensorFlow Lite model.

To import a supported model file, follow these steps:

  1. Open the TensorFlow Lite model import dialog in the File menu at File > New > Other > TensorFlow Lite Model.
  2. Select the model file that you previously downloaded or created.
  3. Click Finish.

This imports the model file into your project and places it in the folder; if the directory doesn't exist, Android Studio creates it for you.

To see the details for an imported model and get instructions on how to use it in your app, double-click the model file in your project to open the model viewer page, which shows the following:

  • Model: High-level description of the model
  • Tensors: Description of input and output tensors
  • Sample code: Example of how to interface with the model in your app

Here is an example using mobilenet_v1_0.25_160_quantized.tflite:

As the example demonstrates, Android Studio creates a class called for interacting with the model.

If the model does not have metadata, this screen will only provide minimal information.

  • Support for TensorFlow Lite models for problem domains other than image classification and style transfer is currently limited. Although import should work fine, some model inputs and/or outputs are represented by TensorBuffers rather than friendly types. For models without any metadata, all model inputs and outputs will be TensorBuffers.
  • Models with Input and Output data types different from or are not supported.

This feature is still under development, so please provide feedback or report bugs.

The Android Studio Memory Profiler now includes a Native Memory Profiler for apps deployed to physical devices running Android 10 or later. With the Native Memory Profiler, you can record memory allocations and deallocations from native code and inspect cumulative statistics about native objects.

To learn more about the Native Memory Profiler, see Inspect your app's memory usage with Memory Profiler.

The Native Memory Profiler in Android Studio 4.1 does not work for Android 11 devices. Support for profiling Android 11 devices is currently available in the 4.2 preview release".

As of the initial 4.1 release, app startup profiling has been disabled. This option will be enabled in an upcoming release.

As a workaround, you can use the Perfetto standalone command-line profiler to capture startup profiles.

The System Trace UI in the Android Studio profiler includes the following improvements:

  • Summary tab: The new Summary tab in the Analysis panel displays:

    • Aggregate statistics for all occurrences of a specific event, such as an occurrence count and min/max duration.

    • Trace event statistics for the selected occurrence.

    • Data about thread state distribution.

    • Longest-running occurrences of the selected trace event.

    To navigate to another occurrence, select another row from the table.

  • Display data: In the Display section, new timelines for SurfaceFlinger and VSYNC help you investigate rendering issues in your app's UI.

For basic usage instructions on how to record a system trace, see the Record traces section of Inspect CPU activity with CPU Profiler.

With the new standalone profilers, it's now possible to profile your app without running the full Android Studio IDE.

For instructions on using the standalone profilers, see Run standalone profilers.

Android Studio makes it easier to navigate between your Dagger-related code by providing new gutter actions and extending support in the Find Usages window.

  • Find Usages node: When you invoke Find Usages on a provider of a given type, the Find window now includes a Dependency consumer(s node that lists consumers of that type. Conversely, invoking this action on a consumer of a Dagger-injected dependency, the Find window shows you the provider of that dependency.

Android Studio templates in the Create New Project dialog now use and conform to updated guidance for themes and styles by default. Updates include:

  • MDC: Projects depend on in . Base app themes use parents and override updated MDC color and “on” attributes.

  • Color resources: Color resources in use literal names (for example, instead of ).

  • Theme resources: Theme resources are in (instead of ) and use names.

  • Dark theme: Base application themes use parents and are split between and .

  • Theme attributes: Color resources are referenced as theme attributes (for example, ) in layouts and styles to avoid hard-coded colors.

The core Android Studio IDE has been updated with improvements from IntelliJ IDEA through the 2020.1 release, including a new Commit window that enables version control operations and a new Zen mode that can be toggled by selecting View > Appearance > Enter Distraction Free Mode.

To learn more about the improvements in version 2020.1, see .

The locations of user configuration directories have been changed to the following:

Syntax:

Example:

Syntax:

Example:

Syntax:

Example:

These new directory locations are consistent with recent updates to IntelliJ IDEA, the IDE on which Android Studio is based.

If Studio doesn't restart after an upgrade, you may need to delete the configuration directory from a previous Studio version. See the known issues page for more information.

Android Studio 4.1 bundles Kotlin 1.3.72, which includes a number of fixes to improve Kotlin highlighting, inspections, and code completion. Check out the 1.3.72 Kotlin changelog for details.

When creating a custom view (for example, by extending the or class), Android Studio now shows you a preview of your custom view. Use the dropdown menu in the toolbar to switch between multiple custom views, or click the buttons to wrap vertically or horizontally to the content.

When a crash or ANR occurs in native code, the system produces a stack trace, which is a snapshot of the sequence of nested functions called in your program up to the moment it crashed. These snapshots can help you to identify and fix any problems in the source, but they must first be symbolicated to translate the machine addresses back into human-readable function names.

If your app or game is developed using native code, like C++, you can now upload debug symbols files to the Play Console for each version of your app. The Play Console uses these debug symbols files to symbolicate your app's stack traces, making it easier to analyze crashes and ANRs. To learn how to upload debug symbols files, see Native crash support.

To help you be more productive as you iterate on your app, we've made the following enhancements to Apply Changes for devices running Android 11 Developer Preview 3 or higher:

To learn more about the difference between these two actions, see Apply Changes.

最新文章
镇江屋顶漏水维修电话〈免费上门〉镇江屋顶防水补漏师傅
不砸砖、不砸墙;免砸砖防水补漏技术,2小时快速解决漏水问题,超长保修期。漏水维修服务项目:房顶漏水、窗台防水补漏、楼顶漏水、泳池渗水、楼顶裂缝漏水、厨房间漏水、天棚漏水、别墅房顶漏水、地板下暗管漏水、飘窗防水、飘窗渗水、楼顶防
社会保险认证人脸识别平台:便捷、高效与安全并重的社保认证新方式
一、引言随着科技的飞速发展,社会保险认证方式也在不断创新。社会保险认证人脸识别平台作为一种新兴的社保认证方式,凭借其便捷性、高效性和安全性,逐渐受到广大参保人员的青睐。本文将详细介绍社会保险认证人脸识别平台的功能、优势、使
泸县第二人民医院医共体党委书记康健接受纪律审查和监察调查
  泸县第二人民医院医共体党委书记康健涉嫌严重违纪违法,目前正接受泸县纪委监委纪律审查和监察调查。  康健简历  康健,男,汉族,1975年7月生,四川泸县人,在职大学学历。1994年8月参加工作,2009年7月加入中国共产党。  1994
阿里巴巴和淘宝有什么区别
阿里巴巴和淘宝有什么区别1、成交客户不同一个是零售平台,一个是批发平台,最大的不同就在于这个客户类型;零售客户是一单单的发货,成交周期短,百分百平台上成交,他可能这辈子只跟你做这一次买卖;批发客户是大批量的采购,成交周期长
百度输入法定制版
百度输入法定制版是一款针对打字设计的输入法软件。这款软件由百度官方出品,为大家带来了超多的输入方式,无论是手写、五笔、拼音、语音还是各个国家的语言都可以满足大家的需求,更有海量的表情包、金句可以随心选,让大家的聊天更加的富
青春绽放 创新无限
近日,由全国高校思想政治工作网、南开大学和中国移动联合主办,咪咕互动娱乐有限公司、南开大学软件学院、中国电子学会智能人机交互专委会承办的动感地带AI+高校创智计划海选赛在智慧与创意的碰撞中落幕,经过三个月的激烈比拼,50支高校
高清美女写真一键生成:探索AI绘画工具的奥秘与玩法
在这个数字化的时代,AI技术的普及使得我们可以轻松生成超逼真的美女写真。想象一下,只需简单的几步操作,你就能得到一张涵盖各类风格和细节的完美人像。这是不是让你心动呢?今天,我们将带你进入AI生成美女写真工具的世界,分析几款热门
泉州爱采购自运营
百度爱采购是如何排序的?1.时间因素:爱采购网站展示的高品质数据,并非人工介入,而是受时间因素控制,在不同的时间,同一物品会出现在不同的地点。比方说,您在采购中做了一款游泳产品,早上您查询的展示位置是在首页首行,下午再次查询
PTA: 确定班级排名
某学年的班级考评中,班名为cn1​的班级获评先进班集体,班名为cn2​的班级获评优秀学风班。经了解,该学年学院所有班级中,按班级考评的总分sc1​排名选前3个班级获评先进班集体,按学风得分sc2​排名选排
相关文章
推荐文章
发表评论
0评