Launching NFC when screen is Locked in Android

前端 未结 5 2050
甜味超标
甜味超标 2020-12-31 03:40

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 f

相关标签:
5条回答
  • 2020-12-31 04:05

    Agreed with Nikolay Elenkov, As you are not able to get hold on Power button as discuss here same way you can't unlock the phone to launch your application while launching your application.

    0 讨论(0)
  • 2020-12-31 04:10

    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.

    0 讨论(0)
  • 2020-12-31 04:11

    I was looking to implement the same feature on one of my applications. After some search i discovered these links:

    http://www.xda-developers.com/android/use-nfc-with-screen-off-or-in-lock-screen-on-galaxy-nexus/

    Also note that the new Moto X was a feature called "Skip" that allow the same behaviour. You can see a demonstration on this video:

    https://www.youtube.com/watch?v=-JUgspIGxcE

    Hope it can help

    0 讨论(0)
  • 2020-12-31 04:20

    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

    0 讨论(0)
  • 2020-12-31 04:20

    Probably it could work if you use:

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED);
    

    http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_SHOW_WHEN_LOCKED

    0 讨论(0)
提交回复
热议问题