mike
mike

Reputation: 21

How to open installed apk by URL link?

I want to do something like this:

click a Link (a URL of apk)

  1. If the apk didn't install before, so the apk will be downloaded.

  2. If the apk have installed the apk before, the apk will be open.

So is it possible to open the apk by URL link?

Upvotes: 2

Views: 3676

Answers (2)

trejder
trejder

Reputation: 17505

Look at this example and TestFlight's webpage. There's a link Already Installed? Launch the App -- a simple <a> tag with href set to testflightapp://com.testflightapp.androidapp?scheme=http&amp;host=testflightapp.com&amp;path=m/builds.

It works partially, like you want -- it runs installed application. However, I don't know if this kind of href / protocol supported only by installed Test Flight application (seems so) or general in Android system.

So, it seems, that your own application -- the one, that you want to install or run via link, must itself register and handle private protocol, as in this example.

Upvotes: 0

Goofyahead
Goofyahead

Reputation: 5884

You can use PackageManager class to search for a package, the one that you want to start downloading, if the package is present you can call to its launch intent.

Some examples here.

How to get a list of installed android applications and pick one to run

Upvotes: 2

Related Questions