screen 這個就可以解決我們的問題
cd /usr/ports/sysutils/screen; make install clean
String ServerAddress = "http://192.168.0.1";
String DataA = "1"; String DataB = "2";
String result = "";
List<NameValuePair> params = new ArrayList<NameValuePair>(); params.add(new BasicNameValuePair("AA",DataA )); params.add(new BasicNameValuePair("BB",DataB )); HttpPost httpRequest = new HttpPost(ServerAddress); try { httpRequest.setEntity(new UrlEncodedFormEntity(getParams(),HTTP.UTF_8)); HttpResponse mHttpResponse = new DefaultHttpClient().execute(httpRequest); if(mHttpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK){ result = EntityUtils.toString(mHttpResponse.getEntity()); } } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); }
params.add(new BasicNameValuePair("AA",DataA ));
if(mHttpResponse.getStatusLine().getStatusCode() == HttpStatus.SC_OK){ result = EntityUtils.toString(mHttpResponse.getEntity()); }
public static String md5Encode(String str) { StringBuffer buf = new StringBuffer(); try { MessageDigest md5 = MessageDigest.getInstance("MD5"); md5.update(str.getBytes()); byte bytes[] = md5.digest(); for(int i = 0; i < bytes.length; i++) { String s = Integer.toHexString(bytes[i] & 0xff); if(s.length()==1) { buf.append("0"); } buf.append(s); } } catch(Exception ex) { } return buf.toString(); }
//將資料寫入JSONArray JSONArray result = new JSONArray(json_data); //取出陣列內所有物件 for(int i = 0;i < result.length(); i++) { //取出JSON物件 JSONObject stock_data = result.getJSONObject(i); //取得物件內資料 System.out.println("t:"+stock_data.getString("t")); System.out.println("l_cur:"+stock_data.getString("l_cur")); System.out.println("c:"+stock_data.getString("c")); System.out.println("cp:"+stock_data.getString("cp")); }
TextView textview = (TextView) findViewById(R.id.textview1); Paint paint = textview.getPaint(); paint.setFlags(Paint.STRIKE_THRU_TEXT_FLAG); paint.setAntiAlias(true);
TextView textview = (TextView) findViewById(R.id.textview1); Paint paint = textview.getPaint(); paint.setFlags(Paint.ANTI_ALIAS_FLAG); paint.setAntiAlias(true);