Thursday, 29 June 2017

DOS Mode Setup

$ ./adb shell dumpsys battery unplug
$ ./adb shell dumpsys battery
Must device power off then command
$ ./adb shell dumpsys deviceidle enable
$ ./adb shell dumpsys deviceidle step
Stepped to: IDLE_PENDING (again $ ./adb shell dumpsys deviceidle step)
Stepped to: SENSING (again $ ./adb shell dumpsys deviceidle step)
Stepped to: LOCATING (again $ ./adb shell dumpsys deviceidle step)
Stepped to: IDLE_MAINTENANCE (again $ ./adb shell dumpsys deviceidle step)
Stepped to: IDLE (No more any command cz this is idel state)
Ok :) successfully idle state

force-idle:
$ ./adb shell dumpsys deviceidle force-idle
$ ./adb shell dumpsys deviceidle

Back to normal state:
$ ./adb shell dumpsys deviceidle disable
$ ./adb shell dumpsys battery reset

Friday, 29 June 2012

Android Device ID (UDID)


public void getDeviceID() {

// There are three types of identifier on android phone.

// IMEI
// IMSI

String ts = Context.TELEPHONY_SERVICE;
TelephonyManager mTelephonyMgr = (TelephonyManager) getSystemService(ts);
String imsi = mTelephonyMgr.getSubscriberId();
String imei = mTelephonyMgr.getDeviceId();
// Android ID It is a 64-bit hex string which is generated on the
// device's first boot. Generally it won't changed unless is factory
// reset.

String android_id = Secure.getString(getContentResolver(),
Secure.ANDROID_ID);//This is also called UDID

}