Android Developer Managing Projects (android项目开发时项目结构目录

Android 开发各种项目的结构

Android Projects

An Android project is the container for your application's source code, resource files, and files such as the Ant build and Android Manifest file. An application project is the main type of project and the contents are eventually built into an .apk file that you install on a device.

Test Projects

These projects contain code to test your application projects and are built into applications that run on a device.(测试项目用来测试你的项目)

Library Projects

These projects contain shareable Android source code and resources that you can reference in Android projects. This is useful when you have common code that you want to reuse. Library projects cannot be installed onto a device, however, they are pulled into the .apk file at build time.(库项目不会被安装到设备之中,只会被打包到apk文件之中。)


Android Projects


src/

Contains your stub Activity file, which is stored at src/your/package/namespace/ActivityName.java. All other source code files (such as .java or .aidl files) go here as well.

bin/

Output directory of the build. This is where you can find the final .apk file and other compiled resources.

jni/

Contains native code sources developed using the Android NDK. For more information, see the Android NDK documentation.

gen/

Contains the Java files generated by ADT, such as your R.java file and interfaces created from AIDL file

assets/

This is empty. You can use it to store raw asset files. Files that you save here are compiled into an .apk file as-is, and the original filename is preserved. You can navigate this directory in the same way as a typical file system using URIs and read files as a stream of bytes using the AssetManager. For example, this is a good location for textures and game data.


res/

Contains application resources, such as drawable files, layout files, and string values. See Application Resources for more information.


     anim/
 For XML files that are compiled into animation objects. See the  Animation resource type.(存那些可以被编译成动画资源的xml文件)
    color/
For XML files that describe colors. See the  Color Values resource type.
    anim/
     For XML files that are compiled into animation objects. See the  Animation resource type.(存那些可以被编译成动画资源的xml文件)
drawable/
For bitmap files (PNG, JPEG, or GIF), 9-Patch image files, and XML files that describe Drawable shapes or Drawable objects that contain multiple states (normal, pressed, or focused). See the  Drawable resource type.
    anim/
     For XML files that are compiled into animation objects. See the  Animation resource type.(存那些可以被编译成动画资源的xml文件)
    layout/
XML files that are compiled into screen layouts (or part of a screen). See the  Layout resource type.
    menu/
For XML files that define application menus. See the  Menus resource type

    raw/
For arbitrary raw asset files(任意的原始资源都可以放在这里). Saving asset files here instead of in the  assets/ directory only differs in the way that you access them(和assets/目录的不同之处就是 访问资源的方法不同). These files are processed by aapt and must be referenced from the application using a resource identifier in the  R class(使用aapt来处理,并通过R.来引用). For example, this is a good place for media, such as MP3 or Ogg files.
    values/
For XML files that are compiled into many kinds of resource. Unlike other resources in the  res/ directory, resources written to XML files in this folder are not referenced by the file name. Instead, the XML element type controls how the resources is defined within them are placed into the  R class.
    xml/
For miscellaneous XML files that configure application components. For example, an XML file that defines a PreferenceScreenAppWidgetProviderInfo, or  Searchability Metadata. See  Application Resources for more information about configuring these application components.
libs/
Contains private libraries 放一些私有库文件

AndroidManifest.xml
The control file that describes the nature of the application and each of its components. For instance, it describes: certain qualities about the activities, services, intent receivers, and content providers; what permissions are requested; what external libraries are needed; what device features are required, what API Levels are supported or required; and others. See the AndroidManifest.xml documentation for more information( 项目package application activity 等 )
project.properties
This file contains project settings, such as the build target(项目设置文件,如当前的构建目标API level). This file is integral to the project, so maintain it in a source revision control system. To edit project properties in Eclipse, right-click the project folder and select Properties.
local.properties
Customizable computer-specific properties for the build system. If you use Ant to build the project, this contains the path to the SDK installation. Because the content of the file is specific to the local installation of the SDK, the local.properties should not be maintained in a source revision control system. If you use Eclipse, this file is not used.
ant.properties
Customizable properties for the build system. You can edit this file to override default build settings used by Ant and also provide the location of your keystore and key alias so that the build tools can sign your application when building in release mode. This file is integral to the project, so maintain it in a source revision control system. If you use Eclipse, this file is not used.
build.xml
The Ant build file for your project. This is only applicable for projects that you build with Ant.(用Ant构建时才有用)

    anim/
     For XML files that are compiled into animation objects. See the  Animation resource type.(存那些可以被编译成动画资源的xml文件)
color/
For XML files that describe colors. See the  Color Values resource type.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值