I have stored a .apk file for another app in my /res/raw directory and wish to give the user a prompt to install it. Here's my current code:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(new File("android.resource://" + getPackageName() + "/res/raw/myapk.apk")), "application/vnd.android.package-archive");
startActivity(intent);
However, when the intent runs, I get a Parse error: There is a problem parsing the package.
The .apk file is the one created by eclipse in the /bin directory when I run the other application.
How would I accomplish this programmatic local install correctly?