What can android listen for while asleep?

129 Views Asked by At

I can't find a list of events that can be listened for while a device is sleeping.

For example, it is possible to use LocationListener while asleep.

My goal is to detect when a user is in his car by at least one of the following methods, which will then wake the phone:

  • NFC tag on car dock
  • Bluetooth-enabled car radio in range

But failing those, I'm open to ideas.

Thanks

2

There are 2 best solutions below

1
On

You should create a brodcast receiver and register specific actions.

An example to detect a boot: Android -Starting Service at Boot Time.

2
On

The best idea so far is to wake the phone periodically as per this link:

Android - periodically wake up from standby mode?

As per the documentation, I could wake the phone up and just use the CPU, while keeping the screen off.

But there might be disadvantages, perhaps there is a better way.