Tuyển tập mã mẫu và mẫu để bạn sử dụng nhằm tăng tốc độ phát triển ứng dụng. Hãy duyệt qua các mẫu để tìm hiểu cách xây dựng các thành phần cho ứng dụng của bạn.

Lọc theo

Ngôn ngữ
Chủ đề

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
Trung cấp

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
Trung cấp

This sample shows how to use scene transitions from one Activity to another in Lollipop. Uses a combination of changeImageTransform and changeBounds to transition a grid of images to an Activity with a large image and detail text.

  • Transition
  • ActivityOptions
  • Thành phần hiển thị giao diện người dùng Android
  • Java
Trung cấp
  • app
  • localstorage
  • Kotlin
Trung cấp

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
Trung cấp

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
Trung cấp

This sample showcases the following Architecture Components: Room ViewModels LiveData

  • Kiến trúc
  • Kiến trúc Android
  • Java
Nâng cao

This sample showcases the following Architecture Components: Paging Room ViewModels LiveData

  • Kiến trúc
  • Kiến trúc Android
  • Java
Nâng cao

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 Activities.

  • View
  • AutoFillService
  • AutoFillManager
  • Thành phần hiển thị giao diện người dùng Android
  • Java
Nâng cao

This sample detects gestures on a view and logs them. In order to try this sample out, try dragging or tapping the text.

  • GestureDetector
  • MotionEvent
  • Thành phần hiển thị giao diện người dùng Android
  • Java
Trung cấp

This sample shows how to use the MediaCoder to decode a video, use a TimeAnimator to sync the rendering commands with the system display frame rendering and finally render it to a TextureView.

  • MediaCodec
  • MediaExtractor
  • TimeAnimator
  • Nội dung đa phương tiện
  • Máy ảnh và nội dung đa phương tiện trên Android
  • Java
Nâng cao

This sample demonstrates the use of the MediaRouter API to display content on a secondary display. Use the "Media Route Action Item" in the ActionBar to select an output device. If your device supports Miracast wireless displays, you may need to

  • Máy ảnh và nội dung đa phương tiện trên Android
  • Nội dung đa phương tiện
  • Java

Sample demonstrates the use of MotionEvent properties to keep track of individual touches across multiple touch events.

  • MotionEvent
  • Thành phần hiển thị giao diện người dùng Android
  • Java
Trung cấp

This sample demonstrates using RenderScript to perform basic image manipulation. Specifically, it allows users to dynamically adjust the saturation for an image using a slider. A custom RenderScript kernel performs the saturation adjustment, running

  • RenderScript
  • Allocation
  • Android NDK và Trò chơi
  • Java
Chuyên gia

A basic app showing how to use the Transition framework introduced in KitKat. The app shows radioboxes to select between different Scenes, and uses various ways to transition between them.

  • TransitionManager
  • Transition
  • Scene
  • Thành phần hiển thị giao diện người dùng Android
  • Java
Nâng cao

Sample demonstrating how to set up SensorEventListeners for step detectors and step counters.

  • Sensor
  • SensorEvent
  • SensorEventListener
  • SensorManager
  • Cảm biến
  • Java
Nâng cao

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
Trung cấp

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
Trung cấp

Sample demonstrating how to advertise small amounts of data using the Bluetooth Low Energy API. Also demonstrates how to scan for those Advertisements. (requires 2 devices to see full operation)

  • BluetoothLeAdvertiser
  • BluetoothLeScanner
  • Khả năng kết nối Android
  • Khả năng kết nối
  • Java
Nâng cao

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
Trung cấp

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
Trung cấp

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
Trung cấp

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
  • Java

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
Nổi bật
Now in Android là một ứng dụng Android có đầy đủ chức năng được xây dựng bằng Kotlin và Jetpack Compose. Ứng dụng này mô hình hoá các phương pháp hay nhất về thiết kế và phát triển Android, đồng thời được thiết kế để trở thành tài liệu tham khảo hữu ích cho các nhà phát triển.