Android Question NFC in background mode

freedom2000

Well-Known Member
Licensed User
Longtime User
Hi,
I am trying to launch an App with an NFC tag.
I started with the NFC lib and added this into the Manisfest editor :

B4X:
AddActivityText(Main,
<intent-filter>
    <action android:name="android.nfc.action.TECH_DISCOVERED"/>
</intent-filter>
<meta-data android:name="android.nfc.action.TECH_DISCOVERED"
    android:resource="@xml/nfc_tech_filter" />)
CreateResource(xml, nfc_tech_filter.xml,
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <tech-list>
  <tech>android.nfc.tech.NfcA</tech>
  </tech-list>
</resources>)

I have then successfully launched my app when I approach the NFC card.
But whenever my phone is locked, the App doesn't start.
Does it mean that when screen off, the NFC hardware is disabled or do I miss something ?

Thanks
 

inakigarm

Well-Known Member
Licensed User
Longtime User
In the real world: I go to a gym where the the mobile can connect to gym machines via NFC for registering training in a mobile app. If the screen is off, the mobile app can't connect to the machine (NFC tag); I'd have to open screen on mobile to register to each gym machine.
 
Upvote 0

freedom2000

Well-Known Member
Licensed User
Longtime User
In the real world: I go to a gym where the the mobile can connect to gym machines via NFC for registering training in a mobile app. If the screen is off, the mobile app can't connect to the machine (NFC tag); I'd have to open screen on mobile to register to each gym machine.
This is probably the only reason why I never touch a gym machine !
 
Upvote 0
Top