摘要: public class FileUtils{private String SDK;public String getSDk(){return SDK;}public FileUtils(){//得到当前外部存储设备的目录SDK=Environment.getExternalStorageDirectory()+"/"}//在SD卡上创建文件public File creatSDFile(String fileName)throws IOException{File file =new File(SDK+fileName);file.createNewFile();retu 阅读全文
posted @ 2011-09-12 17:11 WangWeiDa 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 1,为了下次使用的更方便我封装了一个文件与媒体下载的HttpDownloader类的代码如下:// 此方法是为Text文件下载public class HttpDownloader{//声明url对象,为传递地址使用private URL url=null;//文件下载封装方法public String download(String urlStr){//声明StringBuffer对象StringBuffer sb=new StringBuffer();//为读取数据储存使用String line =null;//声明读取数据的对象BufferedReader buffer =null;tr 阅读全文
posted @ 2011-09-12 10:02 WangWeiDa 阅读(303) 评论(0) 推荐(1) 编辑
摘要: //创建一个线性布局<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"android:orientation="vertical" android:layout_width="fill_parent"android:layout_height="wrap_content">//创建一个文本<TextView android:layout_width="wrap_content" and 阅读全文
posted @ 2011-09-09 16:27 WangWeiDa 阅读(324) 评论(2) 推荐(0) 编辑
摘要: 上为Spinner的视图一下为Spinner的视图二 阅读全文
posted @ 2011-09-09 15:51 WangWeiDa 阅读(222) 评论(0) 推荐(0) 编辑
摘要: Sprinner有2个主要的使用方法,第一个是基于在ArrayAdapter上的,一个是基于自己定义的List中的,这2个方法的使用都会产生一个下拉表单,但是用户点击后效果不同,前者是Android自带的,后者是开发者自己定义的!下面就展示2中下拉表单的使用代码:public class SpinnerActivity extends Activity {//创建2个Spinner的对象Spinner spinner_c;Spinner spinner_2;//创建一个Adapter对象(方法一的使用)private ArrayAdapter<String> aspnCountri 阅读全文
posted @ 2011-09-09 15:34 WangWeiDa 阅读(1229) 评论(0) 推荐(0) 编辑
摘要: <?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"><Textv 阅读全文
posted @ 2011-09-04 18:50 WangWeiDa 阅读(656) 评论(0) 推荐(0) 编辑
摘要: public class RadioText extend Activity{ private RadioGroup genderGroup =null; private RadioButton vsButton=null; private RadioButton nsButton=null; public void onCreate(Bundle saveIntstanceState){ super.onCreate(saveIntstancestate); setContentView(R.layout.main2); genderGroup=(RadioGroup)find... 阅读全文
posted @ 2011-09-04 18:49 WangWeiDa 阅读(350) 评论(0) 推荐(0) 编辑
摘要: public class Activity extend Activity{ private Button myButton =null; public void onCreate(Bundle saveIntstanceState){ super.onCreate(saveIntstancestate); setContentView(R.layout.main); myButton =(Button) findViewById(R.id.myButton); myButton.setOnClickLisener(new MyButtonListener); }class MyB... 阅读全文
posted @ 2011-09-01 22:35 WangWeiDa 阅读(241) 评论(0) 推荐(1) 编辑
摘要: 简单的android(Activity之间跳转样例代码) 阅读全文
posted @ 2011-08-25 10:21 WangWeiDa 阅读(1525) 评论(0) 推荐(0) 编辑