3

This QR code contains a link to an app in the android market. When scanning it I get the option to "open browser" which then redirects me to the android market (market://details?id=tv.justin.android). What I'm wondering is if I can encode a specific url that would allow me to invoke my own app?

Micah
  • 106,911
  • 83
  • 226
  • 321
  • myScheme:// This is a bad idea. Please read this post: http://stackoverflow.com/questions/2430045/how-to-register-some-url-namespace-myapp-app-start-for-accessing-your-progr/2430468#2430468 – songz Sep 01 '12 at 14:03

1 Answers1

3

You can create an Activity for your app and specify that it can handle a custom URI scheme:

<activity android:name=".MyCoolActivity">
    <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="myScheme"/>
    </intent-filter>
</activity>

Then you can create a QR code that uses that URI scheme.

John Flatness
  • 30,929
  • 5
  • 77
  • 80