菜单
  
    Application Components Application components are the essential building blocks of an Android application. Each component is a different point through which the system can enter your application. Not all components are actual entry points for the user and some depend on each other, but each one exists as its own entity and plays a specific role—each one is a unique building block that helps define your application's overall behavior. There are four different types of application components. Each type serves a distinct purpose and has a distinct lifespan that defines how the component is created and destroyed. Here are the four types of application components:39906
    Activities
    An activity represents a single screen with a user interface. For example, an email application might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails. Although the activities work together to form a cohesive user experience in the email application, each one is independent of the others. As such, a different application can start any one of these activities (if the email application allows it). For example, a camera application can start the activity in the email application that composes new mail, in order for the user to share a picture.An activity is implemented as a subclass of Activity and you can learn more about it in the Activities developer guide.
    Services
    A service is a component that runs in the background to perform long-running operations or to perform work for remote processes. A service does not provide a user interface. For example, a service might play music in the background while the user is in a different application, or it might fetch data over the network without blocking user interaction with an activity. Another component, such as an activity, can start the service and let it run or bind to it in order to interact with it. A service is implemented as a subclass of Service and you can learn more about it in the Services developer guide.
    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 Contract.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 Content-provider and must implement a standard set of Apish 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 amount of work. For instance, it might initiate a service to perform some work based on the event.
    A broadcast receiver is implemented as a subclass of Broadcast-receiver and each broadcast is delivered as an Intent object. For more information, see broadcaster class.
  1. 上一篇:CRM客户关系管理英文文献和中文翻译
  2. 下一篇:MongoDB数据库安全性英文文献和中文翻译
  1. 汽车乘员舱的声振耦合英文文献和中文翻译

  2. 立体光照成型的注塑模具...

  3. 数控机床英文文献和中文翻译

  4. 工业机械手英文文献和中文翻译

  5. 低频振动的铁路车轴的状...

  6. 接头的形状对沥青塞接头...

  7. 数控加工技术英文文献和中文翻译

  8. 电站锅炉暖风器设计任务书

  9. 十二层带中心支撑钢结构...

  10. 当代大学生慈善意识研究+文献综述

  11. 酸性水汽提装置总汽提塔设计+CAD图纸

  12. 乳业同业并购式全产业链...

  13. 河岸冲刷和泥沙淤积的监测国内外研究现状

  14. java+mysql车辆管理系统的设计+源代码

  15. 大众媒体对公共政策制定的影响

  16. 中考体育项目与体育教学合理结合的研究

  17. 杂拟谷盗体内共生菌沃尔...

  

About

751论文网手机版...

主页:http://www.751com.cn

关闭返回