Introducing Android Instant Apps SDK 1.1

Jichao Li, Software Engineer; Shobana Ravi, Software Engineer

Since our

public

at Google I/O, we’ve been working hard to improve the developer

experience of building instant apps. Today, we’re excited to announce

availability of the Android Instant Apps SDK 1.1 with some highly-requested

features such as improved NDK support, configuration APKs for binary size

reduction, and a new API to maintain user’s context when they transition from an

instant app to the installed app.

Introducing configuration APKs

For a great instant app experience, app binaries need to be lean and well

structured. That’s why we’re introducing configuration APKs.

Configuration APKs allow developers to isolate device-specific resources and

native libraries into independent APKs. For an application that uses

configuration APKs, the Android Instant Apps framework will only load the

resources and native libraries relevant to the user’s device, thereby reducing

the total size of the instant app on the device.

We currently support configuration APKs for display density, CPU architecture

(ABI), and language. With these, we have seen an average reduction of 10% in the

size of the binaries loaded. Actual savings for a given app depend on the number

of resource files and native libraries that can be configured.

As an example, a user on an ARM device with LDPI screen density and language set

to Chinese would then receive device-agnostic code and resources, and then only

get the configuration APKs that have ARM native libraries, the Chinese language,

and LDPI resources. They would not receive any of the other configuration APKs

such as the x86 libraries, Spanish language strings, or HDPI resources.

Setting up configuration APKs for your app is a simple change to your gradle

setup. Just follow the steps in our

public

documentation

.

Persistent user context after installation

On Android Oreo, the internal storage of the instant version of the app is

directly available to the installed version of the app. With this release of the

SDK, we are enabling this functionality on older versions of the Android

Framework, including Lollipop, Marshmallow, and Nougat devices.

To extract the internal storage of the instant app, installed apps can now call

InstantAppsClient.getInstantAppData()

using the Instant Apps Google Play Services API and get a ZIP file of the

instant app’s internal storage.

Check out our code sample and

documentation

for more details on how to use this API.

Start building your Android Instant App

It’s simple to start building your instant app on the latest SDK. Just open the

SDK Manager in Android Studio and update your Instant Apps Development SDK to

1.1.0. We can’t wait to see what instant app experiences you build with these

new features.

Source: Introducing Android Instant Apps SDK 1.1

除非特别声明,此文章内容采用 知识共享署名 3.0 许可,代码示例采用 Apache 2.0 许可。更多细节请查看我们的 服务条款

谷歌开发者社区稿源:谷歌开发者社区 (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 移动开发 » Introducing Android Instant Apps SDK 1.1

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录