0

I have an app that run some security checks and alerts the user using notifications when the device connects to a WIFI network with an specific SSID. The app run checks in background and if there is some security issue alerts the user using notifications.

The issue is that I was using a broadcast receiver for this but with Android Oreo or newer is not working any more. I was reading a lot and I can't find a way for running some background action exactly when the WIFI connection is turned on.

I am missing something or Google has killed my app?

Cesar
  • 707
  • 3
  • 13
  • 1
    Use a foreground service with a dynamically-registered receiver. – CommonsWare Dec 26 '18 at 12:21
  • @CommonsWare thanks for your suggestion, i think that will be the way to go, but a continuously running foreground service will not drain the device battery? – Cesar Dec 26 '18 at 14:35
  • 1
    A service on its own does not drain battery. It will tie up system RAM, but how much battery is used depends entirely on what the service does. – CommonsWare Dec 26 '18 at 14:47

0 Answers0