Pro Android 2. 笔记 – 2 名词定义

View
Views are user interface (UI) elements that form the basic building blocks of a user
interface. Views are hierarchical and they know how to draw themselves. A view could
be a button or a label or a text field, or lots of other UI elements. If you are familiar with
views in J2EE and Swing then you’ll understand views in Android.
Activity
An activity is a user interface concept. An activity usually represents a single screen in
your application. It generally contains one or more views, but it doesn’t have to.
Moreover, other concepts in Android could better represent a viewless activity (as you抣l
see in the service section shortly).
Intent
An intent generically defines an 搃ntention?to do some work. Intents encapsulate several
concepts, so the best approach to understanding them is to see examples of their use.
You can use intents to perform the following tasks:
.. Broadcast a message
.. Start a service
.. Launch an activity
.. Display a web page or a list of contacts
.. Dial a phone number or answer a phone call
Intents are not always initiated by your application they’re also used by the system to
notify your application of specific events (such as the arrival of a text message).
Intents can be explicit or implicit. If you simply say that you want to display a URL, the
system will decide what component will fulfill the intention. You can also provide specific
information about what should handle the intention. Intents loosely couple the action
and action handler.
Content Provider
Data sharing among mobile applications on a device is common. Therefore, Android
defines a standard mechanism for applications to share data (such as a list of contacts)
without exposing the underlying storage, structure, and implementation. Through
content providers, you can expose your data and have your applications use data from
other applications.
Service
Services in Android resemble services you see in Windows or other platforms梩hey抮e
background processes that can potentially run for a long time. Android defines two
types of services: local services and remote services. Local services are components
that are only accessible by the application that is hosting the service. Conversely,
remote services are services that are meant to be accessed remotely by other
applications running on the device.
An example of a service is a component that is used by an e-mail application to poll for
new messages. This kind of service might be a local service if the service is not used by
other applications running on the device. If several applications use the service, then it
would be implemented as a remote service. The difference, as you抣l see in Chapter 8, is
in startService() vs. bindService().
You can use existing services and also write your own services by extending the
Service class.
AndroidManifest.xml
AndroidManifest.xml, which is similar to the web.xml file in the J2EE world, defines the
contents and behavior of your application. For example, it lists your application
activities and services, along with the permissions the application needs to run.
Android Virtual Devices
An Android Virtual Device (AVD) allows developers to test their applications without
hooking up an actual Android phone. AVDs can be created in various configurations to
emulate different types of real phones.

reeoo.com - web design inspiration

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注