现在在android 15中

Welcome to Now in Android, your ongoing guide to what’s new and notable in the world of Android development.

欢迎使用Android Now,这是您持续不断的有关Android开发领域新事物和着名指南。

NiA15视频和播客形式 (NiA15 in Video and Podcast Form)

This Now in Android is also offered in video and podcast form. It’s the same content, but with less reading required. The article version (keep reading!) is still the place to come for links to all of the content that’s covered.

Android中的 This Now还以视频和播客形式提供。 内容相同,但所需的阅读量更少。 仍然可以使用文章版本(请继续阅读!)链接到所涵盖的所有内容。

视频 (Video)

播客 (Podcast)

Click on the link below, or just subscribe to the podcast in your favorite client app.

单击下面的链接,或只订阅您喜欢的客户端应用程序中的播客。

Android 11 (Android 11)

Image for post
Android dialed up to 11
Android最多拨打11

No new developments with Android 11 release this time: it’s still in Developer Preview 2, which I talked about in the previous episode. But there were a couple of things related to the release that are interesting to pass along:

这次没有发布新的Android 11开发:它仍在我在上一集中谈到的Developer Preview 2中。 但是与发布有关的一些事情很有趣:

🥵你可以加热吗? (🥵 Can You Take the Heat?)

First of all, for those native programmers out there (you know who you are), the NDK released with Android 11 Developer Preview 2 added the Thermal API, which allows developers to find out the current state of the device so that they can react accordingly.

首先,对于那里的本机程序员(您知道自己是谁),随Android 11 Developer Preview 2发布的NDK添加了Thermal API ,该API使开发人员可以找出设备的当前状态,以便他们可以做出相应的React。 。

在模拟器上运行本机ARM应用程序的系统映像 (System Images for Running Native ARM Apps on the Emulator)

Michael Hazard on the Android Studio team posted an article on the Android Developers Blog about faster emulation for ARM binaries.

Android Studio团队的Michael Hazard在Android Developers Blog上发表了一篇文章,内容涉及ARM二进制文件的更快仿真。

If your app is written completely in Kotlin or the Java programming language, this doesn’t affect you. But if you use native libraries which only have ARM binaries, then you have been unable to use the x86-accelerated emulator capability on x86 machines. Instead, you had to test your app on either a physical devices (which use ARM natively) or with a much slower emulator image.

如果您的应用程序完全是用Kotlin或Java编程语言编写的,则不会影响您。 但是,如果使用仅具有ARM二进制文件的本机库,则将无法在x86计算机上使用x86加速的仿真器功能。 相反,您必须在物理设备(本机使用ARM)或速度慢得多的仿真器映像上测试应用程序。

Now, with the new ARM-compatible system images included in the Android 11 release, we are able to translate from ARM to x86 instructions, which enables the emulator to take advantage of hardware acceleration and maintain performance when running ARM binaries.

现在,借助包含在Android 11版本中的新的与ARM兼容的系统映像,我们能够将ARM转换为x86指令,从而使仿真器能够在运行ARM二进制文件时利用硬件加速并保持性能。

IME Animation Sample App (IME Animation Sample App)

Image for post

Last time, I went on and on about my favorite feature in Android 11: IME animations. This new platform feature allows applications to listen in on the progress of the animations so that they can adjust their content accordingly. Also, conversely, they can control the animation of the keyboard directly.

上次,我继续介绍了Android 11中我最喜欢的功能:IME动画。 这项新的平台功能允许应用程序监听动画的进度,以便他们可以相应地调整其内容。 同样,相反,他们可以直接控制键盘的动画。

Chris Banes has written a sample to show how to do this, WindowInsetsAnimation, which shows both how to react to the IME coming entering and leaving the screen and controlling the IME’s entrance/exit.

克里斯· 班尼斯 ( Chris Banes )编写了一个示例来演示如何执行此操作,即WindowInsetsAnimation ,该示例演示了如何对输入和输出屏幕的IME以及如何控制IME的进/出做出React。

AndroidX (AndroidX)

Many AndroidX libraries were released in early April, including the following stable releases:

许多AndroidX库于4月初发布,其中包括以下稳定版本:

  • ExifInterface 1.2.0 adds support for writing EXIF metadata to PNG files and reading/writing EXIF for WebP. Now ExifInterface handles writing to PNG, JPEG, and WebP (as well as reading from various other file types).

    ExifInterface 1.2.0添加了对将EXIF元数据写入PNG文件以及对WebP读取/写入EXIF的支持。 现在,ExifInterface可以处理对PNG,JPEG和WebP的写入(以及从其他各种文件类型读取)。

  • Fragment 1.2.4 offers Proguard and Lint improvements.

    片段1.2.4提供了Proguard和Lint的改进。

There were also several AndroidX libraries hitting various stages of beta and alpha, so check out all of the releases for more details.

还有多个AndroidX库分别处于betaalpha的各个阶段,因此请查看所有发行版以获取更多详细信息。

