Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Launching NFC when screen is Locked in Android

I want to launch My Application when we taps on NFC tag even Phone is Locked same as did in Google Wallet Application.

I tried in following ways :

1) Tap NFC tag to launch my application after pressing Power button - Error :

05-23 22:00:22.949: D/NfcService(32443): EnableDisableDiscoveryTask: enable = false

05-23 22:00:22.964: D/NfcService(32443): NFC-C polling OFF

05-23 22:00:22.996: D/PhoneStatusBar(273): disable: < EXPAND icons alerts TICKER 
system_info BACK* HOME* RECENT CLOCK* >

05-23 22:00:23.988: D/NfcService(32443): NFC-EE routing OFF
[10:33:22 AM IST] 

2)Tap NFC tag after pressing Power button and now i am able to see Lock/Unlock screen - Error :

05-23 22:03:59.714: D/NfcService(32443): EnableDisableDiscoveryTask: enable = true

05-23 22:03:59.730: D/NfcService(32443): NFC-EE routing OFF

05-23 22:04:03.238: D/NfcService(32443): NFC-C polling ON

If i unlock the screen and Taps on NFC tag everything works fine

How to handle power button and lock/unlock screen in order to Launch my application when phone is Locked?

like image 880
Venky Avatar asked May 24 '12 08:05

Venky


People also ask

Can you use NFC when phone is locked?

That is, without root access. NFCScreenOff by XDA Member lapwat is a Magisk Module that you can enable on your phone to always read NFC tags even when your screen is locked.

Do I need to unlock my phone to use NFC?

You can only make a limited number of locked transactions before your phone asks you to unlock it. You must also complete the transaction within a few minutes after you unlock it. Tip: For added security, set up your phone so that it must be unlocked to complete a near field communication (NFC) transaction.

Can you use Google Pay from lock screen?

If your device is locked, the Google Pay app can't be opened. If your device has a screen lock set up, it'll automatically become your app lock during setup. If your device doesn't have a screen lock set up, add one during setup.

Is NFC automatically enabled on Android?

Your phone's NFC chip (and Android Beam) needs to be activated before you can use NFC: Go to Settings > More. Tap on the NFC switch to activate it. The Android Beam function will also automatically turn on.


2 Answers

This is not supported. I don't think even Google Wallet works this way, are you sure about this? It is actually a security feature -- you don't want someone who stole your phone to be able to make payments with it without being able to unlock it.

like image 69
Nikolay Elenkov Avatar answered Oct 12 '22 05:10

Nikolay Elenkov


According to Google, Android-powered devices must be unlocked in order to scan an NFC tag [1]. Also the Google Wallet concerns privacy and security, and works only in unlocked state [2].

[1] http://developer.android.com/guide/topics/connectivity/nfc/nfc.html

[2] http://www.google.com/wallet/faq.html

like image 43
Nik NexAndrX Avatar answered Oct 12 '22 05:10

Nik NexAndrX