Page 130 - 3-2
P. 130
try{
Log.d(" 여긴가", "9.6_purcharse, 테이블 2 로 이동");
String link = "http://192.168.0.85/purchase.php";
URL url = new URL(link);
HttpURLConnection urlConnection = (HttpURLConnection)url.openConnection();
BufferedReader in = new BufferedReader(new
InputStreamReader(urlConnection.getInputStream()));
StringBuffer sb = new StringBuffer("");
String line="";
while ((line = in.readLine()) != null) {
sb.append(line);
Log.d(sb.toString(),"created result");
break;
}
in.close();
Log.d(" 여긴가", "9.7_purcharse, 복사함");
Intent intent = new Intent(getApplicationContext(),MainActivity.class);
Log.d(" 여긴가", "9.888_ 원래화면으로 돌아감 테이블 은 지워지고 테이블, 1 2 가 추가된
상태");
startActivity(intent);
return sb.toString();
} catch(Exception e){
Log.d(" 여긴가", "9.8_purcharse, 복사못함");
return new String("Exception: " + e.getMessage());
}
}
}
private class ReadMifareClassicTask extends AsyncTask<Void, Void, Void> {
/*
MIFARE Classic tags are divided into sectors, and each sector is sub-divided into
blocks.
Block size is always 16 bytes (BLOCK_SIZE). Sector size varies.
MIFARE Classic 1k are 1024 bytes (SIZE_1K), with 16 sectors each of 4 blocks.
*/
- 130 -