I'm looking for a sample web page (html code) with a link that will install an apk file directly on my phone by clicking on the link.
The second is to download and do it yourself. Here's how to do both. Download the APK you want to install and tap the notification to begin the installation. Go into your settings at the prompt to give your browser installation permission, and then follow the prompts after that to install your APK.
For this, you'll need to set up ADB functionality on your Chromebook (ADB = Android Debug Bridge). Once you have ADB on your Chromebook, you can install any APK on your Chromebook. Simply save APKs in your Linux folder, then open Terminal and enter the “adb install filename. apk” command.
Take the APK you want to install (be it Google's app package or something else) and drop the file into the tools folder in your SDK directory. Then use the command prompt while your AVD is running to enter (in that directory) adb install filename. apk . The app should be added to the app list of your virtual device.
Just link to the apk file in the HTML. It couldn't be any simpler.
<a href="path to my .apk file">link</a>
You will have to have "install apps from unknown sources" enabled on your phone.
If you're using ASP.NET, then you'll need to insert the following in your web.config file:
<configuration>
...
<system.webServer>
<staticContent>
<mimeMap fileExtension=".apk"
mimeType="application/vnd.android.package-archive" />
</staticContent>
</system.webServer>
...
</configuration>
Apart from that (as others have said), you just need a normal link:
<a href="myAndroidApp.apk">Click here</a>
and tell your users to enable the Security -> Unknown sources option in Settings.
Extra help for IIS webservers: mbaird's example worked great for me after I added the apk mime type to my IIS webserver. I just put an html file up with that link, but got a 404 error when trying to pull up my test.apk file without the .apk mime entry. As Commonsware said, make sure to allow .apk files in the mime types - this is for sure still necessary on an IIS webserver. You can do this from IIS Manager, select the server, and find "Mime Types", then add an entry.
In .Net this is what I did, I created an .asmx
page then a QR code that pointed to it
other wise I kept getting a 404, then this on page load.
protected void Page_Load(object sender, EventArgs e){
ViewState["PreviousPage"] = Request.UrlReferrer;
string filepath = Server.MapPath("AcsMainMenu.apk");
FileInfo droidfile = new FileInfo(filepath);
if (droidfile.Exists)
{
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment; filename=" + droidfile.Name);
Response.AddHeader("Content-Length", droidfile.Length.ToString());
Response.ContentType = "application/vnd.android.package-archive";
Response.TransmitFile(droidfile.FullName);
Response.Flush();
Response.End();
Response.Redirect(ViewState["PreviousPage"].ToString());
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With