1、What Makes an Android Application?

一个Android应用程序由哪些部分组成。

Andriod application consist of loosely coupled components, bound by the application manifest that describes each component and how they interact. The manifest is also used to specify the application's metadata,its hardware and platform requirements,external libraries,and required permissions.

Android应用程序由一些松藕合的组件组成,通过描述每一个组件及如何交互的应用程序清单绑定在一起 。这个清单文件也会用来描述指定的应用程序的元数据,包括它的硬件和平台要求,外部库和需要的权限。

The following components comprise the building blocks for all your Android applictions:

下面的这些组件包含了你的所有Android应用程会用到的基础构件。


  • Activities

    Your application's presentation layer.The UI of your application is built around one or more extensions of the Activity class. Activities use Fragments and Views to layout and display information, and to respond to user actions.Compared to desktop development,Activities are equivalent to Forms.You'll learn more about Activities later in this chapter.
    Activities 是你的应用程序的演出层。你的应用程序的UI是构建在一个或多个Activity类基础之上的。Activities 使用Fragments和Views布局和显示信息和响应用户动作。等价于桌面应用的表单。
  • Services

    The invisible workers of your application. Service components run without a UI, updating your data sources and Activities, triggering Notifications, and broadcasting Intents. They're used to perform long running tasks, or those that require no user interaction (such as network lookups or tasks that need to continue even when your application's Activities aren't active or visible.) You'll learn more about how to create and use services in Chapter 9, "Working in the Background".
    Services在你的应用里是幕后工作者。Service 组件的运行不需要任何UI展现,更新你的数据源和Activities,触发通知消息,广播Intents。它们一般用于需要长时间运行的任务或者那些不需要用户交互的场景(例如网络查找或者当你的应用程序的Activity 不再处理活动状态或可见状态时仍需要继续运行的任务)
  • Content Providers

    Shareable persistent data storage. Content Providers manage and persist application data and typically interact with SQL databases. They're also the preferred means to share data across application boundaries. You can configure your application's Content Providers to allow access from other applications, and you can access the Conent Providers exposed by others. Android devices include several native Content Providers that expose useful databases such as the media store and contacts. You'll learn how to create and use Content Providers in Chapter 8, "Databases and Content Providers."
    Content Providers是可共享的持久数据仓库。Content Providers 管理和持久化应用数据特别是和SQL数据库的交互。在跨应用共享数据的时间也是首选。你可能通过配置Content Providers来允许其它应用访问你的应用的数据。Android设备暴露了一些像媒体数据和联系人内置的Content Providers.
  • Intents

    A powerfull interapplication message-passing framework. Intents are used extensively throughout Android. You can use Intents to start and stop Activities and Services, to broadcast messages system-wide or to an explicit Activity, Service, or Broadcast Receiver, or to request an action be performed on a particular piece of data. Explicit,implicit,and broadcast Intents are explored in more detail in Chapter 5, "Intents and Broadcast Receivers."
    Intents 是强大的应用内部消息传递框架。Intents被广泛地应用在Android里。你可以开启和停止Activities和Services,全系统广播消息或者明确到Activity、Service或者Broadcast Receiver,或者执行的请求的action详细的数据中使用Intents。
  • Broadcast Receivers

    Intent listeners.Broadcast Receivers enable your application to listen for Intents that match the criteria you specify.Broadcast Receivers start your application to react to any received Intent, making them perfect for creating event-driven applications.
    Intent 监听器。Broadcast Receivers可以让你的应用监听那些匹配你指定的标准的Intents。Broadcast Receivers启动你的应用可以应答所有的接受到的Intents,打造完美的事件驱动的应用。
  • Widgets

    Visual application components that are typically added to the device home screen.A special variation of a Broadcast Receiver,widgets enable you to create dynamic, interactive application components for users to embed on their home screens.
    通常是指添加到设备主屏幕上的图像应用程序组件,widgets允许你创建动态的、交互的应用程序组件嵌入到用户的屏幕上。
  • Notifications

    Notifications enble you to alert users to application events without stealing focus or interrupting their current Activity.They're the preferred technique for getting a user's attention when your application is not visible or active, particularly from within a Service or Broadcast Receiver.For example,when a device receives a text message or an email,the messaging and Gmail applications use Notifications to alert you by flashing lights,playing sounds,display icons,and scrolling a text summary.You can trigger these notifications from your applications.
    Notifications允许你向用户发送应用事件报警而不会丢失焦点和打断他们的当前的Activity。当你的应用处于不可见或者非激活状态下又想获取用户的注意力Notifications技术是首选,尤其是在Service或者Broadcast Receiver。举个例子,当设备接收到一条短信或者一封邮件,短信和Gmail应用会使用Notifications闪灯,播放声音显示图标和滚动的摘要来提醒用户。你可以在你的应用里触发这些Notifications

你可能感兴趣的:(Android)