All posts by Nandan Dubey

About Nandan Dubey

I am from a small village in Bihar. Currently, I am studying in Indian Institute of Technology(Kanpur) with Computer Science as major.

AOSP change default time zone

android default time zone

set deafult timezone

getprop persist.sys.timezone

setprop persist.sys.timezone “Asia/Kolkata”

getprop persist.sys.timezone
shell@ASUS_Z010:/ $ setprop persist.sys.timezone “America/Chicago”

Even easier is to do from AOSP side is via

– persist.sys.timezone=Asia/Shanghai \
+ persist.sys.timezone=Asia/Kolkata \ \

adb launch any app

adb launch any app

like camera app
default if someone has already modified then it will launch their app

Image capture mode: adb shell “am start -a”

Video capture mode: adb shell “am start -a”

adb launch home app

am start -c android.intent.category.HOME -a android.intent.action.MAIN

am start -n
but I have already made my app as home so will not do

Start any app by just the package name

adb shell monkey -p -c android.intent.category.LAUNCHER 1

monkey command

monkey -p com.nandan.mylauncher -c android.intent.category.LAUNCHER 1

Launch any app


adb shell monkey -p -c android.intent.category.LAUNCHER 1

adb shell monkey -p com.vaultmicro.camerafi -c android.intent.category.LAUNCHER 1

monkey -p com.vaultmicro.camerafi -c android.intent.category.LAUNCHER 1

am start -n com.nandan.myapp/.MyCustomAppActivity

Grant revoke permission

abd shell pm [grant|revoke] android.permission.ACCESS_FINE_LOCATION

pm grant com.vaultmicro.camerafi android.permission.CAMERA

Starting a service from activity[same app]

Starting a service from activity[same app]

Intent it = new Intent(context, YourIntentService.class);
it.putExtra("Key", "Value");

or context.startService(it)

Service.START_STICKY Service is restarted if it gets terminated. Intent data passed to the onStartCommand method is null. Used for services which manages their own state and do not depend on the Intent data.

public YourIntentService() {

Qt android calling from java to C++

From java to C++

First define a native function declaration inside java code.

public static native void setAction(int arg);

This can be used for invoke function connection from java code in the form:


This is all from java side since all the job is made from C++ side.

extern “C”

JNIEXPORT void JNICALL Java_com_cnx_eyerismain_MyCustomAppService_setAction(JNIEnv env, jobject obj, jint action)
qDebug()<<"****** eyeris_main onReceiveAction"<<action;
// call MainWindow::onReceiveMounted from Qt thread

qDebug()<<"can tell here that message is received "<<action;
globalIsNewAction = true;
globalCurrentAction = action;