Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

apk installation from web page

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.

like image 535
Arutha Avatar asked Feb 24 '10 18:02

Arutha


People also ask

How do I give my browser permission to install APK?

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.

How do I install APK files in Chrome?

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.

How do I install an APK file on my PC?

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.


4 Answers

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.

like image 140
Mark B Avatar answered Oct 08 '22 01:10

Mark B


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.

like image 40
Richard C Avatar answered Oct 08 '22 01:10

Richard C


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. Example of adding a Mime entry for the apk file in IIS

like image 41
Greg Avatar answered Oct 08 '22 00:10

Greg


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());
    }
}
like image 29
dean Avatar answered Oct 08 '22 00:10

dean