Skip to content

September 30, 2012

2

Distribute Android App From Your Own Web Server

Listing your app on Google Play or another centralized app store may not make sense for your situation.  This was the case for me when I created an app for small web community, which would be meaningless for anyone else.  There’s nothing stopping you from simply uploading the .apk file to your web server and linking to it, though.  And that’s what I did.

One thing I discovered is that not all devices will recognize the file as an installable app based on the file extension alone.  You must ensure you send the proper mime type.  You can achieve this for Apache by associating the correct mime type with .apk files.  Adding this line to .htaccess will do the trick:

AddType application/vnd.android.package-archive apk

When a user clicks a link to the file, their device will download it.  There will be a “download complete” notification when completed.  Clicking this will grant the option to install the app.  It’s a process that is likely to be unfamiliar to your users, but it’s not too complicated.

One thing you lose is the automatic management of app updates that Google Play provides.  Your users will have to manually download the latest version of the app and install again, which thankfully is handled properly at that point by Android–that is to say, it’s treated as an upgrade to a newer version rather than a clean install.  Consider adding some type of notification to the app’s functionality that will alert users to perform an update if their app version is not the latest.

Read more from Android Development
2 Comments Post a comment
  1. Leo
    Apr 11 2013

    Dear Sir,

    If I add this type to Apache setting, when click the link, the APK will download to my smartphone. After finished, should I use a file manager to click the APK or the APK will auto-install to my smartphone?

    Best Regards,

    Reply
  2. david
    Jul 26 2014

    We’re would I start if I new nothing about app building?

    Reply

Leave a Reply to david

(required)
(required)

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments