Key classes for getting started with Android programming

Source: Internet
Author: User

Android Application Development is generally divided into five main learning areas: Activity application activity, service background service, broadcastreceiver Broadcast Reception, and contentprovider data support (external data) intent intent (Active Bridge ).

1. Activity: application activity

Activity almost undertakes users' applicationProgramFor all applications, the activity should have a window, which can be changed by theme. You should pay attention to the impact of its lifecycle (lifecycle), device status (configuration) changes, and storage of running status and data, this is critical to the reliability and humanization of an application. Permissions should also be stated in the activity to use some hardware and software features of Android.CodeOr manifest. xml. Finally, each activity must be stated in manifest.

 

2. Service: Background Service

A service is a program without interfaces. It is a so-called service or a background program. Pay special attention to the relationship between the service start (startservice) and bindservice) methods and the service lifecycle, the life cycle effects of the two account service methods are different. In addition, the permission and service are affirmed in code or manifest.

 

3. broadcastreceiver: broadcast receiving

Broadcast receiving is not generally referred to as radio broadcasting, but an intent sent by sendbroadcast (). That is, the intent is broadcast here, And broadcastreceiver is registered (registe) then, you can automatically monitor the intent that meets the given conditions. If so, the owner of this broadcastreceiver will be notified.

 

4. contentprovider: data support (external data)

Contentprovider is used to save application data and establish and maintain the database, so that the program can return to the previous state or save information when restarted. Pay attention to the application permission and SQL language usage. Android uses a lightweight Database System SQLite.

 

5. intent: intent (Active Bridge)

Intent is a very important component in Android Application development. Many books explain it in literal translation, which is not very easy to understand. I think it can be translated as "activity bridge", that is, connecting two activities) bridge ). You can use intent to start any activity from one activity, whether defined by yourself or by the system. In the activitygroup (extends activity), the flag setting of intent is crucial to the Startup Mode of the Child Activity.

Related Article

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.