I want to install program update. my code is:
private void installApk(File file) {
if(file.exists()){
try {
final String command = "pm install -r " + file.getAbsolutePath();
Process proc = Runtime.getRuntime().exec(command);
proc.waitFor();
} catch (Exception e) {
e.printStackTrace();
}
}
}
permission:
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.INSTALL_PACKAGES"/>
signed my app with signAPK. this program not work.please help me!