Concepts and understanding of apjplication for Android

Source: Internet
Author: User

Android Application

I. Overview

The frameworks used earlier: VC-based MFC and MTK platform development; the similarities between the two platforms are: Application-based development;

MFC is an application-based document/view method, and each application is a process;

MTK is based on the application's screen/Page and service methods. Each application has its own memory and management methods. The core of these two methods is: application;

I have not been able to see application problems since helloword in Android development and learning.CodeAnd activity as the entry;

It surprised me: What kind of development method is Android Application.

I learned from various places that the core components of Android development are activity, service, broadcastreceiver, and contentprovider;

As well as intent, handler and other mechanisms; such componentsCompositionWhat is "application?

 

2. Concepts of Android Application

Android provides a class such as application. Take a look at the explanation of this class in the official Android documentation:

Base class for those who need to maintain global application state.

You can provide your own implementation by specifying its name in your androidmanifest. XML's <Application> tag,

Which will cause that class to be instantiated for you when the process for your application/package is created.

The general meaning is: the application must beProgramProvides global variables and specifies the implemented Application subclass in androidmanifest. xml;

This class is instantiated when your application process is created;

The document explains that the implementation of application subclass is not necessary;

In the implementation of the helloword program, the application subclass is not implemented, but the system will default one for us;

It means that the program is running or has the concept of application, but it is not the core. An application is a process, and the application provides context for the entire program. Such use is very simple;

The MMS module overrides this class, but it is very simple. Let's take a look at what has been done and its role:

Here, the oncreate method is rewritten:

Public classMmsappExtendsApplication{

@ Override

Public void oncreate (){

Super. oncreate ();

Smmsapp = this;

// Configure and initialize the classes in the MMS module:

Mmsconfig. INIT (this );

Contact. INIT (this );

Draftcache. INIT (this );

Conversation. INIT (this );

...... // Many init

}};

 

3. Android Application

Http://blog.csdn.net/maxleng/article/details/5621345

Let's take a look at the analysis of this problem on the Internet: the Android app is a very virtual concept, and there is no actual entrance;

Android provides more components. Why is it necessary to virtualize the concept of application? This virtualization isFree and borderless DesignThe direct embodiment of intent.

Highlight requests and services, highlight the weak boundaries of individual components, and the system components can communicate without boundaries. Service requestors directly send requests, regardless of where and who the object service belongs.

A component is a free and independent individual. A program can request components of other applications-the core concept of Android Application Framework Design;

In the conceptual space provided by Android to developers, application is just a loose characterization concept, and there is not much substantive representation.

In actual android space, the concept of an application is invisible. Even if there is a class called application, this is alsoApplication context status,

Is a concept of extreme weakening. Application is just a concept of spatial category, and application is the context description of components such as activity and service.

Application is not the core concept of Android.ActivityYesAndroidCore concepts.

Android applications are constructed from the following four components: Activity, broadcast explorer, service, and content provider ).

The following figure shows the concept space of Android. These components are attached to the application, and the application will not be established from the beginning, but after these components are created,

Create an application object only when running.


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.