1

I am currently developing a service which runs in a background on Android OS. As soon as I change my location service runs some tasks. For instance: as I enter the office, restaurant or home service should start working. I want it to be energy efficient, so using the GPS service or Accelerometer all the time is very bad idea. I was thinking of constantly checking for wi-fi connections and if current networks vary from the ones that were available some time before I run my tasks. I wonder how efficient is this idea in terms of energy efficiency and context awareness and if there are any better ways?

Sanzhar
  • 111
  • 1
  • 13

1 Answers1

1

Seems "checking for wi-fi connections" is better approach. But actually not "checking", but use BroadcastReceiver to find out that WiFi network has changed like in this petersyn's answer. Anyway, You can implement all approaches and compare results.

Andrii Omelchenko
  • 12,030
  • 12
  • 40
  • 70