大迁徙 (The Great Migration)

Speaking of AndroidX, Nick Anthony wrote an article on how to migrate to AndroidX from the previous Support Library version of these libraries.

谈到AndroidX, 尼克·安东尼 ( Nick Anthony)写了一篇文章,介绍如何从这些库的先前支持库版本迁移到AndroidX。

If you’ve been putting this off, this is a good time to finally do it. The Support Library is at the end of the line; version 28 was the last one which will receive any fixes, so make your way over to the future-bound AndroidX versions instead.

如果您一直推迟进行此操作,那么这是一个最终完成此操作的好时机。 支持库位于该行的末尾; 版本28是最后一个将获得任何修复的版本,因此请改用以后绑定的AndroidX版本。

影片和文章 (Videos and Articles)

Normally, I list videos and articles separately in Now in Android. But whenever possible, we try to release developer content in both formats (software is all about reuse!). So in an attempt to make things less confusing here with the content overlap, I’ll try blending articles and videos together this time.

通常,我会在Android的Now中分别列出视频和文章。 但是,只要有可能,我们都会尝试以两种格式发布开发人员内容(软件都是关于重用!)。 因此,为了使此处的内容重叠部分减少混乱,我这次将尝试将文章和视频融合在一起。

截屏 (Screencasts)

In the current situation in which all of us are working from home, recording videos is… not as easy as it was when we had professional recording studios and production teams. But it turns out that everyone can still write code and explain it, so screencasting might be the developer video of the future (or at least the present).

在我们所有人都在家工作的当前情况下,录制视频……并不像我们拥有专业的录音棚和制作团队那样容易。 但是事实证明,每个人仍然可以编写代码并对其进行解释,因此,截屏可能是未来(或至少是现在)的开发者视频。

Jose Alcérreca posted four new screencasts demonstrating some foundational Android development techniques. These videos cover View Binding, UI testing, LiveData and ViewModel usage, and Data Binding. Not bad for just seven total minutes of content.

JoseAlcérreca发布了四个新的截屏视频,展示了一些基本的Android开发技术。 这些视频涵盖了视图绑定UI测试LiveData和ViewModel的用法以及数据绑定 。 总共七分钟的内容还不错。

Kotlin (Kotlin)

There were a few articles and videos posted about Kotlin development:

有一些关于Kotlin开发的文章和视频:

Manuel Vivo posted the video Kotlin Coroutines 101. In this presentation, Manuel explains what coroutines are and what problems they solve (spoiler: they simplify asynchronous programming). He also discusses coroutine cancellation and testing.

Manuel Vivo发布了视频Kotlin Coroutines 101 。 在此演示中,Manuel解释了协程是什么以及它们解决了什么问题(破坏者:它们简化了异步编程)。 他还讨论了协程取消和测试。

Florina Muntenescu posted the next episode in the Kotlin Vocabulary series, in both video and article form. This time, she discusses inline functions. Inline functions cause the compiler to copy the function code to the call site, removing the overhead of lambda function parameters which would otherwise cause allocations under the hood. But inline functions are not a panacea. Consider using them when there is actually function parameter overhead to mitigate. Don’t use them for large, complex functions, or you risk bloating your code from all of those copies.

Florina Muntenescu视频文章形式发布了Kotlin词汇系列的下一集。 这次,她讨论了内联函数。 内联函数使编译器将函数代码复制到调用站点,从而消除了lambda函数参数的开销,否则这些开销将导致底层分配。 但是内联函数不是万能的。 当实际需要减轻函数参数开销时,请考虑使用它们。 不要将它们用于大型,复杂的功能,否则可能会冒着使所有这些副本膨胀代码的风险。

Inline Functions: The video
内联函数:视频

Manuel posted an article called Coroutines & Patterns for work that shouldn’t be cancelled. Sometimes you want to execute work asynchronously that you’d like to continue running, even if the scope in which you started the work ends. This article talks about how to do that, using custom scopes, and about patterns of development that help determine which approach to use in different situations.

曼努埃尔(Manuel)发表了一篇名为“ 协程与模式”的文章,不应取消它 。 有时,即使您开始工作的范围结束了,您还是想异步执行想要继续运行的工作。 本文讨论了如何使用自定义范围来做到这一点,并讨论了有助于确定在不同情况下使用哪种方法的开发模式。

喷气背包 (Jetpack)

There were a few things posted about various Jetpack APIs that are worth checking out.

关于各种Jetpack API的一些事情值得一提。

Tiem Song posted Assembling your Jetpack, which discusses the Jetpack APIs, giving an overview of the APIs and how to use them in your application, including how to migrate to the new AndroidX version of the libraries. All new development happens in the AndroidX libraries, not the older Support Library versions. Speaking of migration, be sure to check out Nick Anthony’s article, discussed above, which covers migration in more detail.

