还是看的黎活明老师的Android视频。

上一张图先

1、gen/R.java  ==== 该类由开发工具维护。大概就和做MFC开发的资源文件类似(自家观点)

package com.helloWorld; public final class R {     public static final class attr {     }     public static final class drawable {         public static final int icon=0x7f020000;     }     public static final class id {         public static final int Button01=0x7f050000;         public static final int Button02=0x7f050001;     }     public static final class layout {         public static final int hello_world=0x7f030000;     }     public static final class string {         public static final int Button01=0x7f040002;         public static final int app_name=0x7f040001;         public static final int hello=0x7f040000;     } }

 

2、assert 目录  ==== 放在此文件夹下的文件,打包之时,会被原样打包。

3、res/drawable-hdpi、res/drawable-ldpi、res/drawable-mdpi 文件夹下都存放着一个.png图形文件,相当于资源吧,分别对应高低中像素的图标

4、res/layyout ==== 里面的 .xml 是界面布局文件  === 功能是类似于html

     xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:orientation="vertical"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     >     <TextView          android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:text="@string/hello"         />     <Button         android:text="@string/Button01"         android:id="@+id/Button01"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         />     <Button         android:text="@string/Button01"         android:id="@+id/Button02"         android:layout_width="wrap_content"         android:layout_height="wrap_content"         /> LinearLayout>" encoding="utf-8"?>      hello">Hello World, java!     app_name">hello_world     Button01">Clock me 

 

5、res/values ===== 里面的 .xml 是一些字符串资源。和MFC类似

    1.0

 

6、AndroidMainfest.xml ==== 功能清单文件

7、default.properties  ==== 该文件不需开发者维护

MVC模式
C == Activity 类;V == .xml文件;M==自己写、业务层、业务代码
此种模式结构良好。

package com.helloWorld.stub;import javax.xml.parsers.SAXParserFactory;import com.helloWorld.R;import android.app.Activity;import android.app.AlertDialog;import android.os.Bundle;import android.os.Environment;import android.view.View;import android.widget.Button;public class java extends Activity {@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.hello_world);// Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);// SAXParserFactoryButton button = (Button) findViewById(R.id.Button01);button.setOnClickListener(new View.OnClickListener() {public void onClick(View v) {// Perform action on clickopenDialog();}});}public void openDialog() {AlertDialog.Builder builder = new AlertDialog.Builder(this);builder.setTitle("Hll www");builder.setMessage("Hello world/nwuhuiwen/n");builder.setNegativeButton("OK", null);builder.show();}}

 

setContentView() ; // 引用某个界面,显示界面。

五种布局:
1、LinearLayout、线性布局,一个元素独占一行
2、AbsoluteLayout、绝对布局(慎用)
3、RelativeLayout 、相对布局
4、TableLayout、表格布局
5、FrameLayout、帧布局。每个元素为一帧,产生动画效果


学习交流>^<欢迎拍砖

更多相关文章

  1. 一款常用的 Squid 日志分析工具
  2. GitHub 标星 8K+!一款开源替代 ls 的工具你值得拥有!
  3. RHEL 6 下 DHCP+TFTP+FTP+PXE+Kickstart 实现无人值守安装
  4. Linux 环境下实战 Rsync 备份工具及配置 rsync+inotify 实时同步
  5. [Android]文件操作模式与SDCard读写访问
  6. android - open failed: EROFS (Read-only file system)
  7. android application access sdcard安卓应用访问sdcard
  8. Android(安卓)UI 之 ListView
  9. androd fsck分析

随机推荐

  1. android证书指纹的生成
  2. Android(安卓)设计模式之策略模式
  3. android 权限库EasyPermissions
  4. 谷歌官方Android应用架构库——处理生命
  5. android学习——activity实现动画切换
  6. Android系统的四大组件详解
  7. ps图片黑白调整算法——Android实现及性
  8. android 保存Bitmap到本地图片
  9. 懒人爱家务_Android中的Selector的用法
  10. 使用startForeground让android服务前台运