
Hello World! It’s awesome to have you here. In this month, i have been discussing best practices when building apps to support over 2 billion devices powered by Android. In my previous articles on best practices, I shared a whole lot of amazing tips on getting started. However, you can read Best Practice:Android Connectivity for Billions-Part 1 and Best Practice:Android Connectivity for Billions-Part 2 for all the tips.
In this article, you will learn how to target multiple screens of android devices across the world. Reaching new users means supporting an increasing variety of Android platform versions and device specifications. To improve the user experience, it’s ideal to optimize for common RAM configurations, and screen sizes and resolutions.

Oh!!! who built this shitty app?i can’t even find the login button.
A developer builds an app, the login button in the app layout shows properly during debugging, unfortunately it disappears on user’s phone after publishing on store. What went wrong? it’s simple! The app doesn’t support multiple screen sizes.
Support multiple screen sizes
Your app can provide a better user experience for billions of users if it supports screens of various sizes and resolutions. This section describes a few ways you can achieve this.
Use density-independent pixels (dp)
- Defining layouts with dp ensures that the physical size of your user interface is consistent regardless of device. please visit the Android guide on Supporting Multiple Screens for best practices on using density-independent pixels.
- To overcome this Android supports the density-independent pixel (dp), which corresponds to the physical size of a pixel at 160 dots per inch (mdpi density).
- Defining layout dimensions with pixels doesn’t work well because different screens have variation in pixel densities, so the same number of pixels may correspond to different physical sizes on different devices.
Test text and graphics on ldpi and mdpi screen densities
- Test to ensure that your text and graphics work well on low- and medium-density (ldpi and mdpi) screens because these are common densities, especially in lower-cost devices. Look out for text that may be unclear on lower-density screens, where fine details aren’t visible.
- Devices with lower-density screens tend to have lower hardware specifications. To ensure that your app performs well on these devices, consider reducing or eliminating heavy graphics processing loads, such as animations and transitions.
Test layouts on small and medium screen sizes
- Validate that your layouts scale down by testing on smaller screens. As screen sizes shrink, be very selective about visible UI elements, because there is limited space for them.
- The Material Design guidelines describe metrics and keylines to ensure that your layouts can scale across screen densities.
Provide backward compatibility
I have come to realise that not all of your users may be using devices powered by the latest, greatest version of the Android platform. Here are some ways you can improve backward compatibility, helping make your app available to as many people as possible.
Set your targetSdkVersion
and minSdkVersion
appropriately
targetSdkVersion
should be the latest version of Android. Targeting the most recent version ensures that your app inherits newer runtime behaviors when running newer versions of Android. Be sure to test your app on newer Android versions when updating thetargetSdkVersion
as it can affect app behavior.minSdkVersion
sets the minimum supported Android version. Use Android 4.0 (API level 14: Ice Cream Sandwich) or Android 4.1 (API level 16: Jelly Bean)—these versions give maximum coverage for modern devices. SettingminSdkVersion
also results in the Android build tools reporting incorrect use of new APIs that might not be available in older versions of the platform. By doing so, you are protected from inadvertently breaking backward compatibility.
Use the Android Support libraries
- Ensure your app provides a consistent experience across OS versions by using the Android Support Library. This library provides backward-compatible versions of Android framework APIs as well as features that are only available through the library APIs such as
AppCompatActivity
and the Material Design Support Library.
Some of the highlights include:
- v4 and v7 support library: Many framework APIs for older versions of Android such as
ViewPager
,ActionBar
,RecyclerView
, andPalette
. - Material Design support library: APIs to support adding Material Design components and patterns to your apps.
- Multidex support library: provides support for large apps that have more than 65K methods. This can happen if your app is using many libraries.
Optimize for devices running Android (Go edition)
Android (Go edition) is an optimized experience for entry-level devices with ≤1GB RAM, starting with Android Oreo (Go edition). To ensure your app runs great on Android (Go edition) devices, you should should take into account the following guidelines:
- targetSdkVersion should be the latest version of Android. Android (Go edition) devices only run Android Oreo (API 26 or higher).
- The app should run smoothly on devices with ≤1GB RAM. Keep in mind the memory optimizations listed in Use memory efficiently above and use Android vitals to identify and fix bad behaviors like slow rendering and frozen frames.
- The on-device app size should be smaller than 40MB
- The Proportional Set Size (PSS) of the app’s RAM usage should not exceed 50MB. For games, the PSS of the game’s RAM usage should not exceed 150MB. For more information about PSS, see the Investigating Your RAM Usage guide.
- The startup time of the app should be minimal and under 5 seconds.
Sometimes you can be overwhelmed by the whole functionalities you want to add to your app, relax, relax and relax!!! Take out time to solve the problem before writing your code. Place premium on best practices, this would save you a lot of problems in the long run.
Watch out for my next article on android best practice, it’s going to be fun right here!!
PS: Share your favourite android library and why you use it in the comment section.

No Comment! Be the first one.