Google I/O 2019 takeaways Chapter II: Build & Release
We talked about the Testing related takeaways from this year’s I/O event in the previous blog. We ended with a promise to follow up with Build and Release related announcements, and here we are. We try to portray a succinct summary of these talks in this chapter. Let’s see them topic by topic :
Customisable delivery and easy sharing of test builds
A plethora of new features were announced with respect to app bundles :
In-app updates: 2 flavours for in-app updates were announced. Immediate and Flexible. With Immediate, the user is given a notification for a new update and on acceptance, Google Play manages the UX and the flow. With Flexible, once the user accepts for the update, the control is returned back to the application and Play notifies the application on update completion. The app has full control over the flow.
Conditional delivery: With this, the developer can specify the conditions under which a feature would be delivered as part of app installation and which feature would be left out. You can set conditional delivery for modules based on 3 factors — Geolocation (country), minSDKVersion and device feature (eg: VR headset support)
On-Demand delivery: You can now install or remove modules on demand. For example, you can now remove the on-boarding flow once the user has been on-boarded to the application. Vice-versa, you can install the on-boarding module if the need be.
Asset delivery for games: Introduction of asset packs. Now you can create multiple asset packs and choose to ship only certain assets with your game. This allows to reduce the size of your app and provide assets on a need basis.
Internal App Sharing : Now you can share app bundles with your test/dev team directly. With Internal App sharing, you can upload your app bundle to Play, which would then generate a shareable link that can be propagated across the team. With this link, you can install the app on your device and perform testing. This test bundle is served and hosted by Play and is not a part of the release track. The uploader doesn’t have to be a Play console member. The app is signed with a test certificate. A unique version isn’t required. You can give your custom version.
Apart from the new features mentioned above, a few other enhancements to Google Play have been made.
In addition to efficiency and modularity, the Android App Bundle also now offers increased security with the launch of app signing key upgrade for new installs. With this feature, you can upgrade the cryptographic strength of your signing key for new installs and their updates on Google Play. Many developers sign their apps with keys generated a long time ago, and this new feature is the only backwards-compatible way to increase their strength.
Core Metrics Refresh: To better understand your churn, including data on returning users, automatic change analysis, metric benchmarking.
Change in average rating calculation: More weight would be given to most recent ratings. This would be available by August.
Auto-suggest for replies to reviews: This is an extension from Gmail’s auto-suggestions.
Features to help your business grow
There would be custom listing by install state under 3 categories — Not installed, Uninstalled, Currently installed. You can target custom messages according to these categories.
Additionally, there will be custom listing pages for Pre-registration and Pre-registration rewards, which let you incentivise players for signing up for notifications prior to the launch.
Early access to a ‘Subscribe and Install’ feature.
Tools to optimise app size and boost installs
Improved uninstall wizard: Smart suggestions based on app size and usage will be provided.
Optimised installs: Play has now reduced new installs size by 10% and up-to 85% for app updates.
Optimised native library (coming soon): Game engines are common among app games. So a base common native library would be provided on which your app specific assets can be added thus reducing apk size.
Peer-to-peer transfers: Quite a few apks get shared via P2P applications among users. However, apk shared over P2P is not authenticated by the play store. New Play API announced which these P2P app developers can integrate. With this, the compatibility for apk shared would be checked.
Data at no cost (coming soon): Ongoing tie-ups with mobile operators to provide access to PlayStore without any data cost incurred.
Update in existing bundle tool: Now you can measure apk download size and the actual size on the device post install by a customisable statistics page in Play console.
Devices with low free storage (coming soon): Metrics for uninstalls on devices due to low free storage. Also, analysis of devices with low storage on which your app is currently installed.
Analysis of app size over time.App size breakdown by its contents.
Suggestions for optimisations for app bundles.
Improving app performance by benchmarking
Jetpack Benchmark Library was introduced. This is our personal favourite. It is currently in alpha stage. It measures code performance and is integrated with Android Studio. It supports Kotlin as well as Java. With Studio 3.5, you can create benchmark modules in your project.
There’s a Gradle plugin for the same. The plugin helps you to pull benchmark reports when you run gradlew. Along with that, there are some Gradle tasks added for CPU clock stability. The test runner has some baked-in tricks to stabilise benchmarks.
There is addition for proguard rules as well. The template supplies pre-configured proguard rules. The idea is to mimic production behaviour and that’s why they bundle these rules along. Keeping that in mind, they are providing detailed logs with apt warnings. Say you run in debug mode. This defeats the purpose of benchmarking as it is expected to work slow in debug mode. Hence the flashy warning in logs which running benchmarking.
The benchmarking module is written to account for ramp-up period as well. In short, benchmark spins loop for minimum 250ms and starts measuring only once the performance of the app stabilises.
The module also has an API to lower the max CPU clock to prevent CPU throttling to prevent inconsistencies due to device OS functioning.
You can watch the complete talk on how to get started with your first benchmark test.
Improving build time execution with Gradle
There were a couple of talks on how to improve your android builds with Gradle. I recommend you to watch the talks for deeper understanding. Here, let’s see the highlights of the talks.
R classes will directly be compiled to class file now. The intermediate Java file will not be generated.
Workers: New API called workers introduced. It allows for safe, parallel and asynchronous execution. You can get the detailed working here.
Faster artifact transform APIs: It is used for dexing and enables caching of pre-dexed libraries.
Lazy task configuration: It helps you to configure only the required tasks at build time.
Incremental Annotations processing: Implementation of the ability to have incremental compilation even when there is annotation processor on class pass. This is supported for Kotlin as well.
Improvement in sync inside studio: Dependency resolution is only done once after you load the project in studio.
Apply changes: This enables you to make small edits and deploy while keeping your app in state. It no longer modifies your apk during builds.
Improved build output window: UI and Parser has been improved to better highlight the cause of your failure.
Build speed attribution (coming soon): The idea is to provide clear information about Gradle plugins and tasks causing the build to slow down.
Well, this is it. We have tried to cover all test and release related talks. The summary just paints a brief picture and we recommend that you check out each of these talks individually for deeper analysis. You can check out our previous blog to see the Test related announcements.
Despite our best efforts, we might have missed out on some points here and there(the chances of that happening is 1 in 14,000,605). If we did hit that possibility AND you happen to notice it (that would indeed be the mother of all possibilities), let us know in the comments below and we would include the same in the blog.