Professional Documents
Culture Documents
Public Class CelularIMEIActivity Extends AppCompatActivity
Public Class CelularIMEIActivity Extends AppCompatActivity
{
this.NumberCell=(TextView)findViewById(R.id.TxtNumerCelular);
this.CorreoClient=(TextView)findViewById(R.id.TxtCorreoCelular);
}
public void obTenerNumeroCelular()
{
telef=(TelephonyManager)getSystemService(Context.TELEPHONY_SERVICE);
//telef.getSimSerialNumber()
this.NumberCell.setText("IMEI " + telef.getDeviceId() + "\n" +
"Operador" + telef.getSimOperatorName() + "\n" +
"Numero de Telefono" + telef.getLine1Number() + "\n" +
"Version de software" + telef.getDeviceSoftwareVersion()
+ "\n" +
//"Location"+telef.getCellLocation()+"\n"+
"SIN SERIAL" + telef.getSimSerialNumber());
AccountManager
cuenta_manager=AccountManager.get(CelularIMEIActivity.this);
Account[] cuenta=cuenta_manager.getAccounts();
for(Account ac:cuenta)
{
String acname=ac.name;
if(acname.endsWith("@gmail.com"))
{
this.CorreoClient.setText("El correo es : "+acname);
}
}
}
@Override
protected void onStop() {
super.onStop();
Toast.makeText(CelularIMEIActivity.this, "OnStop",
Toast.LENGTH_SHORT).show();
CelularIMEIActivity.this.finish();
}
@Override
protected void onDestroy() {
super.onDestroy();
Toast.makeText(CelularIMEIActivity.this, "OnDestroy",
Toast.LENGTH_SHORT).show();
}
@Override
protected void onResume() {
super.onResume();
Toast.makeText(CelularIMEIActivity.this, "OnResume",
Toast.LENGTH_SHORT).show();
}
@Override
protected void onPause() {
super.onPause();
Toast.makeText(CelularIMEIActivity.this, "OnPause",
Toast.LENGTH_SHORT).show();
}
}