Reputation: 31
I use Eclipse to create android application (1). Now, I want this application can open and install file apk (2) inside application (1).
file apk (2) inside android project example: Android project/res/drawable/file.apk
When open android application (1) esle have button. When click button esle install file.apk
Upvotes: 3
Views: 3945
Reputation: 166
I think this question has already been answered before here: Install Application programmatically on Android
This is the part I think you need, I have just copied it from the link above in case that link breaks or something.
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
Like the guy in the other post says this will ask the user if they want to install the apk. You can't force an apk install unless the device is rooted and your program has root.
Upvotes: 1