●Build AI experiences
●Build AI-powered Android apps with Gemini APIs and more.
Get started
●Get started
●Start by creating your first app. Go deeper with our training courses or explore app development on your own.
Hello world
Training courses
Tutorials
Kotlin for Android
Monetization with Play ↗️
●Extend by device
●Build apps that give your users seamless experiences from phones to tablets, watches, and more.
Large screens (e.g., tablets)
Wear OS
Android for Cars
Android TV
ChromeOS
Cross-device SDK
●Build by category
●Learn to build for your use case by following Google's prescriptive and opinionated guidance.
Generative AI
Games
Camera & Media
Social & messaging
Health & Fitness
Enterprise apps
●Get the latest
●Stay in touch with the latest releases throughout the year, join our preview programs, and give us your feedback.
Platform releases
Android Studio preview
Jetpack & Compose libraries
Wear OS preview
Privacy Sandbox
Design & Plan
●Kits & more
●Get one of our Figma kits for Android, Material Design, or Wear OS, and start designing your app's UI today.
Go to Android & Material kits
Go to Wear OS kits
●UI Design
●Design a beautiful user interface using Android best practices.
Design for Android
Mobile
Large screens (e.g., tablets)
Widgets
Wear OS
Android TV
●Architecture
●Design robust, testable, and maintainable app logic and services.
Introduction
Libraries
Navigation
Modularization
Testing
●Quality
●Plan for app quality and align with Play store guidelines.
Overview
Core value
User experience
Technical quality
Privacy & security
●Build for Billions
●Create the best experience for entry-level devices
Overview
About new markets
Android (Go edition)
Develop
●Gemini in Android Studio
●Your AI development companion for Android development.
Learn more
Get Android Studio
●Core areas
●Get the samples and docs for the features you need.
Samples
Try Quick Guidesᵇᵉᵗᵃ
User interfaces
Permissions
Background work
Data and files
Identity
All core areas ⤵️
●Tools and workflow
●Use the IDE to write and build your app, or create your own pipeline.
Write and debug code
Build projects
Test your app
Performance
Command-line tools
Gradle plugin API
●Device tech
●Write code for form factors. Connect devices and share data.
Large screens (e.g., tablets)
Wear OS
Android Health
Cross-device SDK
Android for Cars
Android TV
ChromeOS
●Libraries
●Browse API reference documentation with all the details.
Android platform
Jetpack libraries
Compose libraries
Google Play services ↗️
Google Play SDK index ↗️
Google Play
Community
●
English
●
Deutsch
●
Español – América Latina
●
Français
●
Indonesia
●
Italiano
●
Polski
●
Português – Brasil
●
Tiếng Việt
●
Türkçe
●
العربيّة
●
中文 – 简体
●
中文 – 繁體
●
日本語
●
한국어
Sign in
●
Develop
●
Essentials
●
More
●
Design & Plan
●
More
●
Develop
●
More
●
Guides
●
Reference
●
Samples
●
Google Play
●
Community
●
Android Studio
●Developer guides
App basics
●Build your first app
●App fundamentals
App resources
●About app resources
●Handle configuration changes
Localization
●Localize your app
●Test your app with pseudolocales
●Unicode and internationalization support
●Language and locale resolution
●Per-app language preferences
●Complex XML resources
Resource types
●About resource types
●Animation
●Color state list
●Drawable
●Layout
●Menu
●String
●Style
●Font
●More types
App manifest file
●About app manifests
●<action>
●<activity>
●<activity-alias>
●<application>
●<category>
●<compatible-screens>
●<data>
●<grant-uri-permission>
●<instrumentation>
●<intent-filter>
●<layout>
●<manifest>
●<meta-data>
●<path-permission>
●<permission>
●<permission-group>
●<permission-tree>
●<profileable>
●<property>
●<provider>
●<queries>
●<receiver>
●<service>
●<supports-gl-texture>
●<supports-screens>
●<uses-configuration>
●<uses-feature>
●<uses-library>
●<uses-native-library>
●<uses-permission>
●<uses-permission-sdk-23>
●<uses-sdk>
Devices
Device compatibility
●About device compatibility
●About screen compatibility
●Device compatibility mode
●Support different pixel densities
Multiple APK support
●About multiple APKs
●Create multiple APKs for different API levels
●Create multiple APKs for different screen sizes
●Create multiple APKs for different GL textures
●Create multiple APKs with several dimensions
●Support different languages and cultures
●Support different platform versions
●Filters on Google Play
●64-bit Support
●Support 16 KB page sizes
Large screens — tablets, foldables, ChromeOS
●Get started with large screens
●Large screen canonical layouts
Large screen ready
●Overview
●Configuration and continuity
●Camera preview and media projection
●Multi-window support
●Input compatibility on large screens
Large screen optimized
●Overview
●UX
●Migrate your UI to responsive layouts
●Navigation for responsive UIs
●Activity embedding
Large screen differentiated
●Overview
●Learn about foldables
●Make your app fold aware
●Support foldable display modes
●Create a note-taking app
●Support advanced stylus features
●Large screen cookbook
Wear OS
●Get started
●Design Wear OS UI ⍈
●Principles of Wear OS development
●Wear OS versus mobile development
●Wear OS user interfaces
●Accessibility on Wear OS
Getting started
●Wear OS developer pathway
●Create and run an app
●Debug a Wear OS app
●Connect a watch to a phone
●Capture Wear UI screenshots
Apps
●About Wear OS apps
●Standalone apps
●Conserve power
●Authentication
●Request permissions
●Add a splash screen
●Detect location
●Playing audio on wearables
●Test Bluetooth audio on emulators
●Appear in recents and app resume
Building UI with Compose
●Use Jetpack Compose on Wear OS
●View design guidelines for UI components
●Develop for different screen sizes
●Compose performance
●Lists with Compose
●Rotary input on Compose
●Navigation with Compose for Wear OS
Building UI with Views
●Build View-based UIs on Wear OS
●Handle different watch shapes
●Create lists
●Navigation
●Exit full screen activities on Wear
●Show confirmations
●Keep your app visible on Wear
Tiles
●About tiles
●Get started with tiles
●Develop for different screen sizes
●Show periodic updates
●Show dynamic updates
●Animate tile elements
●Interact with tiles
●Migrate to ProtoLayout namespaces
Complications
●About complications
●Expose data to complications
Notifications
●Notifications on Wear OS
●Bridging options for notifications
●Ongoing Activities
Handling data
●Dynamic expressions
●Send and sync data on Wear OS
●Network access and sync on Wear OS
●Access the Wearable Data Layer
●Transfer data to a new mobile device
●Transfer assets
●Send and receive messages
●Handle data layer events
●Sync data items with the Data Layer API
●Use cloud backup and restore
User input
●Physical buttons
●Rotary input on Views
●Create input method editors in Wear
●Voice
●Read sensor data using Health Services
Creating watch faces
●About watch faces
Watch Face Format
●Overview
●Features
●Setup
●Weather data
●Optimize memory usage
●XML reference
Jetpack Watch Face APIs
●Design watch faces
●Build a watch face service
●Draw watch faces
●Adding complications to a watch face
●Creating interactive watch faces
●Provide configuration activities
●Address common issues
●Improve performance with hardware acceleration
●Optimize performance and battery life
●Self-tag watch faces
●Wear OS app quality
●Package Wear OS apps
●Distribute to Wear OS
●Create Wear OS apps for China
Releases
●Wear OS 5 Developer Preview ⍈
Wear OS 4
●Overview
●Prepare for behavior changes
●Update target SDK version
●Explore features
●Wear OS 3 migration guide
●Library release notes
Android TV
●In this guide
●Design TV UI ⍈
Getting started
●In this guide
●Create and run a TV app
●Handle TV hardware
●Manage TV controllers
●On-screen keyboard
●Create TV navigation
●Multitasking on TV
●Best practices for driving engagement on Google TV
Build TV playback apps
●In this guide
Building UI with Compose
●In this guide
●Create a catalog browser
●Build a details screen
Building UI with the Leanback UI toolkit (discouraged)
●In this guide
●Create a catalog browser
●Provide a card view
●Build a details view
●Use transport controls
●Introduce first-time users to your app
●Add a guided step
●Build TV layouts
●Migrate to Compose for TV
●Ambient mode
●Playback controls on TV
●Implement a media session
●Background playback in a Now Playing card
●Audio capabilities
●Match content frame rate
Help users find content on TV
●About finding TV content
Recommend TV content
●About recommending TV content
●Channels on the home screen
●Video program attributes
●Audio program attributes
●Game program attributes
Watch Next
●Add programs
●Attributes
●Guidelines for app developers
●Guidelines for TV providers
●Preview videos
●Recommendations in Android N and earlier
●Make TV apps searchable
●Search within TV Apps
Build TV games
●About TV games
Build TV input services
●About TV input services
●Develop a TV input service
●Work with channel data
●Manage TV user interaction
●Support time-shifting
●Support content recording
TV Accessibility
●Accessibility best practices
●TalkBack evaluation examples
●Support TalkBack in TV apps
●Adopt system caption settings
●Custom view accessibility support
●Custom view accessibility sample
●TV Apps checklist
●Distribute to Android TV
Releases
●Android 12 for TV
●Android 13 for TV
●Android 14 for TV
Android for Cars
●About Android for Cars
●What's new
●Car app quality
Build media apps for cars
●Build media apps for cars
●Add support for Android Auto
●Add support for Android Automotive OS
●Build messaging apps for Android Auto
Build point of interest, internet of things, and navigation apps for cars
●Using the Android for Cars App Library
●Build point of interest apps for cars
●Build internet of things apps for cars
●Build navigation apps for cars
●Get coarse location
●Add support for Android Auto
●Add support for Android Automotive OS
Build parked apps for Android Automotive OS
●About parked apps
●Build video apps
●Build games
●Build browsers
Test Android apps for cars
●Overview
●Test using the Desktop Head Unit
Test using the Android Automotive OS emulator
●Overview
●Test using the distant display emulator
●Test using the configurable emulator
●Test using Android Automotive OS on Pixel Tablet
●Car ready mobile apps
●Distribute Android apps for cars
●Google Play services for cars
●Notifications on Android Automotive OS
ChromeOS devices
●About ChromeOS
●Building apps for ChromeOS
●Optimizing Apps for ChromeOS
●Preparing your development environment
●App Manifest Compatibility for Chromebooks
●ChromeOS Device Support for Apps
●App Rendering Differences on Chromebooks
●Window management
●Adapting Games on ChromeOS
●Smooth animation on ChromeOS
●Test Cases for Android Apps on ChromeOS
Cross device SDK
●About the Cross device SDK
●Get started
●Device discovery API
●Secure connection API
●Sessions API
●Test and debug
●API Reference
●Google Assistant ⍈
Android (Go edition)
●About Android Go edition
●Develop for Android (Go edition)
●Test Android Go apps
Optimize for Android (Go edition)
●Approach
●Optimize app memory
●Improve startup latency
●Reduce app size
●Best practices
App architecture
●Introduction
Guide to app architecture
●About app architecture
UI layer
●About the UI layer
●UI events
●State holders and UI state
●State production
●Domain layer
Data layer
●About the data layer
●Offline first
●Architecture recommendations
●Learning pathway
Modularization
●About modularization
●Common patterns
Recipes
●Navigation
Architecture components
UI layer libraries
View binding
●About view binding
●Migrate from Kotlin synthetics to view binding
Data binding library
●About data binding
●Get started
●Layouts and binding expressions
●Work with observable data objects
●Generated binding classes
●Binding adapters
●Bind layout views to Architecture Components
●Two-way data binding
Lifecycle-aware components
Lifecycles
●Handle lifecycles
●Integrate with Compose
ViewModel
●About ViewModel
●Create ViewModels with dependencies
●ViewModel Scoping APIs
●Saved State module for ViewModel
●ViewModel APIs cheat sheet
●LiveData
●Save UI states
●Use Kotlin coroutines with lifecycle-aware components
Paging Library
●About paging
●Load and display paged data
●Page from network and database
●Transform data streams
●Manage and present loading states
●Test your Paging implementation
●Migrate to Paging 3
Paging 2
●About Paging 2
●Display paged lists
●Load paged data
Data layer libraries
●DataStore
WorkManager
●About WorkManager
●Getting Started
How-To Guides
●Defining your WorkRequests
●Work states
●Managing work
●Observing intermediate Worker progress
●Chaining work together
●Testing Worker implementation
●Integration tests with WorkManager
●Debugging WorkManager
Advanced Concepts
●Configuration and Initialization
Threading in WorkManager
●About threading in WorkManager
●Threading in Worker
●Threading in CoroutineWorker
●Threading in RxWorker
●Threading in ListenableWorker
●Support for long-running workers
●Migrating from Firebase JobDispatcher
●Migrating from GCMNetworkManager
App entry points
Activities
●Introduction to activities
●The activity lifecycle
●Activity state changes
●Test your app's activities
●Tasks and the back stack
●Processes and app lifecycle
●Parcelables and bundles
●Loaders
●Recents screen
●Restrictions on starting activities from the background
App shortcuts
●About app shortcuts
●Create shortcuts
●Add capabilities
●Manage shortcuts
●Best practices for shortcuts
App navigation
●Principles of navigation
Navigation component
●Overview
●Navigation controller
Design your navigation graph
●Overview
●Dialog destinations
●Activity destinations
●Nested graphs
●Deep links
●New destination types
●Type safety
●Encapsulate your code
●Global actions
●Build a graph programmatically using the Kotlin DSL
●Use the Navigation editor
Use your navigation graph
●Navigate to a destination
●Navigate with options
●Safe args
●Pass data between destinations
●Animate transitions between destinations
●Conditional navigation
●Interact programmatically with the Navigation component
The back stack
●Overview
●Dialogs and the back stack
●Circular navigation and the back stack
●Multiple back stacks
Integrations
●Navigate with feature modules
●Multi-module projects
●Connect UI components to NavController
●Migrate to the Navigation component
●Test Navigation
Custom back navigation
●Custom back navigation
●Predictive back gesture
●Add support for predictive back animations
Responsive design
●Handling configuration changes
●Design for different form factors
Swipe between views
●Swipe views using ViewPager2
●Swipe views using ViewPager
Fragments
●About fragments
●Create a fragment
●Fragment manager
●Fragment transactions
●Animate transitions between fragments
●Fragment lifecycle
●Saving state with fragments
●Communicate with fragments
●Working with the app bar
●Displaying dialogs with DialogFragment
●Debug your fragments
●Test your fragments
App links
●About app links
●Enabling links to app content
●Verify app links
●Create app links for instant apps
Interact with other apps
●About interacting with other apps
●About intents and intent filters
●About common intents
●Send users to another app
●Get a result from an activity
●Allow other apps to start your activity
●Limit loading in on-device Android containers
Package visibility
●About package visibility
●Know which packages are visible automatically
●Declare package visibility needs
●Fulfill common use cases
●Test package visibility
Dependency injection
●About dependency injection
●Manual dependency injection
●Dependency injection with Hilt
●Hilt in multi-module apps
●Use Hilt with other Jetpack libraries
●Hilt testing guide
●Hilt and Dagger annotations cheat sheet
Dagger
●Dagger basics
●Using Dagger in Android apps
●Using Dagger in multi-module apps
●App Startup
Google Play
●Google Play Billing ⍈
●Google Play Core libraries
Engage SDK
●Engage SDK Developer Preview
●About Engage SDK
●Engage SDK Watch integration guide
●Engage SDK Listen integration guide
●Engage SDK Read integration guide
●Engage SDK Shopping integration guide
●Engage SDK Food integration guide
●Engage SDK Social integration guide
●Engage SDK Travel integration guide
●Engage SDK Health & Fitness integration guide
●Engage SDK Dating integration guide
●Engage SDK Other Verticals integration guide
●Engage SDK integration workflow
●Engage SDK Cluster publishing guidelines
●Engage SDK Frequently asked questions
●Engage SDK Release Notes
●Engage SDK Sample Apps
Play Points
●About Play Points
●Create products and promotions
●Detect and deliver products
●Test products
Play Asset Delivery
●About Play Asset Delivery
●Integrate asset delivery (Kotlin and Java)
●Integrate asset delivery (native)
●Integrate asset delivery (Unity)
●Target texture compression formats
●Test asset delivery
Play Feature Delivery
●About Play Feature Delivery
●Configure install-time delivery
●Configure conditional delivery
●Configure on-demand delivery
●On-demand delivery best practices
●Configure instant delivery
●Additional resources
In-app reviews
●Overview
●Integrate using Kotlin or Java
●Integrate using native code
●Integrate using Unity
●Test in-app reviews
In-app updates
●About in-app updates
●Support in-app updates (Kotlin or Java)
●Support in-app updates (Native)
●Support in-app updates (Unity)
●Test in-app updates
Play as you Download
●About Play as you Download
●Best practices
Google Play Instant
●About Google Play Instant
Get started with instant apps
●Create an instant-enabled app bundle
●UX best practices for apps
Get started with instant games
●About instant games
●Unity plugin
●UX best practices for games
●Migrate to Android App Bundles
●Implement cloud delivery of assets
●Support Google Play Games Services
●Instant Play games
●Instant Play games checklist
●Reduce the size of your instant app or game
●Add ads to your instant app or game
●Provide multiple entry points
Integrate with Firebase
●Add Google Analytics for Firebase to your instant app
●Use Firebase Dynamic Links with instant apps
●Technical requirements checklist
●Google Play Instant policy
Resources
●Reference
●Code samples
●SDK release notes
●Instant App Intents
Support
●Known issues
●StackOverflow
●Play Developer APIs
Play Install Referrer
●Overview
Play Install Referrer Library
●Overview
●Reference ⍈
●Release notes
●Play Install Referrer API
●Play Integrity API ⍈
Play Requirements
●Play Policies ⍈
●Meet the target API level requirement
●Support 64-bit architectures ⍈
Application Licensing
●Overview
●Licensing Overview
●Setting Up for Licensing
●Adding Server-Side Verification
●Adding Client-Side Verification
●Licensing Reference
●APK Expansion Files
●App updates
Core areas
●User interfaces ⍈
●Audio & video ⍈
●Services ⍈
●Background tasks ⍈
●Alarms ⍈
Permissions
●About permissions
●Declare app permissions
Request app permissions
●Request runtime permissions
●Request special permissions
●Explain access to more sensitive information
●App permissions best practices
●Permissions used only in default handlers
●Restrict interactions with other apps
●Define custom permissions
App data and files
●About app data and files
●About storage
●Save to app-specific storage
Save to shared storage
●About shared storage
●Media
●Photo picker
●Documents and other files
●Datasets
●Manage all files on a storage device
●Save key-value data
Save data in a local database
●About the local database
●Define data using entities
●Access data using DAOs
●Define relationships between objects
●Write asynchronous DAO queries
●Create views into a database
●Prepopulate your database
●Migrate your database
●Test and debug your database
●Reference complex data
●Migrate from SQLite to Room
●Migrate to Room Kotlin Multiplatform
●Save data using SQLite
●Storage use cases and best practices
Sharing data
●About sharing data
●Sending simple data to other apps
●Receiving simple data from other apps
●Provide Direct Share targets
Sharing files
●About sharing files
●Setting up file sharing
●Sharing a file
●Requesting a shared file
●Retrieving file information
Printing files
●About printing
●Printing photos
●Printing HTML documents
●Printing custom documents
Content providers
●About content providers
●Content provider basics
●Creating a content provider
●Open files using storage access framework
●Create a custom document provider
●Create a cloud media provider
●App install location
User data and identity
●About user data
●Add sign-in workflow
Credential Manager
●Sign in your user
●Integrate with Sign in with Google
●Migrate from FIDO2
●Migrate from Smart Lock
●Migrate from legacy Google Sign-In
●Integrate with WebView
●Integrate with your credential provider solution
●Make calls on behalf of other parties for privileged apps
Autofill framework
●About autofill
●Optimize your app for autofill
●Build autofill services
●Integrate autofill with keyboards
●Show a biometric authentication dialog
●Identify developer-owned apps
●Get a user-resettable advertising ID
●About the calendar provider
Contacts provider
●About the contacts provider
●Retrieving a list of contacts
●Retrieving details for a contact
●Modifying contacts using intents
●Displaying the quick contact badge
●Account transfer
Data backup
●About backup
●Back up user data
●Back up key-value pairs
●Test backup and restore
●Best practices for unique identifiers
Remember and authenticate users
●About authentication
●Remember your user
●Authenticate to OAuth2 services
●Create a custom account type
●Add camera capabilities to your app ⍈
●User location ⍈
●Sensors ⍈
●Connectivity ⍈
Renderscript
●About Renderscript
●Advanced RenderScript
Migrate from RenderScript
●Overview
●Migrate scripts to OpenGL ES 3.1
●Migrate scripts to Vulkan
Runtime API reference
●About Runtime API
●Numerical types
●Object types
●Conversion functions
●Mathematical constants and functions
●Vector math functions
●Matrix functions
●Quaternion functions
●Atomic update functions
●Time functions and types
●Allocation data access functions
●Object characteristics functions
●Kernel invocation functions and types
●Input/output functions
●Debugging functions
●Graphics functions and types
●Index
Android app bundles
●About app bundles
●Configure the base module
●Build and test your app bundle
●Add code transparency
●About the app bundle format
●Frequently asked questions
Build for enterprise
●About enterprise apps
●Developer guide
●Work profiles
●Set up managed configurations
App feedback
●Send app feedback to EMMs
●Test app feedback
●Work contacts
●Device management policies
Device management
●Build a device policy controller
Dedicated devices
●Overview
●Lock task mode
●Multiple users
●Cookbook
●Device control
●Networking and telephony
●Security
●System updates
●Network activity logging
Android versions
●About the versions
●Android 14
●Android 13
●Android 12
●Android 11
●Android 10
●Android 9
●Android 8.0
●Android 7.0
●Device administration
Best practices
Testing
●Test apps on Android
Fundamentals
●Fundamentals of testing Android apps
●What to test in Android
●Using test doubles in Android
Local tests
●Build local tests
Instrumented tests
●Build instrumented tests
●Automate UI tests
AndroidX test libraries
●Set up project for AndroidX Test
●JUnit4 rules with AndroidX Test
●AndroidJUnitRunner
Continuous integration
●Basics
●Types of automation
●Common features
Espresso
●Espresso
●Espresso basics
●Espresso setup instructions
●Espresso cheat sheet
●Espresso idling resources
●Espresso-Intents
●Espresso lists
●Multiprocess Espresso
●Espresso recipes
●Espresso Web
●Accessibility checking
●Additional Resources for Espresso
Testing different screen sizes
●Overview
●Libraries and tools
Testing other components
●Test content providers
●Test your service
●Write automated tests with UI Automator
●Performance ⍈
●Accessibility ⍈
●Privacy ⍈
●Security ⍈
SDKs
●SDK best practices
●Games ⍈
●Health Connect ⍈
●Health Services on Wear OS ⍈
●
Build AI experiences
●
Get started
●
Get started
●
Hello world
●
Training courses
●
Tutorials
●
Kotlin for Android
●
Monetization with Play ↗️
●
Extend by device
●
Large screens (e.g., tablets)
●
Wear OS
●
Android for Cars
●
Android TV
●
ChromeOS
●
Cross-device SDK
●
Build by category
●
Generative AI
●
Games
●
Camera & Media
●
Social & messaging
●
Health & Fitness
●
Enterprise apps
●
Get the latest
●
Platform releases
●
Android Studio preview
●
Jetpack & Compose libraries
●
Wear OS preview
●
Privacy Sandbox
●
Kits & more
●
Go to Android & Material kits
●
Go to Wear OS kits
●
UI Design
●
Design for Android
●
Mobile
●
Large screens (e.g., tablets)
●
Widgets
●
Wear OS
●
Android TV
●
Architecture
●
Introduction
●
Libraries
●
Navigation
●
Modularization
●
Testing
●
Quality
●
Overview
●
Core value
●
User experience
●
Technical quality
●
Privacy & security
●
Build for Billions
●
Overview
●
About new markets
●
Android (Go edition)
●
Gemini in Android Studio
●
Learn more
●
Get Android Studio
●
Core areas
●
Samples
●
Try Quick Guidesᵇᵉᵗᵃ
●
User interfaces
●
Permissions
●
Background work
●
Data and files
●
Identity
●
All core areas ⤵️
●
Tools and workflow
●
Write and debug code
●
Build projects
●
Test your app
●
Performance
●
Command-line tools
●
Gradle plugin API
●
Device tech
●
Large screens (e.g., tablets)
●
Wear OS
●
Android Health
●
Cross-device SDK
●
Android for Cars
●
Android TV
●
ChromeOS
●
Libraries
●
Android platform
●
Jetpack libraries
●
Compose libraries
●
Google Play services ↗️
●
Google Play SDK index ↗️
●
Android Developers
Develop
Guides
Principles of navigation
Stay organized with collections
Save and categorize content based on your preferences.
Navigation between different screens and apps is a core part of the user
experience. The following principles set a baseline for a consistent and
intuitive user experience across apps. The
Navigation component is designed to
implement these principles by default, ensuring that users can apply the same
heuristics and patterns in navigation as they move between apps.
he Navigation component in your project, your
app should follow these design principles.
Fixed start destination
Every app you build has a fixed start destination. This is the first screen the
user sees when they launch your app from the launcher. This destination is also
the last screen the user sees when they return to the launcher after pressing
the Back button. Let’s take a look at the
Sunflower app
as an example.
Figure 1. The List Screen is the Sunflower app's start destination.
When launching the Sunflower app from the launcher, the first screen that a user
sees is the List Screen, the list of plants in their garden. This is also
the last screen they see before exiting the app. If they press the Back button
from the list screen, they navigate back to the launcher.
me setup or series of login screens. These
conditional screens
should not be considered start destinations because users see these screens only
in certain cases.
Navigation state is represented as a stack of destinations
When your app is first launched, a
new task
is created for the user, and app displays its start destination. This becomes
the base destination of what is known as the back stack and is the basis for
your app’s navigation state. The top of the stack is the current screen, and the
previous destinations in the stack represent the history of where you've been.
The back stack always has the start destination of the app at the bottom of the
stack.
Operations that change the back stack always operate on the top of the stack,
either by pushing a new destination onto the top of the stack or popping the
top-most destination off the stack. Navigating to a destination pushes that
destination on top of the stack.
The Navigation component manages
all of your back stack ordering for you, though you can also choose to manage
the back stack yourself.
Up and Back are identical within your app's task
Figure 2. The Up and Back buttons
The Back button appears in the system navigation bar at the bottom of the screen
and is used to navigate in reverse-chronological order through the history of
screens the user has recently worked with. When you press the Back button, the
current destination is popped off the top of the back stack, and you then
navigate to the previous destination.
The Up button appears in the app bar at the top of the
screen. Within your app's task, the Up and Back buttons behave identically.
If a user is at the app's start destination, then the Up button does not appear,
because the Up button never exits the app. The Back button, however, is shown
and does exit the app.
When your app is launched using a deep link
on another app's task, Up transitions users back to your app’s task and through
a simulated back stack and not to the app that triggered the deep
link. The Back button, however, does take you back to the other app.
Deep linking simulates manual navigation
Whether deep linking or manually navigating
to a specific destination, you can use the Up button to navigate through
destinations back to the start destination.
When deep linking to a destination within your app’s task, any existing back
stack for your app’s task is removed and replaced with the deep-linked back
stack.
Using the Sunflower app again as an example, let’s assume that the user had
previously launched the app from the launcher screen and navigated to the detail
screen for an apple. Looking at the Recents screen would indicate that a task exists with the top most screen being the detail screen for the Apple.
Figure 3. User navigation through the Sunflower app and the resulting back
stack.
At this point, the user can tap the Home button to put the app in the
background. Next, let’s say this app has a deep link feature that allows users
to launch directly into a specific plant detail screen by name. Opening the app
via this deep link completely replaces the current Sunflower back stack shown in
figure 3 with a new back stack, as shown in figure 4:
Figure 4. Following a deep link replaces the existing back stack for the
Sunflower app.
Notice that the Sunflower back stack is replaced by a synthetic back stack
with the avocado detail screen at the top. The My Garden screen, which is the
start destination, was also added to the back stack. The original Sunflower back
stack is gone, including the app's knowledge that the user was on the Apple
details screen before. All of this is important because the synthetic back stack
must be realistic. It should match a back stack that could have been achieved by
organically navigating through the app.
To meet this need, the synthetic back stack that is created is a simplified one
based on the NavGraph
. For a simple NavGraph
without nesting, this will
consist of the start destination and the deep link destination. For more
complex, nested navigation graphs,
the synthetic back stack will also contain the start destinations of any nested
graphs that are ancestors of the deep link destination.
The Navigation component
supports deep linking
and recreates a realistic back stack for you when linking to any destination in
your navigation graph.
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 2024-01-03 UTC.
[{
"type": "thumb-down",
"id": "missingTheInformationINeed",
"label":"Missing the information I need"
},{
"type": "thumb-down",
"id": "tooComplicatedTooManySteps",
"label":"Too complicated / too many steps"
},{
"type": "thumb-down",
"id": "outOfDate",
"label":"Out of date"
},{
"type": "thumb-down",
"id": "samplesCodeIssue",
"label":"Samples / code issue"
},{
"type": "thumb-down",
"id": "otherDown",
"label":"Other"
}]
[{
"type": "thumb-up",
"id": "easyToUnderstand",
"label":"Easy to understand"
},{
"type": "thumb-up",
"id": "solvedMyProblem",
"label":"Solved my problem"
},{
"type": "thumb-up",
"id": "otherUp",
"label":"Other"
}]
Follow @AndroidDev on X
Check out Android Developers on YouTube
Connect with the Android Developers community on LinkedIn
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
●
English
●
Deutsch
●
Español – América Latina
●
Français
●
Indonesia
●
Italiano
●
Polski
●
Português – Brasil
●
Tiếng Việt
●
Türkçe
●
العربيّة
●
中文 – 简体
●
中文 – 繁體
●
日本語
●
한국어