English  

Deutsch  

Español  América Latina  

Français  

Indonesia  

Italiano  

Polski  

Português  Brasil  

Tiếng Việt  

Türkçe  

Русский  

עברית  

العربيّة  

فارسی  

ि  

 

 

    

    

 

 

Android Studio    









Devices  


Compatibility  



















Essentials  

More  



Design & Plan  

More  



Develop  

More  



Google Play  

More  



Community  

Android Studio  





All devices 

Device compatibility  

About device compatibility

About screen compatibility

Device compatibility mode

Support different pixel densities

Multiple APK support 

Support different languages and cultures

Support different platform versions

Filters on Google Play 

64-bit Support

Support 16 KB page sizes
 


Build AI experiences  

Get started  

Get started  

Hello world  

Training courses  

Tutorials  

Compose for teams  

Kotlin for Android  

Monetization with Play   

Android Developer Verification  

Extend by device  

Adaptive apps  

Android XR  

Wear OS  

Android for Cars  

Android TV  

ChromeOS  

Build by category  

Games  

Camera & media  

Social & messaging  

Health & fitness  

Productivity  

Enterprise apps  

Get the latest  

Latest updates  

Experimental updates  

Android Studio preview  

Jetpack & Compose libraries  

Wear OS releases  

Privacy Sandbox   



Excellent Experiences  

Learn more  

UI Design  

Design for Android  

Mobile  

Adaptive UI  

XR Headsets & XR Glasses  

AI Glasses  

Widgets  

Wear OS  

Android TV  

Android for Cars  

Architecture  

Introduction  

Libraries  

Navigation  

Modularization  

Testing  

Kotlin Multiplatform  

Quality  

Overview  

Core value  

User experience  

Accessibility  

Technical quality  

Excellent Experiences  

Security  

Overview  

Privacy  

Permissions  

Identity  

Fraud prevention  



Gemini in Android Studio  

Learn more  

Get Android Studio  

Core areas  

Samples  

User interfaces  

Background work  

Data and files  

Connectivity  

All core areas   

Tools and workflow  

Write and debug code  

Build projects  

Test your app  

Performance  

Command-line tools  

Gradle plugin API  

Device tech  

Adaptive UI  

Wear OS  

Android XR  

Android Health  

Android for Cars  

Android TV  

All devices   

Libraries  

Android platform  

Jetpack libraries  

Compose libraries  

Google Play services   

Google Play SDK index   



Play Console  

Go to Play Console  

Learn more   

Fundamentals  

Play Monetization  

Play Integrity  

Play Policies  

Play Programs   

Games Dev Center  

Overview  

Play Asset Delivery  

Play Games Services  

Play Games on PC  

All Play guides   

Libraries  

Play Feature Delivery  

Play In-app Updates  

Play In-app Reviews  

Play Install Referrer  

Google Play services   

Google Play SDK index   

All Play libraries   

Tools & resources  

Android App Bundles  

Brand & marketing  

Play Console APIs   









Android Developers  


Develop  


Devices  


Compatibility  

Screen compatibility overvieway organized with collections   Save and categorize content based on your preferences.  




Android runs on a variety of devices that have different screen sizes and pixel densities. The system performs basic scaling and resizing to adapt your user interface to different screens, but there are ways to help your UI adapt better to each screen type.

Figure 1. Android runs on different devices that have different screens and pixel densities.


This page provides an overview of the features available on Android to help your app adapt accordingly. For more specific instructions about how to build your app for different screen variations, see the following documentation:


Support different screen sizes

Support different pixel densities

Screen sizes


The screen size is the visible space for your app UI. The screen size, as it's recognized by your app, isn't the actual size of the device screen. Apps must take into account the screen orientation, system decorationssuch as the navigation barand window configuration changes, such as when the user enables multi-window mode.

Flexible layouts


By default, Android resizes your app layout to fit the current screen. To help your layout resize well for small variations in screen size, implement your layout with flexibility in mind. Don't hardcode the position and size of your UI components. Instead, let view sizes stretch and specify view positions relative to the parent view or other sibling views so that your intended order and relative sizes remain the same as the layout grows.

To learn more about flexible layouts, see Responsive design.

Alternative layouts


A flexible layout is important, but you also need to design different layouts that optimize the user experience for the available space on different devices. Android lets you provide alternative layout files that the system applies at runtime based on the current device's screen size.

