摘要: 抛砖引玉,是高手,看代码就行,一看就懂,为了节约时间,注释和解说就不写了,累赘package com.van.SAXparse;public class Person{ private int id; private String name; private Short age; private int height; private String profession; public int getId() { return id; } public void setId(int id) { this.i... 阅读全文
posted @ 2012-01-03 16:33 程序学习笔记 阅读(306) 评论(0) 推荐(0) 编辑
摘要: 1.首先,在values文件夹下定义一个atts.xml的文件,描述自定义的控件的属性,在values/attrs.xml中的代码如下:<?xml version="1.0" encoding="utf-8"?><resources> <declare-styleable name="TestView"> <attr name="textColor" format="color" /> <attr name="textSize&qu 阅读全文
posted @ 2012-01-03 16:25 程序学习笔记 阅读(433) 评论(2) 推荐(0) 编辑
摘要: package com.vanceinfo.KeyEvent;import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.view.MotionEvent;import android.view.View;import android.view.View.OnClickListener;import android.widget.Button;import android.widget.Toast;public class KeyEventActivity ex 阅读全文
posted @ 2012-01-03 16:17 程序学习笔记 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 1 建立Http连接的步骤:1.1 获得一个http的连接地址(如:String httpurl = "http://192.168.0.68:8090/Test/index.jsp?par=this-is-get-Method-request!";)1.2 构造一个URL对象(如:url = new URL(httpurl);)1.3 使用HttpURLConnection打开一个连接(如:HttpURLConnection httpConnection = (HttpURLConnection) url.openConnection();)1.4 得到读取的内容(流)( 阅读全文
posted @ 2012-01-03 16:14 程序学习笔记 阅读(543) 评论(0) 推荐(0) 编辑
摘要: 1 /TestGridView/res/layout/main.xml:<?xml version="1.0" encoding="utf-8"?><GridView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_par 阅读全文
posted @ 2012-01-03 16:09 程序学习笔记 阅读(192) 评论(0) 推荐(0) 编辑
摘要: 1 try 2 { 3 String serialnum = null; 4 Class<?> c = Class.forName("android.os.SystemProperties"); 5 Method get = c.getMethod("get", String.class,String.class); 6 serialnum = (String)(get.invoke(c, "ro.serialno","unknown")); 7 seria... 阅读全文
posted @ 2012-01-03 16:01 程序学习笔记 阅读(546) 评论(0) 推荐(0) 编辑