PawelB
PawelB

Reputation: 1

mobile app, redirec from browser to app on the phone

I have a question. I have to make link/button in html which will contain number. If user clicked on this button/link he should be redirected to panel/views where we type the phone number.

Do you know how to do this?

Upvotes: 0

Views: 99

Answers (1)

Shobhit Puri
Shobhit Puri

Reputation: 26007

  • You need to have a Protocol Handler. Lets say something like Pawel:// or any other. The URL should be triggered when you click the Button on the web page in the mobile device.

  • In the AndroidManifest of your app you have to register this protocol handler. This tells android that your app is capable of handling that protocol handler. If your is the only app installed at the user that can handle this protocol handler, then clicking of the button will open the app(your desired activity) automatically. Otherwise it will ask user to choose amongst the available option.

  • Along with this custom protocol handler, you can attach a parameter containing the number. This parameter can be parsed in the app(inside onCreate, when it receives this url in the activity with the intent.

  • After parsing you can set it in TextView.

You might want to check Android / iOS - Custom URI / Protocol Handling if still working on it.

Upvotes: 1

Related Questions