Android Development four Big

Source: Internet
Author: User

Four Components activity

Activity is an Android app interface, such as viewing contacts, calling, playing the game interface, etc.
An application typically contains multiple activity, that is, multiple interfaces
Activity manages various view components through layouts
The view can be rendered by the Setcontentview () method

Service

The service runs in the background, dealing with things that some users can't see and that have a duration. such as downloading data, playing music, etc.
Service does not generate UI, is invisible
All user-implemented service must inherit the service class of the system and be registered in the configuration file

Content Provider

Data is a private program in Android
Content Provider provides a mechanism for data interaction among multiple programs
Content provider exposes a number of standard APIs to manipulate data

Broadcast Receiver

Broadcast receiver is responsible for responding to external events
Broadcast receiver does not generate UI, is invisible
All user implementations broadcast receiver must inherit the Broadcastreceiver class and register
Applications can broadcast their own intent through sendbroadcast (), and other programs are intercepted by their own broadcast receiver for event handling

Summary

Simply put, the activity is the interface, service is the backend services, Content provider is the external data interface, broadcast receiver is broadcast and accept external broadcast

Important Object Intent

Intent can be seen as a reference, static or intent
Four components, three need intent support

传递Intent启动一个Activity,eg.StartActivity/StartActivityForResult传递Intent启动一个Service,eg.StartService/BindService通过Intent新加入一个广播,eg.SendBroadcast......
Other Launcher&widget

Launcher: System application, including main interface, application list two main activity
Widgets (Widgets): Different ways in which applications are programs on the desktop, such as the weather bar, billing shortcuts, music player widgets

Notification: Reminder (drop-down box message) example

Android Development four Big

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.