Getting started with Android

Source: Internet
Author: User

@ Drawable/icon
@: Represents R. java
Drawable: internal class drawable
Icon: the object whose id is icon
The id of the drawable internal class in the R. java file is the constant corresponding to the icon value.

<Application android: label = "application name">
<Activity android: name = ". Specify the Class name of the activity under the class (. classname )"
Android: label = "window title"
>
<! -- Intent filter: Used to match the intent. If the match is successful, it is processed. -->
<Intent-filter> <! -- Display the application icon in the program list to specify the entry activity of the program. -->
<Action android: name = "android. intent. action. MAIN"/>
<Category android: name = "android. intent. category. LAUNCHER"/>
</Intent-filter>
</Activity>
Indicates the configuration of the application window;
Classes used as activities must be placed in the application package;

<Uses-sdk android: minSdkVersion = "8"/>
The configuration file is read when the program is installed and then functional registration of the program;

After clicking the icon for the first user, create a process, create a main thread, and instantiate the Activity in the main thread (reflection mode, the operating system will apply
Information (Context) is stored in the Activity, and then the onCreate () method is called)

Android Application directory
Src/java source code storage directory
The gen/automatically generated directory stores all files automatically generated by the Android tool, where R. java: when data is added to the res directory, an id is automatically added to the file. You can use this id to find the corresponding file content,
The res/Resource Directory stores various Resource files, such as xml interfaces, images, or data,
Assets/Resource Directory The resource files under this directory are not in R. java automatically generates an id. to read files in this directory, you must specify the file path, for example, file: // android_asset/xxx.3gp,
AndroidMainfest. xml project list file this file lists the functions of the application. various components (Activity, ContentProvider, BroadcastReceiver, and Service) developed in the future must be configured in this file, if an application uses a built-in application (such as phone, SMS, or GPS), you must declare the permission in the file,
Default. properties project environment information,
Res/anim stores XML files that define animations,
Res/xml use getResources (). getXML () in the Activity to read the XML resource file under this directory,
Res/raw: This directory is used to store the original files used by the application, such as audio files. During software compilation, the data is not compiled, and they are directly added to the program installation package, to use these resources in a program, getResources () may be called (). openRawResource (ID), ID: R. raw. somefilename,

Display Unit in Android:
In order to adapt to different resolutions and different pixel density, dip and sp are generally used for text.

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.