Mẫu
ACTION_OPEN_DOCUMENT
This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.
- ContentResolver
- DocumentsContract
- PdfRenderer
- Bộ nhớ Android
- Bộ nhớ
- Kotlin
ACTION_OPEN_DOCUMENT_TREE
A proof of concept file manager utilizing the ACTION_OPEN_DOCUMENT_TREE intent introduced with Android 5.0, API level 21.
- ContentResolver
- DocumentsContract
- Bộ nhớ Android
- Bộ nhớ
- Kotlin
Architecture
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
- Lớp giao diện người dùng của kiến trúc Android
- Kiến trúc Android
- Thành phần điều hướng trong Jetpack Compose
- Quá trình tạo trạng thái của giao diện người dùng Android
- Kiểm thử Android
- Kiến trúc và trạng thái trong Jetpack Compose
- Sự kiện trên giao diện người dùng cho kiến trúc Android
- Phần tử giữ trạng thái của giao diện người dùng Android
- Lớp dữ liệu của kiến trúc Android
- Chức năng kiểm tra trong Jetpack Compose
- Kotlin
Architecture Components Advanced Navigation
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
- Kiến trúc
- Kiến trúc Android
- Kotlin
BiometricAuthentication Sample (Kotlin)
A sample that demonstrates to use registered fingerprints to authenticate the user in your app
- FingerprintManager
- AuthenticationCallback
- CryptoObject
- KeyGenParameterSpec
- KeyStore
- Cipher
- KeyGenerator
- Bảo mật
- Bảo mật và quyền riêng tư trên Android
- Kotlin
BiometricLogin Sample (Kotlin)
Sample for the Androidx Biometrics Library
- BiometricManager
- BiometricPrompt
- Bảo mật
- Bảo mật và quyền riêng tư trên Android
- Kotlin
Camera2Basic
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
- Máy ảnh và nội dung đa phương tiện trên Android
- Camera
- Kotlin
Camera2SlowMotion
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
- Máy ảnh và nội dung đa phương tiện trên Android
- Camera
- Kotlin
Camera2Video
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
- Máy ảnh và nội dung đa phương tiện trên Android
- Camera
- Kotlin
CardView Sample Sample (Kotlin)
This sample demonstrates how to use CardView introduced in the support library in Android 5.0.
- Thành phần hiển thị giao diện người dùng Android
- Kotlin
Data Binding Advanced
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
- Kiến trúc Android
- Kotlin
Data Binding Basic
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
- Kiến trúc Android
- Kotlin
DownloadableFonts Sample (Kotlin)
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
- Thành phần hiển thị giao diện người dùng Android
- Giao diện người dùng
- Kotlin
EmojiCompat Sample (Kotlin)
⚠️⚠️⚠️ 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
- Thành phần hiển thị giao diện người dùng Android
- Giao diện người dùng
- Kotlin
ImmersiveMode
"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
- Thành phần hiển thị giao diện người dùng Android
- Giao diện người dùng
- Kotlin
Instant Apps - Cookie API
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
- Xây dựng Android
- Kotlin
Instant Apps - Install API sample
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
- Xây dựng Android
- Kotlin
Instant Apps - Storage API sample
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
- Xây dựng Android
- Kotlin
Media Store
This sample demonstrates how to use Android's MediaStore to locate and display the users images in a RecyclerView.
- ContentResolver
- MediaStore
- Bộ nhớ Android
- Bộ nhớ
- Kotlin
PdfRendererBasic Sample (Kotlin)
This sample demonstrates how to display PDF document on screen using the PdfRenderer introduced in Android 5.0 Lollipop.
- PdfRenderer
- Đồ hoạ
- Đồ hoạ Android
- Kotlin
PictureInPicture Sample (Kotlin)
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
- Máy ảnh và nội dung đa phương tiện trên Android
- Nội dung đa phương tiện
- Kotlin
Platform
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
- Chức năng hỗ trợ tiếp cận trong Jetpack Compose
- Khả năng kết nối
- Camera
- Giao diện người dùng
- Quyền
- Kotlin
RecyclerView Sample (Kotlin)
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
- Thành phần hiển thị giao diện người dùng Android
- Kotlin
Video Player
This sample shows how to implement a media app that allows playback of video from local storage (assets folder in the APK) or remote sources over HTTP(S). It supports playlists, so that multiple videos can be strung together to play one after the
- MediaSessionCompat
- PictureInPictureParams
- SimpleExoPlayer
- PlayerView
- Nội dung đa phương tiện
- Máy ảnh và nội dung đa phương tiện trên Android
- Kotlin
AAOS Car Gear Viewer (Kotlin)
Demonstrates connecting to the Car API and listening for gear change events. Works on Android P (API 28) and above. Introduction This app allows a user to see the current gear on the main infotainment screen (IVI). The app connects to the Car API and
- car
- Car
- CarPropertyManager
- Thiết bị Android
- Kotlin
Architecture starter template (multi-module)
This template is compatible with the latest stable version of Android Studio.
- Lớp giao diện người dùng của kiến trúc Android
- Lớp dữ liệu của kiến trúc Android
- Kiểm thử Android
- Kiến trúc Android
- Kotlin
Architecture starter template (single module)
This template is compatible with the latest stable version of Android Studio.
- Lớp giao diện người dùng của kiến trúc Android
- Lớp dữ liệu của kiến trúc Android
- Kiểm thử Android
- Kiến trúc Android
- Kotlin
Awareness API sample (Snapshot API)
Demonstrates use of the Awareness APIs to intelligently react to the current situation of the user. Introduction The Awareness API exposes five different context types, which include user activity, and nearby beacons. These types enable your app to
- DetectedActivityResponse
- ActivityRecognitionResult
- Cảm biến
- Kotlin
Basic sample (in Kotlin) for writing unit tests that mocks the Android framework
If you are new to unit testing on Android, try this sample first. This project uses the Gradle build system and the Android gradle plugin support for unit testing. You can either benefit from IDEs integration such as Android studio or run the tests
- Kiến trúc Android
- Kotlin
Compose for Wear OS Starter
Demonstrates a simple "Hello, World" starter project for using Compose with Wear OS.
- setContent
- background
- Arrangement
- Column
- fillMaxSize
- fillMaxWidth
- Composable
- Modifier
- stringResource
- TextAlign
- Preview
- ExperimentalWearMaterialApi
- MaterialTheme
- Text
- Thiết bị đeo Android
- Kotlin
Google Generative AI Sample for Android (Kotlin)
This Android sample app demonstrates how to use state-of-the-art generative AI models (like Gemini) to build AI-powered features and applications. To try out this sample app, you need to use latest stable version of Android Studio. However, if you
- Composable
- Bố cục Jetpack Compose
- Kotlin
Jetcaster sample 🎙️
Jetcaster is a sample podcast app, built with Jetpack Compose. The goal of the sample is to showcase building with Compose across multiple form factors (mobile, TV, and Wear) and full featured architecture. To try out this sample app, use the latest
- Composable
- Lớp giao diện người dùng của kiến trúc Android
- Hệ thống thiết kế trong Jetpack Compose
- Ảnh động Jetpack Compose
- Compose cho Android
- Kotlin
Jetchat sample
Jetchat is a sample chat app built with Jetpack Compose. To try out this sample app, use the latest stable version of Android Studio. You can clone this repository or import the project from Android Studio following the steps here. This sample
- Composable
- Lớp giao diện người dùng của kiến trúc Android
- Văn bản trong Jetpack Compose
- Quá trình tạo trạng thái của giao diện người dùng Android
- Hệ thống thiết kế trong Jetpack Compose
- Kiến trúc và trạng thái trong Jetpack Compose
- Ảnh động Jetpack Compose
- Sự kiện trên giao diện người dùng cho kiến trúc Android
- Compose cho Android
- Chức năng kiểm tra trong Jetpack Compose
- Kotlin
JetLagged sample
JetLagged is a sample sleep tracking app built with Jetpack Compose. To try out this sample app, use the latest stable version of Android Studio. You can clone this repository or import the project from Android Studio following the steps
- Composable
- Bố cục Jetpack Compose
- Ảnh động Jetpack Compose
- Đồ hoạ Jetpack Compose
- Kotlin
Jetnews sample
Jetnews is a sample news reading app, built with Jetpack Compose. The goal of the sample is to showcase the current UI capabilities of Compose. To try out this sample app, use the latest stable version of Android Studio. You can clone this repository
- Composable
- Lớp giao diện người dùng của kiến trúc Android
- Thành phần điều hướng trong Jetpack Compose
- Quá trình tạo trạng thái của giao diện người dùng Android
- Hệ thống thiết kế trong Jetpack Compose
- Bố cục Jetpack Compose
- Kiến trúc và trạng thái trong Jetpack Compose
- Compose cho Android
- Chức năng kiểm tra trong Jetpack Compose
- Kotlin
Jetsnack sample
Jetsnack is a sample snack ordering app built with Jetpack Compose. To try out this sample app, use the latest stable version of Android Studio. You can clone this repository or import the project from Android Studio following the steps here. This
- Composable
- Hệ thống thiết kế trong Jetpack Compose
- Bố cục Jetpack Compose
- Ảnh động Jetpack Compose
- Compose cho Android
- Kotlin
Location Updates in the Background (Kotlin)
Demonstrates retrieving location updates in the background. Introduction This app allows a user to receive location updates in the background via a PendingIntent. If you are just interested in seeing the code that subscribes to a location request,
- FusedLocationProviderClient
- LocationRequest
- LocationServices
- Cảm biến
- Kotlin
Now in Android App
Learn how this app was designed and built in the design case study, architecture learning journey and modularization learning journey. This is the repository for the Now in Android app. It is a work in progress 🚧. Now in Android is a fully functional
- Kiến trúc và trạng thái trong Jetpack Compose
- Lớp miền của kiến trúc Android
- Chức năng hỗ trợ tiếp cận trong Jetpack Compose
- Lớp dữ liệu của kiến trúc Android
- Lớp giao diện người dùng của kiến trúc Android
- Ảnh động Jetpack Compose
- Chức năng kiểm tra trong Jetpack Compose
- Quá trình tạo trạng thái của giao diện người dùng Android
- Kiến trúc Android
- Thành phần điều hướng trong Jetpack Compose
- Phần tử giữ trạng thái của giao diện người dùng Android
- Kiểm thử Android
- Hệ thống thiết kế trong Jetpack Compose
- Kotlin
Room & RxJava (Kotlin)
This is an API sample to showcase how to use Room, with RxJava's Flowable objects in Kotlin.
- Kiến trúc
- Kiến trúc Android
- Kotlin
Subscribe and Recognize to the User's Sleep Activity
Demonstrates use of the Sleep API to recognize a user's sleep activity. Introduction Demonstrates use of the Sleep API to recognize a user's current sleep activity. Users can request activity updates by pressing the "Subscribe to Sleep Data" button,
- SleepSegmentEvent
- SleepClassifyEvent
- SleepSegmentRequest
- ActivityRecognition
- Cảm biến
- Kotlin
TensorFlow Lite in Play Services image classification Android example application
This example performs real-time image classification on live camera frames. It demonstrates loading a model using Tensorflow Lite in Google Play Services and using it to classify the camera feed. It performs the following operations: Initializes
- TfLite
- Kotlin
- Java
Trackr Android App
Note: Trackr uses version 7 of Gradle, which currently requires Android Studio Beta or Canary. Trackr is a sample task management app used to explore common UI patterns from the perspective of supporting accessibility. Trackr is currently under
- ViewCompat
- AccessibilityManager
- Kotlin
ViewPager2 samples
This sample shows how to use ViewPager2 with either Views or Fragments as pages, how to perform page transformations, how to link ViewPager2 to a TabLayout, and demonstrates handling modifications of an underlying page adapter collection. ViewPager2
- FragmentStateAdapter
- FragmentViewHolder
- StatefulAdapter
- ViewPager2
- Thành phần hiển thị giao diện người dùng Android
- Kotlin
Warning: This sample is currently outdated and you should reference the Java version instead.
Android AutofillFramework Sample (Kotlin) This sample demonstrates the use of the Autofill Framework. It includes implementations of client Activities with views that should be autofilled, and a Service that can provide autofill data to client
- View
- AutoFillService
- AutoFillManager
- Thành phần hiển thị giao diện người dùng Android
- Kotlin
WatchFace Sample (Kotlin)
Demonstrates watch faces using the androidX libraries (Kotlin). [!IMPORTANT] As of July 10, 2024, watch faces must use the Watch Face Format (sample) in order to be installed on new watches that launch with Wear OS 5 pre-installed. Learn more about
- WatchFace
- WatchFaceService
- WatchFaceType
- WatchState
- ComplicationSlotsManager
- CanvasComplicationDrawable
- ComplicationDrawable
- CurrentUserStyleRepository
- UserStyle
- UserStyleSetting
- WatchFaceLayer
- Thiết bị đeo Android
- Kotlin
Wear Tiles
Tiles provide easy access to the information and actions users need in order to get things done. With a simple swipe from the watch face, a user can find out the latest forecast or start a timer. This repository contains a sample tile built using the
- TileProviderService
- Thiết bị đeo Android
- Kotlin