摘要: 1 private void connect() { 2 MyTask task = new MyTask(this); 3 task.execute(url.getText().toString()); 4 } 5 6 private class MyTask extends AsyncTask { 7 private Context ctx; 8 private ProgressDialog pdialog; 9 public MyTask(Conte... 阅读全文
posted @ 2014-01-03 17:55 Shuaiwen8023 阅读(224) 评论(0) 推荐(0) 编辑
摘要: package com.example.test;import java.io.ByteArrayOutputStream;import java.io.InputStream;import org.apache.http.HttpEntity;import org.apache.http.HttpResponse;import org.apache.http.HttpStatus;import org.apache.http.client.HttpClient;import org.apache.http.client.methods.HttpGet;import org.apache.ht 阅读全文
posted @ 2014-01-03 17:19 Shuaiwen8023 阅读(312) 评论(0) 推荐(0) 编辑
摘要: private Handler mHandler = new Handler(){ @Override public void handleMessage(Message msg) { // TODO Auto-generated method stub if(nProgressDialog != null && nProgressDialog.isShowing()){ nProgressDialog.dismiss(); } ... 阅读全文
posted @ 2013-12-31 11:27 Shuaiwen8023 阅读(199) 评论(0) 推荐(1) 编辑
摘要: 1 package com.ieslab.app.socket; 2 3 import java.io.IOException; 4 5 /** 6 * 7 * 8 * 名称:类 9 * 10 * 功能:描述11 * 12 * 日期:2013-12 modify by 蔺13 * 14 * 15 */16 17 //单例模式 18 public class XclSingleton 19 { 20 //单例模式实例 21 private static XclSingleton instance = null; 22 23 ... 阅读全文
posted @ 2013-12-31 09:31 Shuaiwen8023 阅读(336) 评论(0) 推荐(0) 编辑
摘要: 1 //取消配对代码:2 Method m = mTouchObject.bluetoothDevice.getClass().getMethod("removeBond");3 m.invoke(mTouchObject.bluetoothDevice);4 //配对代码:初始化socket :5 Method m = mTouchObject.bluetoothDevice.getClass().getMethod("createRfcommSocket", new Class[] {int.class});6 temp = (BluetoothSo 阅读全文
posted @ 2013-12-26 20:02 Shuaiwen8023 阅读(244) 评论(0) 推荐(0) 编辑
摘要: public class MyListView extends ListView{ public MyListView(Context context, AttributeSet attrs) { super(context, attrs); } public MyListView(Context context) { super(context); } public MyListView(Context context, AttributeSet attrs, int defStyle) { super(context, at... 阅读全文
posted @ 2013-07-26 17:46 Shuaiwen8023 阅读(3275) 评论(0) 推荐(0) 编辑
摘要: package com.eoe.xmlresolve.utils;import java.io.IOException;import java.io.InputStream;import java.util.ArrayList;import java.util.List;import javax.xml.parsers.DocumentBuilder;import javax.xml.parsers.DocumentBuilderFactory;import javax.xml.parsers.ParserConfigurationException;import javax.xml.pars 阅读全文
posted @ 2013-07-23 15:31 Shuaiwen8023 阅读(755) 评论(0) 推荐(0) 编辑
摘要: /** * 自定义的对话框Custom_Dialog */ private void showDialog() { // 获取自定义布局 LayoutInflater inflater = LayoutInflater.from(MainActivity.this); View view = inflater.inflate(R.layout.customDialog, null); //View view = View.inflate(this, R.layout.custom_Di... 阅读全文
posted @ 2013-07-22 14:22 Shuaiwen8023 阅读(405) 评论(0) 推荐(0) 编辑
摘要: public void run() { while (true) { if (socket != null) { try { int read = -1; byte buffer[] = new byte[1024]; InputStream inputStream = BluetoothService.socket.getInputStream(); for (; ... 阅读全文
posted @ 2013-07-18 18:35 Shuaiwen8023 阅读(718) 评论(0) 推荐(0) 编辑
摘要: private class ConnectThread extends Thread { private BluetoothSocket mmSocket; private BluetoothDevice mmDevice; ImprovedBluetoothDevice improvedBluetoothDevice; public ConnectThread(BluetoothDevice device) { mmDevice = device; BluetoothSocket tmp = null; improve... 阅读全文
posted @ 2013-07-18 17:05 Shuaiwen8023 阅读(1346) 评论(0) 推荐(0) 编辑