NFC based Android application, which starts after boot complete (when BOOT_COMPLETED
event received by BroadcastReceiver).
The Problem
Some times NfcAdapter.getDefaultAdapter(this)
retunrs null; this is random/inconsistent, for some boot cycles it works fine and returns NfcAdapter
, and for other boot cycles this method returns null.
I am suspecting, when it returns null, NFC Service not yet started, or NFC Service not fully running by the time BOOT_COMPLETED
event is Broadcasted.
The question
Is there a way to make sure NFC Service is running and stable before BOOT_COMPLETED
event is Broadcasted?
Assuming the device is rooted, would it help if init.rc
modified? If yes, What is the tweak if any one has come across such a problem?