Figure 2. The same app uses a different layout for different screen sizes.


To learn how to create alternative layouts, see Adaptive design.

Stretchable images


Because your layout needs to stretch to fit the current screen, so do the bitmaps that you attach to any of the layout views. However, stretching an ordinary bitmap in arbitrary directions can result in strange scaling artifacts and skewed images.

To solve this, Android supports nine-patch bitmaps, in which you specify small pixel regions that are stretchable, while the rest of the image remains unscaled.

To learn more about nine-patch bitmaps, see NinePatch drawables.

Pixel densities


The pixel density is the number of pixels within a physical area of the screen. It is referred to as dpi (dots per inch). This is different from the screen resolution, which is the total number of pixels on a screen.

Figure 3. An exaggerated representation of two devices that are the same size but have different pixel densities.

Density independence


Your app achieves "density independence" when it preserves the physical sizefrom the user's point of viewof your UI design when displayed on screens with different pixel densities, as shown in figure 3. Maintaining density independence is important, because without it, a UI element like a button might appear larger on a low-density screen and smaller on a high-density screen.

Android helps you achieve density independence by providing the density-independent pixel (dp or dip) as a unit of measurement that you use instead of pixels (px).

To learn more about density independent pixels, see Use density-independent pixels.

Alternate bitmaps


To make your images look their best on all screens, provide alternate bitmaps to match each screen density. If your app provides bitmaps only for lower-density screens, Android scales them up when on a high-density screen so that the images occupy the same physical space on the screen. This can cause visible scaling artifacts in bitmaps. So, your app must include alternate bitmaps at a higher resolution.

To learn how to provide alternate bitmaps, see Provide alternative bitmaps.

Vector graphics


For simple types of images, like icons, you can avoid creating separate images for each density by using vector graphics. Because vector graphics define the illustration with geometric line paths instead of pixels, they can be drawn at any size without scaling artifacts.

To learn more about using vector graphics, see Prefer vector graphics.

Wear OS, TV, Cars, and ChromeOS


The preceding recommendations apply to all Android form factors, but if you want to build an app for Wear OS, Android TV, Android Auto, Android Automotive OS, or ChromeOS devices, you need to do more work.

Each of these device types has its own user interaction model that your app must accommodate. In some cases, such as for Wear OS, you need to rethink your app's user experience and build an app that's specialized for that device. On the other hand, to support ChromeOS devices, such as the Google Pixelbook, you might need only slight modifications to your existing app to support keyboard or mouse interaction and a larger screen.

To support these devices, refer to the following documentation:


Build Wear OS apps

Build TV apps

Android for Cars overview

Apps for ChromeOS overview

Foldables


Foldable devices typically have multiple displays, with different displaysor combinations of displaysbecoming active for different states of the device folding. Follow the guidelines in this document to make your app adapt to those changing configurations. However, some configurations can have unusual aspect ratios, so test how your app behaves on a variety of devices.

Figure 4. Folding and unfolding.


Usually, an app that works well in multi-window mode for various window sizes also behaves well on foldable devices.

To learn more about building apps for foldables, see Learn about foldables.
 


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 2025-04-17 UTC.
 



X X
Follow @AndroidDev on X
 

YouTube YouTube  
Check out Android Developers on YouTube
 

LinkedIn LinkedIn  
Connect with the Android Developers community on LinkedIn
 





Android  

Android for Enterprise  

Security  

Source  

News  

Blog  

Podcasts  





Gaming  

Machine Learning  

Health & Fitness  

Camera & Media  

Privacy  

5G  





Large screens  

Wear OS  

ChromeOS devices  

Android for cars  

Android TV  





Android 15  

Android 14  

Android 13  

Android 12  

Android 11  

Android 10  

Pie  





Android Studio guide  

Developers guides  

API reference  

Download Studio  

Android NDK  





Report platform bug  

Report documentation bug  

Google Play support  

Join research studies  






Android  

Chrome  

Firebase  

Google Cloud Platform  

All products  



Privacy  

License  

Brand guidelines  



Get news and tips by email   Subscribe  



English  

Deutsch  

Español  América Latina  

Français  

Indonesia  

Italiano  

Polski  

Português  Brasil  

Tiếng Việt  

Türkçe  

Русский  

עברית  

العربيّة  

فارسی  

ि