Search code examples
androidandroid-intentnfc

Android NFC AAR(s) Without Google Play Store


I'm trying to make an NFC tag that performs all of the necessary installation and start up for my application. Basically, the idea is you take our device out of the box, touch your phone to it, and it walks you through all the steps to install it and run it. Then, at any time in the future, you can just touch the NFC tag and go.

On the tag, I would like to have:

  1. Uri record pointing to our website's downloads page,
  2. Bluetooth related records for pairing our device with the phone
  3. AAR containing our application package name

If our application is installed, this works great, as we receive the NDEF intent, parse the bluetooth and pair the remote device.

If our application is not installed, I would like a browser to open our website so you can download the app. Unfortunately, the presence of the AAR NDEF record instead sends the user to the Google Play Store. For business reasons, we don't want to put our app onto the play store at this time.

Is there a way to have an AAR or equivalent record on the tag that directs the intent to our app if installed, but that doesn't redirect to the app store if not installed?

Failing that, is there a solution with multiple AAR records that can fallback to a browser when our app is not installed?


Solution

  • We're still looking for a better answer, but here's the best we've come up with so far.

    Our tag now contains:

    1. Uri record pointing to our website's downloads page,
    2. Bluetooth related records for pairing our device with the phone
    3. AAR containing our application package name
    4. AAR containing com.sec.android.app.sbrowser
    5. AAR containing com.google.android.browser
    6. AAR containing com.android.chrome

    Basically, if our app is installed, our app catches the intent, otherwise we try several standard browser package names as fallbacks to catch the uri. We have a fairly large NFC tag, so maybe we can make a list of all the standard browser package names on android.

    So far it works on 8 phones from 4 different manufacturers. If anyone has a full list of browsers, we'd appreciate it. Its obviously not ideal, but it might work for enterprise scenarios where you can control which phones to purchase.