Getting Started with Android's zero-single-row development Diary (iii)--ANDROID directory structure

Source: Internet
Author: User

Originally, this chapter would like to introduce the Android system architecture, after all, with the knowledge of the reserve, then to see the actual project will be more clearly understand why this design, while in the development of difficulties, but also with the understanding of Android, Find out which modules and designs can help solve the problem as quickly as possible. But think about it, after all, this is an introductory article, if there is no actual project development experience after the person must be confused, so decided to put it stranded to everyone familiar with the android before you introduce.So today's theme is the Android directory structure, the system architecture compared to the human skeleton architecture, the directory structure is like human organs, each other's functions are different, but can run in an orderly manner.

This article is based on the latest Android 4.4来 introduction. First to create a new Demo Android project, after completion will generate two folders Appcompat_v7 and Demo, as follows:

First, Appcompat_v7 This folder is in the latest SDK (Android4. 0 is above), in fact, we are basically not in the development of this goods, ignoring the line. Well, let's talk about the functionality of this folder, in order for Android project to have access to the Actionbar API in the SDK version of API 7+ (that is, the Android2.1 version), only to add this Project specifically in order to be compatible with the lower version of the SDK. Of course, if you don't like it and want to make it disappear the next time you create a project, you can do this-in the program configuration interface, set the minimum Required SDK (the minimum Android version supported by your application) to api14:android4.0, and the other parameters are the same. Detailed Link--http://jingyan.baidu.com/article/36d6ed1f5526f91bcf4883e4.html

second, the project folder--demo  

So the next thing is the point, and I'll introduce you to a directory in the project. First, Src.

  1. src/folder--Source code directory
    Usually we write programs, build packages are here to build the class is here to store all the essence of the project and all the work of the programmer's efforts.
  2. gen/folder--system automatically generate code directory
    Since the system is automatically generated, so we can not control it. By the way, the reconstruction of the project, let the system code re-generated automatically--select the project, and then to the Eclipse menu bar, Project->clean.
  3. 3 Android Packs--storage directory for the jar package provided at development time
    The first one is the Android version comes with the jar package, the system core content. The second is also the SDK update, which contains the jar package you want to use, including the jar package you imported. The third stored AppCompat jar package, version support is used. You may be able to import new jar packages from Lib and the new directory starting with Android will appear, so be assured that these are harmless ~ ~
    By the way, how to add a new jar package--Find the Project project file directory, go in and create a new Libs folder, and put the jar into the import. Go back to eclipse, (remember to refresh the project first) to the right of the project->propreties->java Bulid path->libraries-> to the right of the add jars-> find the Libs folder under your project , select the jar package you want to import, and you're done.
  4. assets/folder--Resource Directory
    The resources required to store the system can be built in any directory, but the resource files in the directory will no longer r.java automatically generated IDs. These are different from the Res/folder.
    The name of the stored resource should start with lowercase, or the system will not recognize it.
  5. Bin/folder--also automatically generated by the system
    After build, the APK file will be generated and can be directly used.
  6. libs/folder--store the jar packages you need
  7. Res/folder--storage of resources such as pictures, layouts, strings, etc.
    The resources inside will be automatically generated in the R.java ID (need to tick before project->build automatically)
    (1) The res/drawable-*dpi/--system extracts the icons in different drawable folders based on the resolution. From H-m-l, in turn, represents the resolution from high to low. Of course, just one. The system can also be read in one of the folders.
    (2) Res/layout folder--store layout file
    (3) Res/menu folder--Store the menu resource file. The menu resource file uses the <menu> tag as the root node. In addition to <menu>, there are two other tabs for setting menu items and grouping, both <item> and <group>.
    (4) Res/values folder--Storing data resource files. You can store different types of data. such as Arrays.xml, Colors.xml, Dimens.xml, Styles.xml and so on. Depending on the version, different folders are also set.
  8. androidmanifest.xml--System Configuration File
    The total configuration file for the project, documenting the various components used in the application. 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.
  9. project.properties--Environment File
    Document the environmental information required in the project, such as the Android version.
  10. Other
    Ic_launcher-web.png: This is for the Google Play market to use the display icon, it needs to be 512x512 high-resolution icon.
    Proguard-project.txt
    Project.Properties
    These two files are used to confuse the code that was made to protect the Android project.
Conclusion: These are the basic directories in a project. Of course, the later development may also be expanded from it, but the basic is these. Get familiar with this and move on to the next step.CPACMqq:348515494 (Please specify the blog park)
Source: (http://www.cnblogs.com/cpacm/p/3898600.html)
Copyright notice: The copyright of this article is owned by the author and the blog Park. Welcome reprint read, reprint must indicate the detailed link of this article.
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.