Here we have examined the question about launching the application by reference in the browser. https://toster.ru/q/311198

My task: there is an application that, by usb, wi-fi clings to the ATOL-30F cash register and prints a check. It is necessary to launch an application from the web system by reference, which will receive, for example, a check id - by it, find positions in the check and print the check itself. The application is already running. It is only necessary to call it from the browser.

Question number 1. The application must be published to google play? did according to the instructions - the application was not found. I registered the name of the package, the name of the action, and so on. Does not help. The application for your organization will be launched from the company's web system, so it makes no sense to publish it - and to pay money for it too.

Question number 2. Is it possible in the same way to apply not to the Activity, but to the service? The point is that when you click on a link, the data is transmitted to the service, it would work everything in the background without opening the application itself.

1 answer 1

This link is called Deep Link

If you don’t go into the wilds, you need to write something like this in the manifest:

<intent-filter > <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.DEFAULT"/> <category android:name="android.intent.category.BROWSABLE"/> <data android:host="myhost" android:scheme="myapp"/> </intent-filter> 

and further in HTML to prescribe a link like:

 myapp://myhost 

In this case, the standard Intent will be launched with action.View , which, according to the action.View scheme, will launch your application.

PS I hope it is clear that this only works in the Android browser :)

PPS Publish to Play is not necessary.

  • Does it concern running activity? Or the service can also be started this way? It turns out to call the application in the background? so as not to fall out on the screen. - Vasiliy Yumshanov
  • Not sure if the Service can be started this way, but you can try, at least syntactically in the <service> all this can be written - Barmaley
  • It worked. Thank. - Vasiliy Yumshanov
  • The service cannot be started this way. >> Android's deep linking functionality is available to foreground activities only (ref). You can start an Activity (transparent / noHistory / excludeFromRecents / singleInstance) which calls the Service (or the desired activities). - Vasiliy Yumshanov
  • and how to pass a parameter in the link? - Vasiliy Yumshanov