上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 37 下一页
摘要: 1.Md5(unrecommented)public static String md5(String string) { byte[] hash; try { hash = MessageDigest.getInstance("MD5").digest(string.getBytes("UTF-8")); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Huh, MD5 should be supported?", e); } catch (Uns 阅读全文
posted @ 2012-08-14 15:06 Epirus 阅读(1557) 评论(0) 推荐(0) 编辑
摘要: 1.give permission : code:<uses-permission android:name="android.permission.READ_PHONE_STATE" />2.textView=(TextView)findViewById(R.id.textView);textView.setText(((TelephonyManager) getSystemService(TELEPHONY_SERVICE)).getDeviceId()); 阅读全文
posted @ 2012-08-14 09:19 Epirus 阅读(546) 评论(0) 推荐(0) 编辑
摘要: KeyPoint: 1.HttpClientConnection 默认是使用Get的方式的 Get方式的KeyCode Getclass DownloadTask extends AsyncTask<String, Integer, String>{ String resultData="lee"; @Override protected String doInBackground(String... params) { try { URL url=new URL("http://... 阅读全文
posted @ 2012-08-13 19:09 Epirus 阅读(1149) 评论(0) 推荐(0) 编辑
摘要: 为了获取更佳的用户体验我们使用Asynctaskkeypoint: doInBackground():只有一点,不要去操作UI,因为其他线程不能操作UI主线程,其他都OK onPostExecute():将回到主线程中,操作数据,所以下面给各列子 据说这种类,不适合多次的调用?有待实验?AsyncTaskpackage com.example.comunicationwithserver;import java.io.BufferedReader;import java.io.ByteArrayOutputStream;import java.io.IOException;impo... 阅读全文
posted @ 2012-08-13 15:39 Epirus 阅读(284) 评论(0) 推荐(0) 编辑
摘要: try{ Socket socket = ss.accept(); }finally { ss.close(); } }不论发布发生EXCEPTION 都会执行finally中的CODE 阅读全文
posted @ 2012-08-13 09:37 Epirus 阅读(127) 评论(0) 推荐(0) 编辑
上一页 1 ··· 23 24 25 26 27 28 29 30 31 ··· 37 下一页