Best practices for Android (Go edition) development
Stay organized with collections
Save and categorize content based on your preferences.
Follow these best practices and answers to common questions when starting to
develop or optimize your app for Android (Go edition).
- Don't add any excessive permissions to your app.
- Minimize app activity when in the background and when the
device is running on low power.
- Avoid using wake locks because they prevent the device from going into
low-power states.
- Batch network activity to reduce the number of wakeups. You can use
WorkManager to schedule tasks
and let the system batch operations.
- Validate that your layouts scale down by testing on smaller screens.
- Methods such as
isLowRamDevice()
and getMemoryClass()
help determine memory constraints at runtime. Using this information, you
can scale down your memory use. For example, you can use lower resolution
images on low memory devices.
- Allow your app to be installed to external storage using the
android:installLocation
flag in your AndroidManifest.xml
file.
- If you're looking to build for a larger-scaled audience, take a look at the
Build for billions
documentation.
Optimize for Go or start fresh
Many developers looking to launch apps on Android Go may wonder if they should
optimize their existing app or develop an entirely new one. This choice depends
on many factors, including how many development resources you have, whether or
not you can keep features in your app that are optimized for these devices,
and what type of distribution scenarios you want to enable for end-users around
the world.
- One app for all
- Use the same app for Android (Go edition) devices and all other devices with
an identical experience. In this case, you are optimizing your existing app to
run well on these devices, and your existing users gain performance benefits
from those optimizations. We highly encourage you to use the
Android App Bundle to experience significant size savings
without having to refactor your code.
- Two apps
- Create a new “light” 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.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2023-05-09 UTC.
[null,null,["Last updated 2023-05-09 UTC."],[],[],null,["# Best practices for Android (Go edition) development\n\nFollow these best practices and answers to common questions when starting to\ndevelop or optimize your app for Android (Go edition).\n\n- Don't add any excessive permissions to your app.\n- Minimize app activity when in the background and when the device is running on low power.\n- Avoid using wake locks because they prevent the device from going into low-power states.\n- Batch network activity to reduce the number of wakeups. You can use [WorkManager](/topic/libraries/architecture/workmanager) to schedule tasks and let the system batch operations.\n- Validate that your layouts scale down by testing on smaller screens.\n- Methods such as [`isLowRamDevice()`](/reference/android/app/ActivityManager#isLowRamDevice()) and [`getMemoryClass()`](/reference/android/app/ActivityManager#getMemoryClass()) help determine memory constraints at runtime. Using this information, you can scale down your memory use. For example, you can use lower resolution images on low memory devices.\n- Allow your app to be installed to external storage using the [`android:installLocation`](/guide/topics/manifest/manifest-element#install) flag in your `AndroidManifest.xml` file.\n- If you're looking to build for a larger-scaled audience, take a look at the [Build for billions](/topic/billions) documentation.\n\nOptimize for Go or start fresh\n------------------------------\n\nMany developers looking to launch apps on Android Go may wonder if they should\noptimize their existing app or develop an entirely new one. This choice depends\non many factors, including how many development resources you have, whether or\nnot you can keep features in your app that are optimized for these devices,\nand what type of distribution scenarios you want to enable for end-users around\nthe world.\n\nOne app for all\n: Use the same app for Android (Go edition) devices and all other devices with\n an identical experience. In this case, you are optimizing your existing app to\n run well on these devices, and your existing users gain performance benefits\n from those optimizations. We highly encourage you to use the\n [Android App Bundle](/guide/app-bundle) to experience significant size savings\n without having to refactor your code.\n\nTwo apps\n: Create a new \"light\" app and target Android (Go edition) devices.\n You can leave your existing app as is. The \"lite\" app can still target all\n devices in all locales as there is no requirement for this \"lite\" app to only\n target Android (Go edition) devices."]]