Android Project Eclipse directory structure

Source: Internet
Author: User

One src directory
SRC is the Java source code for the project
OnCreate (Bundle)
Initialize activities (activity), such as finishing some drawing.
Most importantly, in this method, the UI is defined using the Layout resource (Resource) call Setcontentview (int) method,
Use Findviewbyid (int) to retrieve widgets (widgets) that require programmatic interaction in the UI.
Setcontentview specifies which file to specify the layout (main.xml), you can display the interface, and then we do the relevant operation,
Our operations are packaged as an intent, and the intent is to deal with the activity that should be relevant.


OnPause ()
Deal with what you have to do when you leave your activity. Most importantly, all changes made by the user should be committed here (usually contentprovider save the data).


Two Gen Catalog
There is a R.java file under the folder, R.java is generated automatically when the project is built, the file is read-only and cannot be changed.
A class R is defined in the R.java file, which contains many static classes, and the name of the static class corresponds to a name in Res, which is the R class that defines the index of all resources for the project.
such as drawable,layout,string and so on.


Three android+ version number directory
This folder contains the Android.jar file, which is a Java archive file.
It contains all the Android SDK libraries (such as views, Controls) and APIs required to build the application.
Bind your application to the Android SDK and Android Emulator via Android.jar,
This allows you to use all of your Android libraries and packages and enable your application to debug in the appropriate environment.


Four Assets Catalogue
Contains files such as MP3, video classes that the application needs to use.
Resources in this directory do not generate resource IDs in the R file and need to be accessed using a path.


Five Res directory
The resource directory that contains the resource files in your project and will be compiled into the application.
When you add a resource to this directory, it is automatically recorded by the R.java file.
Create a new project, there will be three subdirectories under the Res directory:
1 drawabel-h/l/mdpi: Contains some icon files that your application can use (*.png, *.jpg)
2 layout: interface layouts file (Main.xml) similar to HTML in Web applications
3 values: All the text that needs to be displayed on the software. You can store multiple *.xml files, and you can store different types of data.
such as Arrays.xml, Colors.xml, Dimens.xml, Styles.xml and so on.


In addition, three common folders are added:
4 Anim storing XML files that define animations
5 XML is used in activity with getresources (). GetXML () to read XML resource files in this directory
6 Raw resources, such as sound effects files, are used for storage.
The data will not be compiled when compiling the software, they will be added directly to the program installation package.
In order to use these resources in your program, you can call Regresources (ID) and the parameter ID as r.raw.somefimename.


Six Androidmanifest.xml file
The total configuration file for the project, documenting the various components used in the application.It is read when the software is installed.
This file lists the features that the application provides, in which you can specify the services that the application uses (such as telephone service, Internet service, SMS service, GPS service, and so on).
In addition, when you add a new activity, you need to configure it in this file, only after the configuration, you can call this activity.
Androidmanifest.xml will contain the following settings: Application permissions, activities, intent filters, and so on.


Vii. default.properties File
Keep track of the environmental information you need in your project, such as the Android version, and so on.

Android Project Eclipse directory structure

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.