(完整 word 版)Android 外文文献翻译
Content providers
A
content provider
manages a shared set of application data。 You can store
the data in the file system, an SQLite database, on the web, or any other persistent
storage location your application can access. Through the content provider,
other applications can query or even modify the data (if the content provider allows
it). For example, the Android system provides a content provider that manages
the user's contact information。 As such, any application with the proper permissions
can query part of the content provider (such as ContactsContract。Data) to read and
write information about a particular person.
Content providers are also useful for reading and writing data that is
private to your application and not shared. For example, the Note Pad sample
application uses a content provider to save notes.
A content provider is implemented as a subclass of ContentProvider and
must implement a standard set of APIs that enable other applications to
perform transactions。 For more information, see the Content Providers developer
guide。
Broadcast receivers
A broadcast receiver is a component that responds to system-wide
broadcast announcements 。 Many broadcasts originate from the system—for
example, a broadcast announcing that the screen has turned off, the battery is
low, or a picture was captured。 Applications can also initiate broadcasts—for
example, to let other applications know that some data has been downloaded to
the device and is available for them to use。 Although broadcast receivers don't
display a user interface, they may create a status bar notification to alert the
user when a broadcast event occurs。 More commonly, though, a broadcast receiver
is just a "gateway” to other components and is intended to do a very minimal
评论0
最新资源