Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

I would like to use NFC tags with NFC Task Launcher or AutomateIt but I get every time I scan the tag a popup asking for the application to use (I have a few NFC related ones). I have a Samsung Galaxy S3 and a Galaxy Notes 2. There is no "always use this application" choice (similar to the ones I had when clicking on a link for the first time - which popped up an app panel with a choice of "this time only" or "every time").

Is there a way to force the assignment of an app to an event?

Thank you!

share|improve this question
    
If there's not, and your device is rooted, you can check the playstore for "AutoRun Manager". Install it, and disable the corresponding listeners from the apps which should not respond. Not a real clean solution (and will only last until one of those apps receives an update, or you install another NFC app -- in which cases you need to repeat this step for the affected app), but it should do the job: Only a single receiver = No Popup :) –  Izzy Jan 15 '13 at 14:02
    
@Izzy: thanks (unfortunately my phone is not rooted). If I understand correctly the apps register themselves as "event handlers" and there is no way to edit this (similarly to how this is done in Windows or Linux). The idea being that I would edit once the hook for "NCF tag read" event, worst case until a new app is installed (which could be OK for events you have appropriate apps for and which you do not need to redefine on a regular basis) –  WoJ Jan 15 '13 at 15:03
    
You could call it that. What they register is called a "listener", and the system sends a "broadcast" to all registered listeners -- but the principle is the same. What you could do if none of the related apps are system apps is use a tool to rebuild the .apk files with those listeners removed. But that might be tricky, and even a little risky, as you'd have to do so for every update, and you might even be unable to update such an app (due to the "broken seal"). –  Izzy Jan 15 '13 at 17:04
    
In that case I will remove the other apps registered to handle the event. This is not ideal but in that specific case it will be OK. Thanks for the details. –  WoJ Jan 16 '13 at 7:45
    
I fully agree, it's not ideal. But I'm glad it's at least a workable solution for you. I will sum up now all the details into an answer (so it's easier to follow for others. Feel free to upvote/accept it then :) –  Izzy Jan 16 '13 at 7:48

1 Answer 1

up vote 3 down vote accepted

Background

To understand the issue, you will need a little background on how this works:

For almost everything, Android broadcasts "events" -- such as e.g. boot_completed, SMS received, SD card inserted/removed, battery low... NFC signal received. Apps can register so-called "Listeners" with the system, which are bound to specified events. In your case, mentioned apps have registered for NFC events.

Now, when an event is broadcast, and there's no listener to it, nothing will happen. Is it a single app that registered a listener, this app will be called. If multiple apps registered listeners, the system looks if one of them is set to "Default" by the user; if so, this one is called -- otherwise a popup appears fot the user to chose which app should handle the event. Usually, this popup also holds a checkbox to make that app the default for this given event.

Solutions

As said, usually there should be a checkbox -- which in your case does not seem to be the case. So it seems there's no possibility to define a default action for this event, whatever the reason. You could try apps from the playstore which do handle default apps (e.g. Default App Manager) -- but most likely this will not work either.

A second point to look would be in Settings → Apps → Manage Apps, pick the app of your choice, and see if it has the corresponding checkbox not grayed out -- if so, simply check it. Most likely, this will be grayed out, so you cannot do anything here either.

Next step would require root -- so if your device is not rooted, it's purely informational to you. As described above in "Background", all related apps have a listener registered with the system. So we should be able to un-register it. This can be done e.g. with Autorun Manager PRO (yes, it will need the Pro version -- as with the free you only can change 2 entries).

AutoRun Manager Pro

As the screenshot shows, this app can enable/disable listeners, so you can avoid having apps started automatically in situations you rather don't want them. Which would apply to yours: Find the corresponding listener, disable it, fine.

Without root, the only remaining possibility is to get rid of all but one of the apps. You could uninstall the others, or, if you'd rather keep them (and you are running Android 4.0 or higher), rather simply disable them in Settings → Apps → Manage Apps, so when needed, you can simply re-activate them at the very same place.

share|improve this answer
    
Thanks for the summary. I tried apps like Default App Manager but they do not cover NFC. –  WoJ Jan 16 '13 at 13:04
    
The reason for that is still unclear to me. If it's just too new (so Default App Manager does not know about NFC), the event handler stuff in Android itself should still be capable of handling this, including defaults. Thanks for the app name, I will update my answer with it, so we have everything together there :) –  Izzy Jan 16 '13 at 13:28
    
I have tried freezing nfc app (samsung nfc service) on my note 2 with titanium but that killed completely nfc. –  Pitto Mar 7 at 20:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.