I've developed some android games and created .apk file..
I've put these .apk files on my website (say: http://www.sush19.com/androidApp/apk/myGame1.apk)
Is it possible to directly install this game when this url visit from another app onClick()
event.
I don't want user to download .apk fine to their sdcard and then install manually, infact the game should be installed directly to the device.
I was trying below code in my another app onClick()
event:
Intent goToMarket = new Intent(Intent.ACTION_VIEW).setData(Uri.parse("http://www.sush19.com/androidApp/apk/myGame1.apk"));
startActivity(goToMarket);
I know the above code is not correct.. but can anyone comment on this..
Who is maintaining server for your apk because for this you have to do some server setting: set the MIME type of your folder on server containing this apk file as
.apk
andapplication/vnd.android.package-archive
. Then it will automatically get installed on clicking the link similarly as that of any other app from google play.The below code, allow user to Download, Install and Delete .apk file on Android device. I've created an Android app (Say App1), which downloads other android apps on SD card. On Button click in App1, it will download the .apk file from my own website on Background, on download complete it will prompt user to install the app downloaded recently from App1 and after the installation is completed the downloaded .apk file will be deleted from the SD card.
In my App1 main activity: I've included button
In my case I'm launching my other applications from App1, if not installed on the device, I'm downloading it from my website and installing it.
button click event method
InstallAPK Class
To delete downloaded file from SD card I've used BroadcastReceiver class
Don't forget to include following permission in the AndroidManifest.xml
In my website, I create two .aspx pages and placed it inside Android folder and .apk files inside Android/Games folder in Visual Studio
First page: marketplace.aspx.cs
Second Page: gamedownload.aspx.cs
I added following code in Web.config file
I hope this information will be help full for some people.