How to optimize your app for Android (Go edition)

Insights to help you create apps which work on Android phones around the world

Raj Ajrawat
May 29, 2018 · 12 min read

Understanding the opportunity

As discussed during our Google I/O session, Android (Go edition) is designed to improve the experiences on entry-level devices (devices with <1GB of RAM). Users around the world have struggled with battery issues, a lack of storage on device, data constraints and poor processor speeds, which created churn and dissatisfaction with their phones. While Google has done a lot of work to optimize our apps, like Search, the Assistant, Maps and YouTube, it is also important that app and game developers ensure their offerings work well on these devices, so that users have a premium experience at an entry-level price point.

To optimize, or to start fresh? Choose your app strategy

  • One app, different APKs. Use the same app for Android (Go edition) devices and all other devices, but different experiences. Create different APKs; one APK to target the new android.hardware.ram.low dimension vs APK(s) targeting all other devices.
  • Two apps. Create a new “lite” app and target Android (Go edition) devices. You can leave your existing app as is. The “lite” app can still target all devices in all locales as there is no requirement for this “lite” app to only target Android (Go edition) devices.

Tips for optimizing your app

  1. Targeting Android Oreo
  2. Keeping your installed size below 40MB for apps, and 65MB for games
  3. Keeping PSS under 50MB for apps, and 150MB for games
  4. Keeping your app or game’s cold start time under 5 seconds

Make sure your app functions without ANRs and crashes

Studies have shown that ANR (application not responding) errors and crashes can have a significant negative effect on user retention and can lead to high uninstall rates. While some of the consumers buying Android (Go edition) phones will be buying their first smartphone, they will expect a zippy, clean, and efficient experience that doesn’t freeze up their phone. Android vitals in the Google Play Console, allows you to track ANRs and crashes, as well as dive deep on bugs that are affecting certain users or types of devices. The tool has been indispensable for many of our developers in identifying, triaging and fixing issues that come up with their apps.

  • The app is doing a long calculation on the main thread.
  • The main thread is doing a synchronous binder call to another process, and that other process is taking a long time to return.
  • The main thread is blocked waiting for a synchronized block for a long operation that is happening on another thread.
  • The main thread is in a deadlock with another thread, either in your process or via a binder call. The main thread is not just waiting for a long operation to finish, but is in a deadlock situation. For more information, see Deadlock.

Target Android Oreo

Android Oreo (target API 26) includes a lot of resource optimizations such as Background Execution Limits, which ensures that processes run properly in the background while keeping the phone operating smoothly. Many of these features were specifically designed to improve battery life and overall phone performance, and are key to ensuring that those using these devices will have a great experience with your app. I highly recommend you read through the migration guide put together by Google Play if your app or game is still not targeting API 26 or above. In particular, pay close attention to background execution limits and notification channels. Remember that there have been security updates announced: new apps published to the Play Console will need to target at least API 26 (Android 8.0) or higher by August 1, 2018, while updates to existing/published apps will need to do so by November 1, 2018. To comply with these requirements, you’ll need to target Oreo as soon as possible.

Keep installed size small

  • Replace PNG/JPG files (if any) with WebP assets. With lossy WebP compression, nearly identical images can be produced with significantly smaller file sizes. For vector graphics, use SVGs. For more details, check out Connectivity for billions: Optimize images and this overview of WebP.
  • Replace raw audio formats (e.g. WAV) with MP3 or AAC for all audio resources. The loss in any sound quality should be imperceptible to most users, and will still deliver a quality playback/audio listening experience with less resources.
  • Ensure the libraries used are up-to-date and are necessary. Consider removing duplicated libraries and update deprecated libraries. Also, when available, please use mobile optimized libraries instead of server optimized libraries. To learn more, check out ClassyShark.
  • Keep DEX within reason. The dex code can take up significant space in the APK. Consider further optimizing the code to reduce the APK size. Learn more about minifying code and check out relevant details in our Building for Billions guidelines.

Keep your memory footprint light

  1. In terminal, run the command adb shell dumpsys meminfo <> -d (Where <> is the pkg_id of the app being tested e.g. com.tinder)
  2. Record the value in the row Total, for the column PssTotal (this value is reported in KB -> convert to MB by dividing by 1000)
  3. Repeat steps 2 & 3 multiple (at least 5) times and average the PssTotal (KB) value

Keep your cold startup time under 5 seconds

Perception is key here. In user testing and studies, people become frustrated after 5 seconds of waiting for an app or game to load, which leads to abandonment and uninstall. You should treat this as your window to make sure you capture a user and don’t give them an opportunity to abandon your app after they have installed your app on their phone. We always measure cold startup time as the time it takes for your app to be fully interactive to the user. It’s best to run tests for cold startup time after doing a full reboot of your test device.

What do you think?

Do you have thoughts on how to develop for global markets and optimize your app strategy? Let us know in the comments below or tweet using #AskPlayDev and we’ll reply from @GooglePlayDev, where we regularly share news and tips on how to be successful on Google Play.

Google Play Apps & Games

Tips, trends, and industry thoughts for app and game developers building businesses on Google Play.

Raj Ajrawat

Written by

Product Specialist for the Android Platform @Google. NYC and MD native. NYU, NOLS & $JPM Alum. Design, travel, startups. Always finding, always learning.

Google Play Apps & Games

Tips, trends, and industry thoughts for app and game developers building businesses on Google Play.