3

Given that you can launch an installed android app using an NFC tag with a URL on it, using, e.g.:

<category android:name="android.intent.category.DEFAULT"/>
<data android:scheme="https"
          android:host="http://myurl.com"
          android:pathPrefix="/something" />

And that you can make that shorter using a url shortening service, or your own domain, and that redirects to the play store, why would you use an AAR on a tag? (Also, I believe the AAR intent wont pass data to the app).

I'm looking to make a tag that supports multiple OS, with as few bytes as possible - if I create a website that has links to each phone's store, what advantage is there to including an AAR or LaunchApp record on the tag?

Michael Roland
  • 39,663
  • 10
  • 99
  • 206
Wyzfen
  • 363
  • 3
  • 9

1 Answers1

2

why would you use an AAR on a tag?

Because your (original, pre-edit) proposed URL would cause the tag to always go to the Play Store. An AAR is designed to only go to the Play Store if there are no apps on the device that can handle the primary NFC record. See my answer to my own question for more on this.

Your approach of using http://myurl.com/something should work fine, so long as:

  • The tag is only supposed to be valid for your app

  • Nothing else on the device advertises support for that specific host and path prefix

Community
  • 1
  • 1
CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • My example url probably wasnt the best. I've eddited my question. If it was www.myurl.com, and that redirected to the play store; -if the app isnt installed, it will redirect -if it is, the intent will fire. I'd read your answer to your question before posting mine - yours looks like it need a URI or MIME message and an AAR - which is too large. – Wyzfen Sep 11 '13 at 14:17
  • Thanks for the updated reply. I didn't like editing the question and making your answer not-relevant, but wasn't sure of the procedure / etiquette. – Wyzfen Sep 11 '13 at 14:19