Reputation: 45
I an building and Android application store for my academic project. I would like to implement a feature that would allow the user to browse on their PC and remotely initiate downloads (and preferably installs of APK too) onto their android device - this service is already available with Google Play. Which android functions do I need to implement this?
Upvotes: 1
Views: 2661
Reputation: 8023
You can use Google Cloud Messaging to create an interface using which you can talk to your app from the server. So basically send a simple message from the server which maybe tells the url of the hosted apk file (or any other relevant info). You can then download it to your android device.
After downloading maybe this could help you out : Android: install .apk programmatically
Or :
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
The user will still have to give permissions explicitly to install.
Upvotes: 1
Reputation: 2692
You can install .apk files using android intents.
Intent promptInstall = new Intent(Intent.ACTION_VIEW)
.setDataAndType(Uri.parse("file:///path/to/your.apk"),
"application/vnd.android.package-archive");
startActivity(promptInstall);
So you would have to develop and application that listens to your php webservice and downloads and installs application accordingly.
Good luck!
Upvotes: 0