The path to Android-go to Android (Engineering Structure Analysis)

Source: Internet
Author: User

I just used it to record my step-by-step learning process. You can share with me or communicate with me. You can also support me when you have new questions. Thank you!

 

I will not talk about the installation of the android SDK or ADT. You have installed all the estimates you want to learn. The following describes the framework structure of the android Project:

The figure above isCodeNow, I will introduce each of them as follows:

 

SRC/JavaOriginal code storage directory


GEN/
Automatically generate directory


GenDirectory stores allAndroidFiles automatically generated by the development tool. The most important thing in a directory isR. JavaFile. This file is composedAndroidAutomatically Generated by development tools.AndroidThe development tool will automaticallyResDirectoryXMLInterface files, icons, and constants, synchronously update and modifyR. JavaFile. BecauseR. JavaFiles are automatically generated by development tools, so we should avoid manual modification.R. Java.R. JavaIt plays a dictionary role in the application. It contains interfaces, icons, constants, and other resources.ID, ThroughR. JavaThe application can easily find the corresponding resources. In addition, the compiler will also checkR. JavaWhether or not the resources in the list are used, and those that are not used are not compiled into the software. This reduces the space occupied by applications on mobile phones.


Res/
Resources(Resource)Directory

In this directory, we can store various resources used by applications, suchXMLInterface files, images, or data. Where:


Res/Drawable Dedicated StoragePNG,JPGAnd other Icon files. Use in codeGetresources().Getdrawable(Resourceid)Obtain resources in this directory.


Res/Layout Dedicated StorageXMLInterface file,XMLInterface files andHtmlFiles are the same, mainly used to display user operation interfaces.


Res/Values
Stores various types of data used by applications. Different types of data are stored in different files as follows:


· Strings. xmlDefine the string and value inActivityUsed inGetresources().Getstring(Resourceid)OrGetresources().Gettext(Resourceid)Obtain resources. Its role andStrutsThe same is true for international resource files in.


 

 

· Colors. xmlDefine the color and color string values.ActivityUsed inGetresources().Getdrawable(Resourceid)AndGetresources().Getcolor(Resourceid)Obtain these resources. Example:

 

Res/Anim/Stores animation-definedXMLFile.


Res/XML/InActivityUsed inGetresources().Getxml()ReadXMLResource file.


Res/raw/This directory is used to store original files used by applications, such as audio files. During software compilation, the data will not be compiled, and they will be directly addedProgramIn the installation package.
To use these resources in a program, you can callGetresources().Openrawresource(ID ),ParametersIDForm:R. Raw.Somefilename.


AssetsResource Directory


AndroidBesides/ResDirectory to store resource files/AssetsDirectory can also store resource files, and/AssetsThe resource files in the directory are notR. JavaAutomatic GenerationID,So read/AssetsThe directory must specify the file path, for example:File: // android_asset/xxx.3gp


Androidmanifest. xml
Project list file


 This file lists the functions provided by the application. You need to configure various components that you have developed in this file. If the application uses the built-in system applications(Such as telephone service, Internet service, SMS service,GPSServices, etc.), You also need to declare the permission in the file.


Default. Properties
Project Environment InformationThis file does not need to be modified.


 

After learning about the above, I have a little understanding of how to get started with Android development... This is the first article. See U next time... (THX Chuanzhi podcast)

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.