Tiem Song发表了《 组装Jetpack》 ,其中讨论了Jetpack API,概述了API以及如何在应用程序中使用它们,包括如何迁移到新的AndroidX版本的库。 所有新开发都在AndroidX库中进行,而不是在较早的支持库版本中进行。 说到迁移,请务必查看上面讨论的Nick Anthony的文章 ,其中更详细地介绍了迁移。

Tiem uses the Sunflower sample application to show Jetpack APIs in action.

Tiem使用Sunflower示例应用程序展示了实际使用的Jetpack API。

Pietro Maggi posted the fifth article in a series on WorkManager, Customizing WorkManager — Fundamentals. This article shows how to create a custom configuration for WorkManager, as well as why you might sometimes want to do so.

Pietro Maggi在WorkManager的系列文章“自定义WorkManager-基础知识”中发布了第五篇文章。 本文介绍了如何为WorkManager创建自定义配置,以及为什么有时可能需要这样做。

Florina posted an article about RecyclerView: Merge Adapters Sequentially with MergeAdapter. With this new API, added in the alpha02 release of recyclerview-1.2.0, you can use multiple adapters (which are merged into one— get it?) instead of serving all views from a single adapter.

Florina发表了一篇有关RecyclerView的文章: 与MergeAdapter依次合并适配器 。 使用此新API(在recyclerview-1.2.0的alpha02版本中添加),您可以使用多个适配器( 合并到一个适配器中吗?),而不是通过单个适配器提供所有视图。

Manuel posted an article which offers cheat sheets which show the code that Dagger generates for annotations. The article also has helpful links to a guide on dependency injection, a codelab using Dagger in Android, and a video on the future of Dagger in Android.

曼努埃尔(Manuel)发布了一篇文章,其中提供了备忘单,其中显示了Dagger为注释生成的代码。 本文还提供了有用的链接,这些链接指向有关依赖项注入的指南,在Android中使用Dagger的代码实验室以及关于Android中Dagger未来的视频。

Also in Jetpack: Sean McQuillan updated the JetNews sample app for Jetpack Compose to sync with the latest release of Compose, dev08. This version uses the new fluent API for modifiers, among other changes.

同样在Jetpack中: Sean McQuillan更新了Jetpack ComposeJetNews示例应用程序 ,以与最新版本的Compose dev08同步。 此版本使用了新的fluent API进行修饰符以及其他更改。

Android Studio (Android Studio)

Image for post

Murat Yener posted an article on the new Layout Inspector tool in the beta release of Android Studio 4.0. Layout Inspector is not new, but it’s been rewritten with many powerful features, including live updates as you interact with the app on a device, property resolution that allows you to jump to the code where an attribute is defined, and a 3D visualization mode that allows you to better understand the view and containment hierarchy in your app.

Murat YenerAndroid Studio 4.0Beta版中发布了有关新的Layout Inspector工具的文章。 Layout Inspector并不是新功能,但是它已经重写了许多强大的功能,包括与设备上的应用程序进行交互时的实时更新,允许您跳至定义属性的代码的属性解析以及3D可视化模式。使您可以更好地了解应用程序中的视图和包含层次结构。

亚行播客节目 (ADB Podcast Episodes)

There‘s been another Android Developers Backstage podcast posted since the last Now in Android. Check it out at the links below, or in your favorite podcast client:

自从上次在Android中发布Now之后,又发布了另一个Android Developers Backstage播客。 在下面的链接或您喜欢的播客客户端中进行检查:

ADB 135:音频播客 (ADB 135: Audio Podcast)

It was appropriate that our first fully-remote podcast (where we were all recording ourselves from the luxury of our own closets) took place with guests who work on audio technology. We talked with Phil Burk, an engineer on Android’s audio team (whom we spoke with way back in episode 39 about MIDI on Android), and Don Turner, from the developer relations team, about audio latency and about Oboe in particular. Oboe is a native (read: C++) library that makes it easier for developers to achieve lower latency audio on Android.

我们的第一个完全远程播客(我们都从自己的壁橱里录制自己的声音)很合适,是与从事音频技术工作的客人一起进行的。 我们采访了Android音频团队的工程师Phil Burk(我们在第39集中谈到了Android MIDI),以及开发人员关系团队的Don Turner谈到了音频延迟,尤其是关于Oboe 。 Oboe是本机(阅读:C ++)库,使开发人员可以更轻松地在Android上实现较低延迟的音频。

接着… (Now then…)

That’s it for this time. So check out some of the Android 11 features and APIs! Go get the latest AndroidX releases! Watch some screencasts and the latest videos on the Android Developers channel! Read some Android developer articles! Check out the latest ADB podcast episodes! And come back here soon for the next update from the Android developer universe.

这次就是这样。 因此,请查看一些Android 11功能和API! 去获取最新的AndroidX版本 ! 在Android Developers频道上观看一些截屏视频和最新视频! 阅读一些Android开发人员文章 ! 查看最新的亚行播客节目 ! 并很快返回此处,以获取Android开发人员环境的下一个更新。

翻译自: https://medium.com/androiddevelopers/now-in-android-15-44bf3307a8f2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值