Android learning the first basic concept

Source: Internet
Author: User

One.

1. Android Four components Activity, Service, Broadcastreceiver, ContentProvider
2. A number of activity groups, when the former activity is at the top level
3. SetTheme (int resid) can be used to set the window style

Two.

1. Service generally running in the background, no need to interact with the user, no interface

2. Service has its own independent life cycle, usually providing back-office services to other components or monitoring other components ' operational status

Three.

1. Broadcastreciver broadcast message receiver Similar event listener difference is that the Broadcastreciver listener event source is the other component in the Android app

2. Implement your own Broadcastreceiver subclass, overriding the OnReceive (Context context,intent Intent) method to

Four.

1. ContentProvider implementation of cross-application data exchange

2. Implement your own contentprovider need to implement an abstract method insert (Uri,contentvalues)

Delete (uri,contentvalues)

                                                                                 Update (uri,contentvalues,string, string[])   

Query (uri,string[],string,string[],string);

3. Contentresolver used to access data

Five. Intent Intentfilter

1. Intent is the medium of communication between different components of Android application

2. Start an activity call to the context startactivity (Intent Intent)

Call Startactivityforresult (Intent intent,int requestcode)

The activity information to start is encapsulated in the intent

3. Start a service call to the context StartService (Intent Intent) method

Call Bindservice (Intent intent,serviceconnection conn,int flags) I

Service information to be started is encapsulated in the ntent

4. Trigger Broadcastreceiver to invoke context Sendbroadcast (Intent Intent)

                                                           sendstickybroadcast (Intent Intent)                                 

Sendorderedbroadcast (Intent intent,string receiverpermission)

The intent parameter of three functions encapsulates the broadcastreceiver information of the drug trigger.

5. Explicit and implicit

Explicit intent explicitly indicates the trigger component class name

Implicitly only specifies the conditions to be met by the component to be started or triggered

Android learning the first basic concept

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.