Android编程入门之HelloWorld项目目录结构分析

2019-12-10 19:45:40丽君

如果你跟我一样是ASP.NET出生或者学过,你会发现AndroidManifest.xml跟web.config文件很像,可以把它类同于web.config文件理解。

如果你不是,你可以这样理解——众所周知xml是一种数据交换格式,AndroidManifest.xml就是用来存储一些数据的,只不过这些数据时关于android项目的配置数据。

HelloWorld项目的AndroidManifest.xml如下所示:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://www.easck.com/apk/res/android"
   package="helloworld.test"
   android:versionCode="1"
   android:versionName="1.0">
  <application android:icon="@drawable/icon" android:label="@string/app_name">
    <activity android:name=".HelloWorld"
         android:label="@string/app_name">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
  </application>
</manifest> 

关于AndroidManifest.xml现在就讲这么多,此系列后面的文章将单独详细介绍。

1.7、default.properties

记录项目中所需要的环境信息,比如Android的版本等。 HelloWorld的default.properties文件代码如下所示,代码中的注释已经把default.properties解释得很清楚了:

# This file is automatically generated by Android Tools.
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
# 
# This file must be checked in Version Control Systems.
# 
# To customize properties used by the Ant build system use,
# "build.properties", and override values to adapt the script to your
# project structure.
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-7

希望本文所述对大家Android程序设计有所帮助。



注:相关教程知识阅读请移步到Android开发频道。