小任班长 发布的文章

谷歌今天正式发布了Android 10正式版,并首先面向Pixel系列设备推送。

79070-x6shz46ozjr.png

新的Android 10操作系统对隐私保护和控制功能有了更深入的改进,对整体性能、电池续航时间、安全性、隐私、位置数据等各方面都做出了更大改进。

除了引入新的手势导航系统,Android 10系统还拥有诸多新的重要功能,包括更严格的权限和隐私控制,一种可禁用分散注意力应用程序的“焦点模式”(Focus Mode),更简单的通知控制,更好的集成家庭控制,以及一个新的黑暗主题。

97192-inwehtq7a9.png

诸如安全更新“Project Mainline”对大多数用户来说并不可见。这一重要更新将允许谷歌直接通过应用商店发布关键的安全补丁,无需再等待手机制造商和运营商发布。但此前已经从Android 9 Pie升级到Android 10的手机并不支持“Project Mainline”。

官方地址:

https://code.opensource.huaweicloud.com/HarmonyOS/OpenArkCompiler/readme

OpenArkCompiler 四个技术特点

能够将不同语言代码编译成一套可执行文件,在运行环境中高效执行:

  • 支持多语言联合优化、消除跨语言调用开销;
  • 更轻量的语言运行时;
  • 软硬协同充分发挥硬件能效;
  • 支持多样化的终端设备平台

79613-midval1qe6c.png

官方介绍

https://www.openarkcompiler.cn/home

方舟编译器架构示意图

49940-vkgl226s70e.png

开发者指南

https://code.opensource.huaweicloud.com/HarmonyOS/OpenArkCompiler/file?ref=master&path=doc%2FDeveloper_Guide.md

今年的 I/O 应用大幅修改了现有功能并添加了若干新特性。在这篇文章中,我们将着重围绕其中几项主要变更进行说明。

Google I/O 2019

https://play.google.com/store/apps/details?id=com.google.samples.apps.iosched
源代码
https://github.com/google/iosched

21195-0aha70wauoag.png

手势导航

Android Q 引入了完全手势导航选项,允许用户通过手势动作返回上一级界面和主屏。为了支持手势导航支持,应用开发者需要做到以下两点:

将应用内容扩展到屏幕边缘
处理存在冲突的应用手势

Google I/O 2019 应用是首批完全支持手势导航的应用之一。更多内容,请阅读《手势导航: 实现边到边的全屏体验》系列连载,或请前往 Github 查看团队在 Google I/O 应用库中提交的相关代码,了解如何将应用内容扩展到屏幕边缘。

 深色主题背景

Android Q 引入的另一项新特性是系统深色主题背景,它既可全局应用于 Android 系统界面,也可应用于设备上运行的应用。对于开发者而言,深色主题背景具备诸多优势,其中包括: 降低电耗;改善弱视以及对强光敏感的用户的可视性等。

 日程界面优化

在 2018 年,大会日程的 UI 设计采用了标签界面,一个标签代表一个会议日,用户可通过竖屏滑动来查看不同的日程安排。今年的 I/O 应用更改了原先的 UI 设计,从而解决了若干可用性及性能问题。以 UI 流畅性为例,应用在日程表 UI 出现后就同时渲染所有标签内的 view,造成严重的 UI 卡顿问题,且延迟现象在低端设备上尤为明显。

新的日程 UI 采用单流开发,允许应用仅渲染可视内容,用户只需触击 UI 顶部的日期选项便可跳转至相应页面,并查看当天的议程安排。如果您想了解我们对日程表 UI 作出了哪些更改,请前往 Github 查看相关代码 (将日程显示为单个列表,显示日期标识)。

导航组件

我们利用导航组件把今年的 I/O 应用简化为一个单 Activity 应用,这种方法具备下述优点:
开发者可以在导航编辑器中一眼看到所有界面过渡,大幅简化了不同界面的启动活动。
移除了向上/返回导航操作的样板代码
使用 Safe Args Gradle 插件在各个 Fragment 之间传递静态类型的参数

导航组件
https://developer.android.google.cn/guide/navigation

使用 Room 实现全文搜索

我们为今年的大会应用添加了一个搜索功能,方便用户快速查找有关演讲、讲师和 codelab 的信息。在实现过程中,我们使用了 Room Jectpack 组件中的全文搜索特性。一旦从服务器获取最新的大会数据,我们就会对 Room 表格内的有关数据进行更新,每个 Room 表格都有对应的 FTS 映射表格。当用户在搜索框中输入要查找的内容后,检索项便会被用于查询演讲名称等数据。查询结果将立即显示在屏幕上,因此,如果搜索字段发生任何字符更改,服务器会马上返回更新后的结果。接着,用户便可以点击某个词条,导航至对应页面并获取详细内容。如果您对全文搜索有兴趣,欢迎查看我们的代码 (使用 Room 添加搜索功能,在搜索结果中包含分享人信息,在搜索结果中包含 codelab 信息,添加 Room 迁移路径)。

除了以上关键变更以外,我们还对许多细节部分进行了优化与改进。比如说,我们添加了新的主屏 UI 和 Codelab UI,前者允许应用在大会期间向用户显示与时间相关的信息,后者则提供了更多 I/O 大会上与 codelab 有关的内容以及详细的参与方法。

Huawei EMUI officially issued an article saying that the Ark compiler is ready for open source, "August 31 show you the code!"

On April 11 this year, Huawei's consumer business CEO Yu Chengdong announced that Huawei officially released the Huawei Ark compiler. This compiler can improve the compilation efficiency of Android applications, from the original interpretation and execution to the full-process machine code efficient running program.

95277-y8qanirhbf.png

Huawei's Ark compiler as a new Android application compiler can significantly improve the speed of mobile phones. According to Huawei's official data, the Ark compiler can improve system fluency by 24%, improve system response by 44%, and improve 60% of the three-party application operation fluency.

 
According to Huawei's official introduction, the Ark compiler is the first static compiler to completely replace the language virtual machine, and does not require an interpreter at all. A compiler that takes into account Java development efficiency and C language runtime efficiency. Compared to the existing compilation mechanism:

  1. The Ark compiler is a static compilation method. In the existing Android system, running an application first starts the virtual machine, then reads the application code and interprets the execution one by one. It will occupy more processing resources and affect the efficiency of program execution. Of course, there are also early or runtime compilation techniques, such as AOT or JIT, that convert some of the programs into machine code and execute them directly on the CPU. However, it is still not possible to do 100% to get rid of virtual machine execution, which is the key to the current Android camp is not as good as the IOS camp.
  2. The static compilation mode of Huawei Ark compiler can directly translate the dynamic features in the language into machine code. After the application is installed, the mobile phone can run the program at full speed, completely eliminating the drawbacks of the virtual machine and bringing about great improvement in efficiency.

 
3, the Ark compiler is a compiler deployed in the development environment, and the existing compilation process, mainly occurs on the mobile phone, bringing additional resource consumption.

adress:

https://code.opensource.huaweicloud.com/home

OpenArkCompiler adress

https://code.opensource.huaweicloud.com/HarmonyOS/OpenArkCompiler/home

免责声明
本博客部分内容来自于互联网,不代表作者的观点和立场,如若侵犯到您的权益,请联系[email protected]。我们会在24小时内进行删除。