From my Android application, I download apk from the Internet, storing it in a private application store (openFileOutput(FILENAME, Context.MODE_PRIVATE))
and trying to call the installer of the Android package for this downloaded apk by,
intent.setDataAndType(Uri.fromFile(f), "application/vnd.android.package-archive");
startActivity(intent);
but i get an error
Unable to open zip: /data/data/com.test/files/abc.apk : Permission denied
in logcat
and,
Parse Error: There is a problem parsing the package
on the phone screen.
Is this because the apk file is in a closed application store, so the Android package installer cannot access it? If so, is it possible to somehow somehow install apk (with the permission of the user, of course.) Or am I something wrong?
PS: Please do not assume that the phone will be rooted.
source
share