摘要: import android.app.Activity;import android.content.Context;import android.content.SharedPreferences;import android.content.SharedPreferences.Editor;import android.os.Bundle;import android.view.View;import android.widget.Button;import android.widget.EditText;public class XMLfileActivity extends Activ 阅读全文
posted @ 2011-12-08 17:06 乌托邦. 阅读(1580) 评论(0) 推荐(0) 编辑
摘要: import java.io.IOException;import java.io.InputStream;import java.util.ArrayList;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import org.w3c.dom.Document;import org.w3c.dom.Node;import org.w3c.dom.NodeL 阅读全文
posted @ 2011-12-08 17:05 乌托邦. 阅读(192) 评论(0) 推荐(0) 编辑
摘要: import myAndroid.parseData.*;import java.util.*;import java.io.*;import javax.xml.parsers.*;import javax.xml.parsers.SAXParserFactory;import org.xml.sax.Attributes;import org.xml.sax.SAXException;import org.xml.sax.helpers.DefaultHandler;//XML文件解析类public class parseXML{public List<Student> get 阅读全文
posted @ 2011-12-08 17:04 乌托邦. 阅读(213) 评论(0) 推荐(0) 编辑
摘要: public static void saveXML(ArrayList<Student> students,OutputStream outStream) throws IllegalArgumentException, IllegalStateException, IOException{//获取对象XmlSerializer serial=Xml.newSerializer();//读出到输出流并且设置输出流的编码格式serial.setOutput(outStream, "UTF-8");//文件开始serial.startDocument(" 阅读全文
posted @ 2011-12-08 17:03 乌托邦. 阅读(164) 评论(0) 推荐(0) 编辑
摘要: InputStream in=getClass().getClassLoader.getResourseAsStream("文件名");//返回注:文件放到跟目录直接写文件名FileInputStream instr=context.openFileInput(name);//通过上下文变量获取输入文件流FileOutputStream stream=context.openFileOutput(name, Context.MODE_PRIVATE);//获取文件输出流File file=new File(Environment.getExternalStorageDire 阅读全文
posted @ 2011-12-08 17:01 乌托邦. 阅读(1174) 评论(0) 推荐(0) 编辑
摘要: import java.io.*;import android.content.Context;import android.os.Environment;public class SaveFile{//获取上下文变量private Context context;public SaveFile(Context context){super();this.context = context;} /*** @param name* @param content* @throws IOException*/public void save(String name,String content) t 阅读全文
posted @ 2011-12-08 16:05 乌托邦. 阅读(123) 评论(0) 推荐(0) 编辑
摘要: public void onClick(View arg0){// TODO Auto-generated method stubEditText text=(EditText)MyMessageActivity.this.findViewById(R.id.message);EditText phonenum=(EditText)MyMessageActivity.this.findViewById(R.id.phone);SmsManager manager=SmsManager.getDefault();ArrayList<String> texts= manager.div 阅读全文
posted @ 2011-12-08 16:02 乌托邦. 阅读(134) 评论(0) 推荐(0) 编辑
摘要: public void onClick(View arg0) {// TODO Auto-generated method stubEditText edittext1=(EditText)MyFirstAndroidActivity.this.findViewById(R.id.text1);String str=edittext1.getText().toString();Intent intent1 = new Intent();intent1.setAction("android.intent.action.CALL");intent1.setData(Uri.pa 阅读全文
posted @ 2011-12-08 16:00 乌托邦. 阅读(90) 评论(0) 推荐(0) 编辑