Google launches Android Studio 4.0 with Motion Editor, Build Analyzer, and Java 8 APIs

栏目: IT技术 · 发布时间: 3年前

内容简介:Below you’ll find Android Studio 4.0 features broken down by category: design, develop, and build. The new version also includes the usual performance improvements and bug fixes on top of the new features (Lastly, Android Gradle plugin 4.0.0 includes suppo

VB Transform 2020 Online – July 15-17. Join leading AI executives: Register for the free livestream .

Below you’ll find Android Studio 4.0 features broken down by category: design, develop, and build. The new version also includes the usual performance improvements and bug fixes on top of the new features ( full release notes ). Google didn’t share its plans for the next version. Normally we’d get hints at the company’s I/O developer conference, but 2020 is a weird year.

Android Studio 4.0 design features

  • Motion Editor : The  MotionLayout API  extends the rich capabilities of  ConstraintLayout to help Android developers manage complex motion and widget animation in their apps. It’s now easier to use this API with the new Motion Editor — an interface for creating, editing, and previewing MotionLayout animations. You no longer have to create and modify complex XML files; the Motion Editor generates them for you, with support for editing constraint sets, transitions, keyframes, and view attributes. If you do want to see the code the editor creates, it is one click away. For developers already using ConstraintLayout , the IDE can easily convert those to  MotionLayout .
  • Upgraded Layout Inspector : Investigate where a value for a particular attribute came from or see a live 3D representation of nested views to inspect your view hierarchy. The Layout Inspector gives you access to data that stays updated with your running app and providing insights on how resources are being resolved. Use the live Layout Inspector by selecting View > Tool Windows > Layout Inspector from the main menu. If you are deploying to a device running API 29 level or higher, you have access to additional features, such as a dynamic layout hierarchy that updates as views change, detailed view attributes that also help you determine how resource values are resolved, and a live 3D model of your running app’s UI. Navigate, animate, and transition between views on your running app while being able to debug your UI.
  • Layout Validation: When you’re developing for multiple form-factors, screen sizes, and resolutions, you need to verify that changes you make to your UI look great on every screen you support. With the Layout Validation window, you can preview layouts on different screens and configurations simultaneously. To get started, click on the Layout Validation  tab in the top-right corner of the IDE.

Android Studio 4.0 develop features

Android Studio 4.0 develop features

  • CPU Profiler UI upgrades : The  CPU profiler is designed to provide a rich amount of information about your app’s thread activity and trace recordings. CPU recordings are now separated from the main profiler timeline and organized in groups. You can move groups up and down, or drag-and-drop individual items within a group for additional customization. You can now view all thread activity in the Thread Activity timeline (including methods, functions, and events) and try new navigation shortcuts to easily move around the data—such as using W, A, S, and D keys for fine-grained zooming and panning. Google also redesigned the System Trace UI so Events are uniquely colored for better visual distinction, threads are sorted to surface the busier ones first, and you can now focus on seeing data for only the threads you select. The quality of the CPU profiler should also be better — Google has seen a significant decrease in the user-reported error rates of recordings since Android Studio 3.6.
  • Smart editor features when writing rules for code shrinking: R8 was introduced in Android Gradle plugin 3.4.0 to combine desugaring, shrinking, obfuscating, optimizing, and dexing—resulting in noticeable build performance improvements. When creating rules files for R8, Android Studio now provides smart editor features, such as syntax highlighting, completion, and error checking. The editor also integrates with your Android project to provide full symbol completion for all classes, methods, and fields, and includes quick navigation and refactoring.
  • IntelliJ IDEA 2019.3 platform update: The core Android Studio IDE has been updated with improvements from IntelliJ IDEA  2019.3  and  2019.3.3  releases. These improvements largely focus on quality and performance improvements across the IDE.
  • Kotlin Android live templates: An IntelliJ feature that allows you to insert common constructs into your code by typing simple keywords. Android Studio now includes Android-specific live templates for your Kotlin code. For example, simply type toast  and press the Tab key to quickly insert boilerplate code for a Toast. For a full list of available live templates, navigate to  Editor > Live Templates  in the  Settings  (or  Preferences ) dialog.
  • Clangd support for C++: For developers writing C++, clangd is now the primary language analysis engine for code navigation, completion, inspection, and showing code errors and warnings. Google also now bundles clang-tidy with Android Studio. To configure Clangd or Clang-Tidy behavior, go to the IDE Settings  (or  Preferences ) dialog, navigate to  Languages & Frameworks > C/C++ > Clangd  or  Clang-Tidy , and configure the options.

Android Studio 4.0 build features

  • Build Analyzer : Outdated or misconfigured tasks can cause longer build times that lead to frustration and lost productivity. The Build Analyzer helps developers understand and address bottlenecks in your build by highlighting the plugins and tasks that are most responsible for your overall build time and by suggesting steps to mitigate regressions.
  • Java 8 Language library desugaring in D8 and R8 : Previous versions of the Android Gradle plugin supported a variety of Java 8 language features for all API levels, such as lambda expressions and method references, through a process called  desugaring . Now, the desugaring engine has been extended to support Java language APIs, regardless of your app’s minSdkVersion. This means that you can now use standard language APIs, which were previously available in only recent Android releases (such as java.util.stream, java.util.function and java.time).
  • Feature-on-feature dependencies : You can now specify that a Dynamic Feature module depends on another feature module. Being able to define this relationship ensures that your app has the required modules to unlock additional functionality, resulting in fewer requests and easier modularization of your app. For example, a :video  feature can depend on the  :camera  feature. If a user wants to unlock the ability to record videos, your app automatically downloads the required :camera module when it requests  :video .
  • New options to enable or disable build features : The Android Gradle plugin has built-in support for modern libraries, such as data binding and view binding, and build features, such as auto-generated BuildConfig classes. However, you might not need these libraries and features for every project. You can now disable discrete build features, which can help optimize build performance for larger projects.
  • Essential support for Kotlin DSL script files: Built-in support for Kotlin DSL build script files (*.kts) means that Kotlin build scripts offer a full suite of quick fixes and are supported by the Project Structure dialog. Google will continue to refine the Android Gradle Plugin’s DSL API throughout the next year, which may result in breaking API changes for Kotlin script users. Long term, these fixes will make for a more idiomatic, easy-to-use DSL for Kotlin script users.
  • Dependencies metadata: When building your app using Android Gradle plugin 4.0.0 and higher, the plugin includes metadata that describes the library dependencies that are compiled into your app. When uploading your app, the Play Console inspects this metadata to provide alerts for known issues with SDKs and dependencies your app uses, and, in some cases, provide actionable feedback to resolve those issues. The data is compressed, encrypted by a Google Play signing key, and stored in the signing block of your release app.

Lastly, Android Gradle plugin 4.0.0 includes support for Android Studio’s Build Analyzer by using Java 8 language APIs (regardless of your app’s minimum API level), and creating feature-on-feature dependencies between Dynamic Feature modules.

Check out the latest Samsung phones at great prices from Gizmofashion – our recommended retail partner.

Author: Emil Protalinski.

Source: Venturebeat


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

大数据大创新:阿里巴巴云上数据中台之道

大数据大创新:阿里巴巴云上数据中台之道

邓中华 / 电子工业出版社 / 2018-11 / 99

阿里巴巴云上数据中台正服务着阿里生态中的数十个业务板块、百余家公司、千万级客户,在帮助决策层看清甚至决定业态走向的同时,在上万个业务场景中应用并催生创新。 《大数据大创新:阿里巴巴云上数据中台之道》基于作者在阿里巴巴的十年大数据从业经历,精彩演绎云上数据中台之道。《大数据大创新:阿里巴巴云上数据中台之道》基于大数据探索的大趋势,讲述阿里巴巴云上数据中台顶层设计,再以实际案例详述阿里巴巴云上数......一起来看看 《大数据大创新:阿里巴巴云上数据中台之道》 这本书的介绍吧!

html转js在线工具
html转js在线工具

html转js在线工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具