首先我们要知道,android 的官网 http://www.android.com/,在这个网站上我们可以下载android必须的插件SDK,ADT

eclipse:http://www.eclipse.org/

SDK :http://developer.android.com/sdk/index.html

ADT :http://developer.android.com/sdk/eclipse-adt.html

安装和使用都可以通过该网站来了解

要是网速不好,我这里提供两个简单的下载网站:

elipse 集成ADT:http://115.com/file/e7714lk9

SDK 集成 4.0 环境:http://115.com/file/dppjha7d

OK了

要是还不成功,可以把http://115.com/file/ann8wjo7解压到C:\Documents and Settings\Administrator目录下面

第一个文件夹 src:

HelloWorld.java

package com.sun.android;


import android.app.Activity;

import android.os.Bundle;


public class HelloWorld extends Activity {

/** Called when the activity is first created. */

@Override

public void onCreate(Bundle savedInstanceState) {

super.onCreate(savedInstanceState);//声明周期方法

setContentView(R.layout.main);//设置要使用的布局管理器(重要)

}

}

注意:包名称不能是一级的

第二个文件夹:gen(自动生成)

R.java

/* AUTO-GENERATED FILE. DO NOT MODIFY.

*

* This class was automatically generated by the

* aapt tool from the resource data it found. It

* should not be modified by hand.

*/

package com.sun.android;


public final class R {

public static final class attr {

}

public static final class drawable {

public static final int ic_launcher=0x7f020000;

}

public static final class layout {

public static final int main=0x7f030000;

}

public static final class string {

public static final int app_name=0x7f040001;

public static final int hello=0x7f040000;

}

}

注意:该类是自动生成的,包含所有的资源文件

res包下面---------------------------------------------------------

省略无关的文件夹:

第三个文件夹 layout文件夹(存放布局管理器信息)

main.xml

<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" //布局形式:线性布局

android:layout_width="fill_parent" //布局管理器的屏幕宽度:充满付屏幕(当前手机宽度)

android:layout_height="fill_parent" //布局管理器的屏幕高度:充满付屏幕(当前手机高度)

android:orientation="vertical" > -->组建排列形式:垂直排列


<TextView --->文本显示组建

android:layout_width="fill_parent"

android:layout_height="wrap_content" --->文字有多宽 就显示多宽

android:text="@string/hello" /> --->组建默认显示文字


</LinearLayout>

第四个文件夹:values (存放文字信息)

string.xml

<?xml version="1.0" encoding="utf-8"?>

<resources>


<string name="hello">Hello World, HelloWorld!</string>

<string name="app_name">Android</string>//手机中应用程序提示栏中显示的信息


</resources>

----------------------------------------------------------------------------------------------

AndroidManifest.xml()

<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"

package="com.sun.android" //程序所在的包名称

android:versionCode="1" //应用程序版本号

android:versionName="1.0" > //版本号,就是现实 没用


<uses-sdk android:minSdkVersion="15" /> //应用程序所对应的最低SDK版本


<application

android:icon="@drawable/ic_launcher" //图标

android:label="@string/app_name" >

<activity

android:name=".HelloWorld" //对应的activity名称

android:label="@string/app_name" > //表示应用程序的提示信息----都是从R.java文件中来的

<intent-filter> ->表示配置一个activity程序,可以编写多个 //过滤器

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>

</application>


</manifest>

res下面常用的目录:

res/raw存放原生文件,例如视频、音乐

res/xml存放xml配置信息

res/anim用户进行动画效果配置文件

values目录下面常用目录:

arrays.xml

color.xml

styles.xml

AndroidManifest.xml 文件时android项目中最重要的组成部分

整个项目说白了:就是在main.xml里面配置组建,这里的组建直接就到了R.java文件中了,在activity里面调用直接调用R.java文件里面的东西就行了

更多相关文章

  1. 一文详解Android(安卓)轻量级存储方案的前世今生
  2. Android布局优化之Include(一)
  3. Android清除缓存功能实现
  4. Android(安卓)自学之核心服务
  5. Android利用DownloadManager实现文件下载
  6. 高通Android智能平台环境搭建_编译流程分析
  7. Android的NDK开发(5)————Android(安卓)JNI层实现文件的read
  8. Android利用DownloadManager实现文件下载
  9. NPM 和webpack 的基础使用

随机推荐

  1. Android8.0 存储系统
  2. Android打造属于自己的数据库操作类。
  3. Android自定义控件系列九:从源码看Android
  4. Android(安卓)JSON:Gson,FastJson解析库的
  5. 在 Android(安卓)手机上运行 Node.js 应
  6. Android(安卓)创建与解析XML(一)---- SAX方
  7. Android:触摸移动的悬浮窗口
  8. Android线程模型(Painless Threading) ---
  9. android上消息推送的实现
  10. TableLayout中stretchColumns、shrinkCol