Android App Framework

Source: Internet
Author: User

Android Frame:

SRC: Main Completion of Java code writing

Gen: System automatically generated source code directory

R.java: Default has attr (attribute), drawable, Layout, string 4 static inner classes

Assets: Resource Directory

Bin: Output Folder

Res: Files such as pictures, layout files, strings, menus, etc.

Drawable: Store The project picture information, the default PNG format picture.

Layout: Storage of project layouts files

Values: Some important value

Stings.xml: String and numeric, color.xml color, and color string values

Dimens.xml: Defining dimension values, Styles.xml: Defining Styles

Arrays: Defining arrays

Androidmanifest.xml: A profile that describes the "Overall information" of an Android application.

A Package Name: Specifies the package name of the Java main package in this app. When the file name of the APK is not specified, the resulting package is named after the compilation. This package name should be unique when the Android system is running.

B Authentication (certificate): Specifies the level of trust granted by this application, and there are currently authentication levels platform (System), shared, media, and application-customized certifications. Different certifications can enjoy different permissions.

C Permission Group (permission-group): A permission group is defined to describe a set of permissions that have common attributes.

d permissions (permission): Permissions are used to describe whether you have the power to do something. The permissions in the Android system are hierarchical and are divided into normal level (normal), hazard level (dangerous), signature level (signature), and System/signature level (signature or systems). All predefined permissions in the system belong to different levels depending on the role. For normal and dangerous levels of permissions, we call it low-level permissions, which are granted as application applications. Other level two permissions, which we call advanced permissions or system permissions, apply with the platform level of authentication. When an app tries to do a restricted operation without permission, the app will be killed by the system to alert. Any permissions can be used by the system app. This permission can be used unconditionally by the declarator of the permission.

E permission Tree (permission-tree): the permission tree is set to manage a set of permissions uniformly, and the permission owner declared under that tree belongs to the app. The system provides APIs that can be dynamically added at run time by the application. Packagemanager.addpermission ()

F usage rights (uses-permission): The permissions required by the application should be applied here, the requested permission should be defined by the system or an application, otherwise it will be considered as invalid application. At the same time, applications that use permissions need to follow permission grant criteria, and non-platform certified Apps cannot request advanced permissions.

gsdk (USES-SDK): Identifies the version of the SDK that this app runs. High-compatibility applications can ignore this entry.

happlication:application is the highest level module in the Android app, with a maximum of one application per app, and if the app does not specify the module, A default application will be enabled. The application will be loaded first when the app starts and survives the entire runtime lifecycle of the app. So some of the initialization work is appropriate for this module to complete. The application element has many properties, where: "Persistent" indicates whether the application is resident memory, and "enable" indicates whether the application should currently be loaded.

iactivity: Activity is a run-time child element of the application module that identifies a UI. In addition to application, an application can declare and implement 0 to many other runtime modules, and the activity is the same. The activity also contains many properties that define its working state, where: "Name" is required, it specifies the name of the file where the activity resides, and if the file belongs to a package that is different from the app's package name (that is, at the very beginning of this description), the name of the package must precede it. Activity adds intent-fliter to identify which intent can be processed, while intent is also the main parameter for scheduling activity.

jreceiver: Receiver is also the runtime child element of application. Receiver identifies which intent it needs to accept by adding intent-fliter. When intent is received, receiver will be treated differently depending on the intent. When a intent is issued, all receiver registered with the intent will receive, and the system will be sent according to receiver's registration order in the system. When a receiver finishes processing the intent, the system is sent to the next receiver. When a receiver has multiple intent that are not received, it is received in the order in which the intent is sent.

kservice: Service is also a run-time child element of application. The service belongs to the backend module and will run for a long time after startup unless the service is stopped or the application process is killed.

Lprovider:p Rovider is also a run-time child element of application. It inherits from ContentProvider, which is a structured access to the user data managed by the application, and is based on the database operation mode of encapsulation. If an app allows external apps to access/manage its user data, provider is the best way for Android platforms to provide.

Mactivity-alias: As the name implies, is an activity alias.

nuses-library: Identifies the shared library that is necessary for the app to start.

Each element node has a property to describe the node's information, the most commonly used attributes are: android:name= ". MyName ", which defines the file name of the node, which together form the information of the element node.

<activity android:name= ". App. MyName "
<activity android:name= "MyName"
<activity android:name= ". MyName "
The Android:name property of the activity component takes the abbreviated form of the class name to see the abbreviated format of the document class name as ". ClassName ", but why <activity android:name=" MyName "> android:anem=" MyName "instead of android:anem=". MyName? " The value of the android:name for all subsequent activity components is ". ClassName "format? Google Now queries the description of the Android:name property value, but does not find a class name before the "." The instructions!

The actual test results are "MyName" and ". MyName "can be correctly run the program. Is there a "." Before the class name? With no "." Is the same? The document is clearly stated in the ". ClassName "Format Ah! So put the other activity of the Android:name value string in the first "." Remove, and then run the program, but not, more and more strange feeling! Depressed! After repeated testing, a rule was found:

If the package attribute is specified in manifest, such as "com.android.sample", if the implementation class for the activity is also under this package, the Android:name is the implemented class name, This class name does not have a connection, if the implementation of the activity class is in the default package in the child package, then this "." is necessary, such as the implementation of activity is com.android.sample.app.DialogActivity, then Android: Name must be written in. app.dialogactivity or com.android.sample.app.DialogActivity. If you write only the app. Dialogactivity, you will get an error.

About Settings$wirelesssettingsactivity middle of this $ sign what does that mean
This is the settings$wirelesssettingsactivity that appears when the activity is declared in XML setting this package but setting wood has wirelesssettingsactivity
The settings$wirelesssettingsactivity middle of this $ symbol indicates that wirelesssettingsactivity is the inner class of the Settings class

Project.Properties: Project Properties File configuration

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.