0

This question has been asked more then 10 times, for example :

  1. Launch custom android application from android browser
  2. Android Respond To URL in Intent
  3. How to implement my very own URI scheme on Android

I tried more then 10 links and tutorials and it seems like i'm missing something.

I do the following :

  1. create a new android project you an empty action.
  2. I then create the following Android manifest :

    <?xml version="1.0" encoding="utf-8"?>
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.my_test"
    android:versionCode="1"
    android:versionName="1.0" >
    
    <uses-sdk
        android:minSdkVersion="18"
        android:targetSdkVersion="18" />
    
    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".MainActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
    
            <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:scheme="http" android:host="planb.site11.com"/>
            </intent-filter>
    
            <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:scheme="my.special.scheme" android:host="path" />
            </intent-filter>
        </activity>
    </application>
    

  3. Then i enter a small webpage i created, hoping on of the links will work (using google chrome on nexus 5) here is the page (his source is very simple) http://planb.site11.com/

  4. and click on the links, but nothing opens my app :(

What am i missing ? How can i see in my android which apps are signed for which intents ?

Thanks.

Community
  • 1
  • 1
OopsUser
  • 4,258
  • 6
  • 37
  • 59
  • Your second filter does not match anything on the Web page, as you are not using a host named `path` on the Web page. With respect to the first filter, not all browsers support this, as some assume that `http` links are ones they should handle themselves, without checking to see if there is an app on the device that is supposed to handle it. – CommonsWare Aug 31 '14 at 11:13
  • Regarding the second filter, thanks, i edited it and now it works. regarding the first, so how come youtube opens when i search for youtube in google and press on "m.youtube.com" ? it is also an http link – OopsUser Aug 31 '14 at 11:24
  • Off the top of my head, I have no idea. In particular, I thought Chrome did handle those links properly, finding the app and offering a chooser. – CommonsWare Aug 31 '14 at 11:27

0 Answers0