Android Notes: Basic components for Android apps

Source: Internet
Author: User

Android applications are loosely coupled components and are bound together using the project manifest (mainifest).
1.Activity and view
Activity is an Android application representation, and each screen in the application is an extension of the activity class. Activity uses view to form a graphical interface for displaying information and responding to user actions on a single screen,
Multiple activity can be jump to each other, in some applications, a screen will even return a value to the previous screen.
View is the base class of the user graphical interface in Android, which provides the user with a visual interface, and the view can be divided into two sub-classes of view and ViewGroup, in which view is the basic component of the interface, and ViewGroup is the layout of the interface.
Control that is responsible for how the various components on the interface are arranged in the layout.
2.Intent and Intentfilter
Intent is a message-passing person in an Android application that enables a jump between activity, and the intent class is used to describe what an application will do.
Intent: Data corresponding to actions and actions. Typical action type: MAIN (Activity Portal), View,pick,edit, etc., while the data for the action type is represented as a URI.
Intentfilter: Used to describe which intent an activity (or intent Receiver) can manipulate.
3.Service
Service is a stealth worker in an Android application that is a long life cycle, without a user interface and running in the background program.
Context.startservice () to start a service.
Context.bindservice () connected to a service (if the service is not running it will start it)
4.Boradcase Receiver
Boradcase Receiver is the recipient of intent in Android, and you can use a broadcast receiver when you want the application to respond to an external event (phone call or data network availability).
Boradcase receiver is registered in the Androidmanifest.xml, but can also be registered in the Code context.registerreceiver ()
Applications can broadcast their own broadcast receiver to other applications via Context.broadcastintent ().
5.Content Provider
Content provider is a shareable data warehouse in Android that manages and shares application databases. Is the first way to share data across application boundaries. (You can configure your own content provider for other applications to access)
Several local content Provider (Media Library and contacts)

Android Notes: Basic components for Android apps

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.