A selection of code samples and templates for you to use to accelerate your app development. Browse samples to learn how to build different components for your applications.

Filter By

Language
Topic

This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.

  • ContentResolver
  • DocumentsContract
  • PdfRenderer
  • Android Storage
  • Storage
  • Kotlin
Intermediate

A proof of concept file manager utilizing the ACTION_OPEN_DOCUMENT_TREE intent introduced with Android 5.0, API level 21.

  • ContentResolver
  • DocumentsContract
  • Android Storage
  • Storage
  • Kotlin
Intermediate
  • app
  • localstorage
  • Kotlin
Intermediate

These samples showcase different architectural approaches to developing Android apps. In its different branches you'll find the same app (a TODO app) implemented with small differences. In this branch you'll find: User Interface built with Jetpack

  • Android Architecture UI Layer
  • Android Architecture
  • Jetpack Compose Navigation
  • Android UI state production
  • Android Testing
  • Jetpack Compose Architecture and State
  • Android Architecture UI Events
  • Android UI state holders
  • Android Architecture Data Layer
  • Jetpack Compose Testing
  • Kotlin
Intermediate

Features This sample showcases the behavior of a bottom navigation view following the Principles of Navigation. Fixed start destination Navigation state should be represented via a stack of destinations The Up button never exits your app Up and Back

  • Architecture
  • Android Architecture
  • Kotlin
Intermediate

A sample that demonstrates to use registered fingerprints to authenticate the user in your app

  • FingerprintManager
  • AuthenticationCallback
  • CryptoObject
  • KeyGenParameterSpec
  • KeyStore
  • Cipher
  • KeyGenerator
  • Security
  • Android Security and Privacy
  • Kotlin
Intermediate

Sample for the Androidx Biometrics Library

  • BiometricManager
  • BiometricPrompt
  • Security
  • Android Security and Privacy
  • Kotlin
Intermediate

This sample demonstrates using the Camera2 API to capture a JPEG, DEPTH or RAW frame. Check the source code to see a simple example of how to display the camera preview and capture a still image using the default configuration with the selected pixel

  • DngCreator
  • Android Camera & Media
  • Camera
  • Kotlin
Intermediate

This sample captures high-speed video via the Camera2 API including displaying a camera preview and capturing a high-speed (slow motion) video using repeating burst capture requests.

  • camera2
  • CameraConstrainedHighSpeedCaptureSession
  • Android Camera & Media
  • Camera
  • Kotlin
Intermediate

This sample captures video record via the Camera2 API including displaying a camera preview and capturing a high-speed (slow motion) video using repeating capture requests.

  • camera2
  • MediaRecorder
  • Android Camera & Media
  • Camera
  • Kotlin
Intermediate

This sample demonstrates how to use CardView introduced in the support library in Android 5.0.

  • Android UI Views
  • Kotlin

This sample showcases the following features of the Data Binding library with an app that shows a workout timer. Two-way Data Binding Alternatives to Two-way Data Binding Binding adapters with multiple parameters Animations with Binding

  • Android Architecture
  • Kotlin
Intermediate

This sample showcases the following features of the Data Binding library: Layout variables and expressions Observability through Observable Fields, LiveData and Observable classes Binding Adapters, Binding Methods and Binding Converters Seamless

  • Android Architecture
  • Kotlin
Intermediate

This sample demonstrates how to use the Downloadable Fonts feature introduced in Android O. Downloadable Fonts is a feature that allows apps to request a certain font from a provider instead of bundling it or downloading it themselves. This means,

  • FontRequest
  • FontRequest
  • FontsContractCompat
  • FontsContractCompat
  • Android UI Views
  • User Interface
  • Kotlin
Intermediate

⚠️⚠️⚠️ Caution: the androidx.emoji:emoji library is deprecated in favor of androidx.emoji2:emoji2, which provides integration into androidx.appcompat. To support modern emoji and simplify backward-compatibility with lower versions of Android, it's

  • EmojiCompat
  • BundledEmojiCompatConfig
  • FontRequestEmojiCompatConfig
  • FontRequest
  • EmojiAppCompatTextView
  • EmojiAppCompatEditText
  • EmojiAppCompatButton
  • EmojiTextViewHelper
  • Android UI Views
  • User Interface
  • Kotlin
Intermediate

"Immersive mode" is intended for apps in which users will be heavily interacting with the screen. With this API, apps can hide the status bar, the navigation bar, or both. When users need to bring back the system bars, they swipe from any edge where

  • Android UI Views
  • User Interface
  • Kotlin

This sample app demonstrates how to use the Cookie API. It contains storage and retrieval of values using both, the Android Framework API and the InstantApps Play Services API. Usage This API is available to both, the Instant App as well as the

  • Android Building
  • Kotlin
Advanced

This sample app demonstrates how to use the Install API. The API triggers Intent to install the app on device. The call also accepts Intent, which is triggered after the installation is complete. If an app wants to utilize this API, it needs an

  • Android Building
  • Kotlin
Advanced

This sample app demonstrates how to use the Storage API. It is relevant to devices running on Android versions lower than API level 26. On devices running on API level 26 or higher, the Android framework takes care of migrating user data from instant

  • Android Building
  • Kotlin
Advanced

This sample demonstrates how to use Android's MediaStore to locate and display the users images in a RecyclerView.

  • ContentResolver
  • MediaStore
  • Android Storage
  • Storage
  • Kotlin
Intermediate

This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.

  • PdfRenderer
  • Graphics
  • Android Graphics
  • Kotlin
Beginner

This sample demonstrates basic usage of Picture-in-Picture mode for handheld devices. The sample plays a video. The video keeps on playing when the app is turned in to Picture-in-Picture mode. On Picture-in-Picture screen, the app shows an action

  • PictureInPictureParams
  • RemoteAction
  • PendingIntent
  • MediaSessionCompat
  • Android Camera & Media
  • Media
  • Kotlin
Advanced

This repository contains a collection of samples that demonstrate the use of different Android OS platform APIs. The samples are organized into folders by topic, and each folder contains a README file that provides more information about the samples

  • Jetpack Compose Accessibility
  • Connectivity
  • Camera
  • User Interface
  • Permissions
  • Kotlin
Intermediate

This application implements a RecyclerView in Kotlin with ListAdapter, onClickListener and Headers. If you are looking for a simpler sample, look at the RecyclerViewSimple sample in the directory.

  • RecyclerView
  • LayoutManager
  • ViewHolder
  • Android UI Views
  • Kotlin
Intermediate
Featured
Now in Android is a fully functional Android app built with Kotlin and Jetpack Compose. It models Android design and development best practices and was designed to be a useful reference for developers.