Reply To: What does registerActivity do?

Forum MIFARE general topics and applications What does registerActivity do? Reply To: What does registerActivity do?

Re: What does registerActivity do?

14. December 2016 at 9:29
Hi Francisco,

We have to be careful. The term “register activity” is also used in a different context in the Android framework. This method initialize the library instance and—if it never happened before, it connects to the NXP server one time. Here it is checked, if the package name of the running app is registered.

This means, you can have more activities in your Android application, but the (TapLinx)registerActivity() must be called only once, for instance in your main activity. If you want to develop another app (with a different package name) you have to register this app also on our server and get a new key for this app.

On word of which app takes NFC events. Your app is “registered” on your local Android system as NFC receiver. You see all “local NFC receivers” if you tap a card to your phone and only the home screen is visible. In this case Android ask you which app should be started. If your app is currently running, the method startForeGroundDispatch() is called and you signal to Android the willingness to take NFC intents. If your app is hided, you call stopForeGroundDispatch() and signal to Android, that no NFC intents can be handled in your app.

Kind regards,
The TapLinx Team
+ 0  |  - 0