Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

How do I open any app from my web browser (Chrome) in Android? What do I have to do with the A Href link?

I want to open third party apps from my web browser. So, I don't have any manifest file or anything.

I have a web page.

I want to have a link which opens the third party app e.g Twitter or Opera.

How do I structure the anchor link to go open that app?

Thank you.

See Question&Answers more detail:os

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

1 Reply

0 votes
by (71.8m points)

The basic syntax for an intent based URI is as follows:

intent:
   HOST/URI-path // Optional host
   #Intent;
      package=[string];
      action=[string];
      category=[string];
      component=[string];
      scheme=[string];
   end;

Parsing details available in the Android source.

To launch the ZXing barcode scanner app you can encode your href as follows:

<p>
  <a href="intent://scan/#Intent;scheme=zxing;package=com.google.zxing.client.android;end">Take a qr code</a><br>

  <a href="intent://scan/?ret=http%3A%2F%2Fexample.com#Intent;scheme=zxing;package=com.google.zxing.client.android;end">Take a qr code = 10px x 10px</a><br>

  <a href="intent:play/?mediaset=android-phone-rtmp-high&amp;playlisturl=http://www.bbc.co.uk/iplayer/playlist/bbc_one_london#Intent;scheme=bbcmediaplayer;package=air.uk.co.bbc.android.mediaplayer;end">Launch BBC</a>
</p>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...