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?
Asked
Active
Viewed 2,590 times
1
-
you may use background threads to initiate the connection to server and get the latest apt version. Then you can compare one obtained at your client ape version. if the server one is greater than the client one, prompt the dialog or notification to urge user to access the website to download the apt – Jeff Bootsholz Jun 05 '14 at 08:28
-
I think the author has another purpose to get the latest version from another server instead of Google Play – Jeff Bootsholz Jun 05 '14 at 08:30
-
What I would like to achieve initially is not to update but to install new programs that they will see on a website - from there they can click "download to my device". Its an academic project, this is why I cannot use Google play - my project is to build an appstore. – user3104316 Jun 05 '14 at 08:35
-
seems like you did not do any reseach before asking this question - there is no way to install non Google Play app silently on non rooted devices ... – Selvin Jun 05 '14 at 08:37
-
If not silently - maybe with a prompt to the user – user3104316 Jun 05 '14 at 08:47
2 Answers
1
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.

Community
- 1
- 1

Shivam Verma
- 7,973
- 3
- 26
- 34
-
-
You can use GCM to send a message to your device. Check out http://developer.android.com/google/gcm/adv.html#payload Now whenever a relevant message is received from the server, you know that you have to start the download of the apk from your own server. – Shivam Verma Jun 05 '14 at 09:13
-
Thanks it works like a charm. GCM is a very powerful tool for Android. – user3104316 Aug 17 '14 at 20:57
0
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!

Bipin Bhandari
- 2,694
- 23
- 38