Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
782 views
in Technique[技术] by (71.8m points)

android - Html page to download and install apk from browser

I have an app that will be installed by the user from a public webserver (outside android market).

So I hosted the apk in webserver and instructed the users to type the url to download the file and then "open" the downloaded file to install it.

But, almost 100% of users are having difficulties to do those simple tasks (they're are not familiar with technology...).

So, I decided to make a webpage that will simplify the task. The page contains a single big button that will:

  • Donwload the apk;
  • After download finish, start "Android's Install Dialog" to install the downloaded apk;

Dowloading file is pretty easy, but now my problem is to open the "Install dialog" from browser!

I'm totally newbie about html/javascript and I don't know how to do it (or even if this is possible).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Normally, you just link to the .apk file. When the user clicks on such a link, the .apk file is downloaded and the installation is automatically started (with a dialog like 'do you want to install this application').

So, just <a href="yourdomain.com/yourapp.apk">Download and install...</a>.

Important! This only works if your users allow installation from 'Unknown sources' in settings/security.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...