Android SDK instance code analysis-accelerometer play (1)

Source: Internet
Author: User

I. Engineering Structure

Import the accelerometerplay project of the android SDK sample program in eclipse. The application is located in

... \ Samples \ Android-9 \ accelerometerplay. After importing eclipse, the project directory is 1.

Figure 1. directory structure of the accelerometerplay application project.

1. accelerometerplayactivity: Project root directory;

2. SRC: application source code root directory;

3. GEN: the code directory automatically generated by the system. Do not try to modify any content;

4. Android 2.3: Android platform package;

5. assets: any types of files can be saved in this directory, and these files can be packaged into programs. However, Android does not generate an ID for the files in this directory, therefore, to use files in this directory, You need to specify the file path and file name;

6. res: directory where resource files are stored. Android automatically generates a unique ID for each resource file under this directory. The generated result can be in the R. java file.

A. drawable-hdpi: stores high-resolution images, such as WVGA (480x800) and fwvga (480X854)

B. drawable-mdpi: stores medium-resolution images, such as hvga (320x480)

C. drawable-ldpi: stores low-resolution images, such as qcga (240x320)

The Android system simply divides the screen resolution of the system into the above three levels. We can put the images adapted to different levels into the corresponding directories above to support multi-resolution requirements.

D. Layout: directory of the activity layout definition file. In this example, the layout is defined in the main. xml file.

E. Values: stores constant resources such as application characters, colors, and arrays. This example defines character constant resources in the strings. xml file.

7. androidmanifest. xml: the configuration file of this application, which must be saved in the project root directory. The main functions are as follows:

A. Name the application and uniquely identify the application in the system;

B. Describe the components and permissions of the application

C. SDK version.

8. Default. properties: this file is automatically generated by the android tool. Do not modify this file. Any modifications will be erased.

 

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.