chariotsolutions / phonegap-nfc

PhoneGap NFC Plugin
MIT License
712 stars 570 forks source link

NFC + Barcodescanner #26

Closed semiaddict closed 11 years ago

semiaddict commented 12 years ago

Hi,

I'm using the NFC as well as the Barcodescanner (https://github.com/phonegap/phonegap-plugins/tree/master/Android/BarcodeScanner) plugins in the same project for Android. I would like to be able to continue detecting NFC tags even when the Barcodescanner activity has started.

At the moment if the barcodescanner activity is active and an NFC tag is detected, the default Android action (opening the tag's url in a browser) is performed.

Is there anyway to tell the NFC plugin to continue listening for NFC tags even if the main activity is in the background ?

I'm new to Android, and have tried to comment out the onPause and onResume functions in the NFC plugin, but this doesn't change anything.

Any help is highly appreciated.

jasonm23 commented 11 years ago

You should see about setting up a specific mime type for your activity.

Have a read of this question / answer on StackOverflow:

http://stackoverflow.com/questions/7114297/how-specify-mimetype-for-read-nfc-tag-with-url

don commented 11 years ago

These links have more info about setting up intents to launch the nfc plugin

https://github.com/chariotsolutions/phonegap-nfc#launching-your-application-when-scanning-a-tag-android

http://developer.android.com/guide/topics/connectivity/nfc/nfc.html#filtering-intents