I written a application which install the apk to device. I stored the apk in sd card. I tried Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File("/sdcard/MyApp.apk")), "application/vnd.android.package-archive");
startActivity(intent);
But I will get a window to ask wether to install or not. I do not need user intervention to install my .apk. What I can try?
So i tried to install using command line arguement Runtime.getRuntime()
.exec("adb -d install /sdcard/MyApp.apk");
I am getting null environment error. How can I access to apk in sd card and how can I install it?
Thanks for the help.