Android Developers
Có thể bạn quan tâm
Essentials - 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
- Compose for teams
- Kotlin for Android
- Monetization with Play ↗️
- Android Developer Verification
- Extend by device
- Build apps that give your users seamless experiences from phones to tablets, watches, headsets, and more.
- Adaptive apps
- Android XR
- Wear OS
- Android for Cars
- Android TV
- ChromeOS
- Build by category
- Learn to build for your use case by following Google's prescriptive and opinionated guidance.
- Games
- Camera & media
- Social & messaging
- Health & fitness
- Productivity
- Enterprise apps
- Get the latest
- Stay in touch with the latest releases throughout the year, join our preview programs, and give us your feedback.
- Latest updates
- Experimental updates
- Android Studio preview
- Jetpack & Compose libraries
- Wear OS releases
- Privacy Sandbox ↗️
- Excellent Experiences
- Build the best experiences for your best users.
- Learn more
- UI Design
- Design a beautiful user interface using Android best practices.
- Design for Android
- Mobile
- Adaptive UI
- XR Headsets & XR Glasses
- AI Glasses
- Widgets
- Wear OS
- Android TV
- Android for Cars
- Architecture
- Design robust, testable, and maintainable app logic and services.
- Introduction
- Libraries
- Navigation
- Modularization
- Testing
- Kotlin Multiplatform
- Quality
- Plan for app quality and align with Play store guidelines.
- Overview
- Core value
- User experience
- Accessibility
- Technical quality
- Excellent Experiences
- Security
- Safeguard users against threats and ensure a secure Android experience.
- Overview
- Privacy
- Permissions
- Identity
- Fraud prevention
- 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
- User interfaces
- Background work
- Data and files
- Connectivity
- 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.
- Adaptive UI
- Wear OS
- Android XR
- Android Health
- Android for Cars
- Android TV
- All devices ⤵️
- Libraries
- Browse API reference documentation with all the details.
- Android platform
- Jetpack libraries
- Compose libraries
- Google Play services ↗️
- Google Play SDK index ↗️
- Play Console
- Publish your app or game and grow your business on Google Play.
- Go to Play Console
- Learn more ↗️
- Fundamentals
- Learn how to engage users, monitize, and secure your app.
- Play Monetization
- Play Integrity
- Play Policies
- Play Programs ↗️
- Games Dev Center
- Develop and deliver games. Get tools, downloads, and samples.
- Overview
- Play Asset Delivery
- Play Games Services
- Play Games on PC
- All Play guides ⤵️
- Libraries
- Browse API reference documentation with all the details.
- 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
- Tools for publishing, promoting, and managing your app.
- Android App Bundles
- Brand & marketing
- Play Console APIs ↗️
- English
- Deutsch
- Español – América Latina
- Français
- Indonesia
- Italiano
- Polski
- Português – Brasil
- Tiếng Việt
- Türkçe
- Русский
- עברית
- العربيّة
- فارسی
- हिंदी
- বাংলা
- ภาษาไทย
- 中文 – 简体
- 中文 – 繁體
- 日本語
- 한국어
- App architecture
- Essentials
- Xem thêm
- Design & Plan
- Xem thêm
- Develop
- Xem thêm
- Google Play
- Xem thêm
- Community
- Android Studio
- Introduction
- Guide to app architecture
- About app architecture
- Architecture recommendations
- Learning pathway ⍈
- App fundamentals
- UI layer libraries
- About the UI layer
- UI events
- State holders and UI state
- State production
- 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
- Lifecycles
- 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
- Domain layer
- Data layer libraries
- About the data layer
- Offline first
- DataStore
- WorkManager ⍈
- App startup
- Modularization
- About modularization
- Common patterns
- 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>
- <attribution>
- <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>
- <uri-relative-filter-group>
- <uses-configuration>
- <uses-feature>
- <uses-library>
- <uses-native-library>
- <uses-permission>
- <uses-permission-sdk-23>
- <uses-sdk>
- 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
- Add app shortcuts ⍈
- Activities
- 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
- Fragments and 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
- Navigation 3
- Overview
- Get started
- Understand and implement the basics
- Save and manage navigation state
- Modularize navigation code
- Create custom layouts using Scenes
- Animate between destinations
- Apply logic or wrappers to destinations
- Migrate from Navigation 2
- 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
- Deep links
- About deep links
- Create deep links
- Implement App Links
- About App Links
- Add intent filters
- Configure website associations
- Verify App Links
- Test App Links
- Troubleshoot
- App Links FAQ
- Developer tools
- Interact with other apps
- About interacting with other apps
- About intents and intent filters
- About common intents
- Google Maps intents for Android
- 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
- 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
- Design & Plan
- App architecture
Có 2 cách để hệ thống nhận biết được broadcast receiver. Một là khai báo trong tệp kê khai bằng phần tử này. Hai là tạo receiver một cách linh động ở dạng mã và đăng ký bằng phương thức Context.registerReceiver() hoặc một trong các phiên bản quá tải.
Để biết thêm thông tin về cách tạo receiver một cách linh động, hãy xem phần mô tả của lớp BroadcastReceiver.
Nếu receiver này xử lý các tin không phải do hệ thống truyền ra, hãy chỉ định một giá trị cho android:exported. Đặt giá trị này thành "true" nếu bạn muốn receiver nhận tin từ các ứng dụng khác hoặc là "false" nếu bạn chỉ muốn receiver nhận tin từ chính ứng dụng của bạn.
Bạn không cần xoá thuộc tính android:permission nếu đã khai báo thuộc tính này.
Cảnh báo: Hãy giới hạn số lượng broadcast receiver bạn đặt trong ứng dụng của mình. Việc có quá nhiều broadcast receiver có thể ảnh hưởng đến hiệu suất của ứng dụng cũng như thời lượng pin của thiết bị của người dùng. Để biết thêm thông tin về API mà bạn có thể sử dụng thay cho lớp BroadcastReceiver nhằm lập lịch biểu cho công việc ở chế độ nền, hãy xem bài viết Tối ưu hoá ở chế độ nền.
thuộc tính: android:directBootAwareLiệu broadcast receiver có nhận biết được quá trình Khởi động trực tiếp (Direct-Boot) hay không, tức là broadcast receiver có thể chạy trước khi người dùng mở khoá thiết bị không.
Lưu ý: Trong quá trình Khởi động trực tiếp, broadcast receiver trong ứng dụng của bạn chỉ có thể truy cập dữ liệu được lưu trữ trong bộ nhớ được bảo vệ của thiết bị.
Giá trị mặc định là "false".
android:enabled Liệu hệ thống có thể tạo thực thể cho broadcast receiver này hay không. Giá trị này sẽ là "true" nếu hệ thống có thể và là "false" nếu hệ thống không thể. Giá trị mặc định là "true".Phần tử <application> có thuộc tính enabled riêng áp dụng cho tất cả thành phần của ứng dụng, bao gồm cả broadcast receiver. Cả hai thuộc tính <application> và <receiver> phải là "true" thì mới có thể bật broadcast receiver. Nếu là "false", broadcast receiver sẽ bị tắt và không thể tạo thực thể.
android:exported Liệu broadcast receiver có thể nhận thông báo từ các nguồn không phải hệ thống ở bên ngoài ứng dụng hay không. Giá trị này sẽ là "true" nếu có thể và "false" nếu không thể. Nếu là "false", thì thông báo duy nhất mà broadcast receiver nhận được là các thông báo do hệ thống, các thành phần của cùng một ứng dụng hoặc các ứng dụng có cùng mã nhận dạng người dùng gửi.Nếu không chỉ định, thì giá trị mặc định sẽ tuỳ thuộc vào việc broadcast receiver có chứa bộ lọc ý định hay không. Nếu broadcast receiver chứa ít nhất một bộ lọc ý định, thì giá trị mặc định sẽ là "true". Nếu không, giá trị mặc định sẽ là "false".
Thuộc tính này không phải là cách duy nhất để hạn chế việc tiếp xúc bên ngoài của broadcast receiver. Bạn cũng có thể sử dụng quyền để giới hạn các thực thể bên ngoài có thể gửi thông báo cho broadcast receiver. Xem thuộc tính permission.
android:icon Biểu tượng đại diện cho broadcast receiver. Thuộc tính này được đặt ở dạng tham chiếu đến một tài nguyên có thể vẽ có chứa định nghĩa hình ảnh. Nếu bạn không đặt thuộc tính này, thì hệ thống sẽ sử dụng biểu tượng được chỉ định cho toàn bộ ứng dụng. Hãy xem thuộc tính icon của phần tử <application>.Biểu tượng của broadcast receiver, bất kể được đặt ở đây hay do phần tử <application> đặt, cũng đều là biểu tượng mặc định cho tất cả các bộ lọc ý định của receiver. Hãy xem thuộc tính icon của phần tử <intent-filter>.
android:label Nhãn mà người dùng đọc được cho broadcast receiver. Nếu bạn không đặt thuộc tính này, thì nhãn được đặt chung cho ứng dụng sẽ được dùng. Hãy xem thuộc tính label của phần tử <application>.Nhãn của broadcast receiver, cho dù được đặt ở đây hay do phần tử <application> đặt, cũng đều là nhãn mặc định cho tất cả các bộ lọc ý định của receiver. Hãy xem thuộc tính label của phần tử <intent-filter>.
Nhãn được đặt ở dạng tham chiếu đến tài nguyên chuỗi để có thể được bản địa hoá như các chuỗi khác trong giao diện người dùng. Tuy nhiên, để thuận tiện cho quá trình phát triển ứng dụng, bạn cũng có thể đặt nhãn này làm chuỗi thô.
android:name Tên của lớp triển khai broadcast receiver, lớp con của BroadcastReceiver. Tên này là tên lớp đủ điều kiện, chẳng hạn như "com.example.project.ReportReceiver". Tuy nhiên, ở dạng viết tắt, nếu ký tự đầu tiên của tên là một dấu chấm, chẳng hạn như ".ReportReceiver", thì hệ thống sẽ nối thêm tên gói được chỉ định trong phần tử <manifest>.Một khi bạn đã phát hành ứng dụng thì đừng thay đổi tên này, trừ trường hợp bạn đặt android:exported="false".
Không có giá trị mặc định. Bạn phải chỉ định tên.
android:permission Tên của một quyền mà đài phát cần có để gửi thông báo cho broadcast receiver. Nếu bạn không đặt thuộc tính này, thì quyền do thuộc tính permission của phần tử <application> đặt sẽ áp dụng cho broadcast receiver. Nếu bạn không đặt thuộc tính nào, thì receiver sẽ không được bảo vệ bởi quyền.Để biết thêm thông tin về các quyền, hãy xem phần Quyền trên trang tổng quan về tệp kê khai ứng dụng và bài viết Mẹo bảo mật.
android:process Tên của quy trình mà broadcast receiver chạy trong đó. Thường thì tất cả thành phần của ứng dụng sẽ chạy trong quy trình mặc định được tạo cho ứng dụng. Quy trình này có cùng tên với gói ứng dụng.Thuộc tính process của phần tử <application> có thể đặt một giá trị mặc định khác cho tất cả các thành phần. Tuy nhiên, mỗi thành phần có thể ghi đè giá trị mặc định bằng thuộc tính process riêng, cho phép bạn trải rộng ứng dụng của mình trên nhiều quy trình.
Nếu tên gán cho thuộc tính này bắt đầu bằng dấu hai chấm (:), thì một quy trình mới (dành riêng cho ứng dụng) sẽ được tạo khi cần và broadcast receiver sẽ chạy trong quy trình đó.
Nếu tên quy trình bắt đầu bằng một ký tự viết thường, thì receiver sẽ chạy trong một quy trình chung của tên đó, miễn receiver có quyền làm vậy. Điều này cho phép các thành phần trong nhiều ứng dụng dùng chung một quy trình, qua đó giúp giảm mức sử dụng tài nguyên.
ra mắt từ: API cấp 1Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-27 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-27 UTC."],[],[]]-
X Theo dõi @AndroidDev trên X
-
YouTube Xem Android Developers trên YouTube -
LinkedIn Connect with the Android Developers community on LinkedIn
-
Tìm hiểu thêm về Android
- Android
- Android dành cho doanh nghiệp
- Bảo mật
- Source
- Tin tức
- Blog
- Podcast
-
Khám phá
- Trò chơi
- Công nghệ máy học
- Sức khoẻ và thể dục
- Camera và nội dung nghe nhìn
- Quyền riêng tư
- 5G
-
Thiết bị Android
- Màn hình lớn
- Wear OS
- Thiết bị ChromeOS
- Android cho Ô tô
- Android TV
-
Bản phát hành
- Android 15
- Android 14
- Android 13
- Android 12
- Android 11
- Android 10
- Pie
-
Tài liệu và nội dung tải xuống
- Hướng dẫn về Android Studio
- Hướng dẫn cho nhà phát triển
- Tham chiếu API
- Tải Studio xuống
- Android NDK
-
Hỗ trợ
- Báo cáo lỗi nền tảng
- Báo cáo lỗi tài liệu
- Google Play support
- Tham gia nghiên cứu
- Android
- Chrome
- Firebase
- Google Cloud Platform
- Tất cả sản phẩm
- Quyền riêng tư
- Giấy phép
- Nguyên tắc về thương hiệu
- Manage cookies
- Xem tin tức và các mẹo qua email Đăng ký
- English
- Deutsch
- Español – América Latina
- Français
- Indonesia
- Italiano
- Polski
- Português – Brasil
- Tiếng Việt
- Türkçe
- Русский
- עברית
- العربيّة
- فارسی
- हिंदी
- বাংলা
- ภาษาไทย
- 中文 – 简体
- 中文 – 繁體
- 日本語
- 한국어
Từ khóa » Broadcast ứng Dụng
-
Tìm Hiểu Về Broadcast Receiver Trong Android - Viblo
-
Sử Dụng Broadcast Intent BroadcastReceiver Trong Android
-
Tất Tần Tật Về Broadcast Receiver Trong Android - VNTALKING
-
Ứng Dụng NVIDIA Broadcast: Thoại Và Video Có AI Hỗ Trợ
-
Bài 40: Tìm Hiểu Broadcast Receiver, ứng Dụng Viết Phần Mềm Xử Lý ...
-
Tìm Hiểu Broadcast Receivers Trong Android - W3seo Hướng Dẫn Sử ...
-
Broadcast Receiver Trong Android - Freetuts
-
Android Từ đầu: Tìm Hiểu Về Android Broadcast - Code Tutsplus
-
Cách Gửi BroadCast Từ ứng Dụng Này Sang ứng Dụng Khác - HelpEx
-
Android: Broadcast Receiver Trong Android - V1Study
-
Broadcast Receiver Archives - Yellow Code Books
-
Intent, Intent Filters Và Broadcast Receivers - EMDDI
-
Bộ Thu Phát Sóng Không được Kích Hoạt Sau Khi ứng Dụng Bị Dừng ...