Open android application from a web page

前端 未结 4 629
萌比男神i
萌比男神i 2020-11-29 02:33

I know that for opening android application from a link inside a web page we have to write the following in the AndroidManifest.xml:

        <         


        
相关标签:
4条回答
  • 2020-11-29 02:52

    AndroidMainfest declare:

    <activity android:name="...">
    <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="hostName"
         android:path="path"
         android:scheme="schemeName" />
       </intent-filter>
    </activity>
    

    you can let to invoke

    <a href = "schemeName://hostName/path">
    

    or add param similar url in brower

    <a href = "schemeName://hostName/path?id=1&name=mark">
    
    0 讨论(0)
  • 2020-11-29 03:01

    Try this:

    Make your links look like this:

    <a href="intent:#Intent;action=my_action;end">Link to my stuff</a>
    

    Also have a look at Launch custom android application from android browser

    0 讨论(0)
  • 2020-11-29 03:02

    One way as 林平君 saied,and another way by invoking js method ,code as follow:

    function openAActivity(){
         window.location = "schemeName://hostName/path"
    
    }
    

    this method will send an Android intent to start specified activity.

    0 讨论(0)
  • 2020-11-29 03:11

    1st way:

    <html><head></head><body>
    <iframe src="YourApp://profile/blabla" width="1px" height="1px" scrolling="no" frameborder="0"></iframe>
    <script>
    setTimeout(function() {
    window.location = "http://YourSite.com/profile/blabla"; }, 4000
                    );
    </script>
    </body>
    </html>
    

    OR
    2nd way: https://stackoverflow.com/a/24023048/2165415

    0 讨论(0)
提交回复
热议问题