SAMSUNG device now prevents "GET" request if screen off? (Android Dev)

BACKSTORY: A couple years ago, my dad recommended I program a personalized “family locator” app so we could keep track of him in case he had a follow-up medical emergency after he had a minor stroke.

THE APP: Basically, what it does is it starts a foreground process, gets GPS coordinates every 5-10 minutes, and then sends a GET request to a remote server to log the info.

THE ISSUE: Even though it’s been working fine for almost two years, my dad recently upgraded to a SAMSUNG GALAXY A16 phone. It seemed to work all right at first, but on 2025-08-20, it suddenly stopped sending GET requests when the screen was off, which was never an issue before.

Now this hasn’t completely broken the app, as it goes back to sending GET requests when the screen is on, but this has kneecapped its functionality severely since it used to send info on a more up-to-date basis (as more often than not, the screen is off).

I tested my app on the most recent version of android in a Google Pixel emulator and it still seemed to work fine, which makes me think it probably isn’t an issue with Android but instead an issue with Samsung’s stricter battery optimization and/or security measures. (On the day this started, there was a notification on the phone that there had been recent updates.)

A major concern is that this could also be a critical problem for other health-related apps that are programmed generally for Android, that are supposed to send biometric and/or location data at (sometimes precisely) frequent intervals.

I made numerous attempts in the Samsung device’s Settings to loosen optimization restrictions and network usage restrictions in the background, so far to no avail.

Any ideas?

(Note: If you need more information over the coming weeks, including source code, I should be able to provide it).

Hope you can help! :victory_hand:

Did you try setting the application’s battery optimization to “Unrestricted” on the device?

(App info > Battery > Unrestricted)

Did you try setting the application’s battery optimization to “Unrestricted” on the device?

(App info > Battery > Unrestricted)

I did, but it still didn’t work :frowning:

UPDATE

I do have an update, though! So far, turning off Settings > Battery > Power Saving is at least making it work now (when the screen is off).

However, the app is still getting put to sleep usually in less than 6 hours, despite the fact that I’ve:

  • Turned off Power Saving in battery settings (as previously noted).
  • Allowed Unrestricted Battery use (or alternately placed it in “Never sleeping apps”).
  • Allowed all Foreground Service permissions.
  • Turned off “Put unused apps to sleep” in Background Usage Limits.
  • Added it to “Device Care > Memory > Excluded Apps”
  • Unchecked “Manage App If Unused” in app settings.
  • Checked “Allow data usage while Data Saver is on” in app settings.
  • Locked the app in the Recents menu.

Hoping to know if anyone can help with the extended issue now :slight_smile: