I've written application on Android to sent SMS when someone has changed phone's position. It's working fine, when screen isn't locked. Even if app is running in backgroud, but screen is turned on, then everythings works fine. The problem is when screen is locked, in this case app doesn't send any SMS. I've checked 2 versions. First without creating Service and second using Service, but it still doesn't work. What's more funny, it also works, when screen is locked, but phone is charging. Any idea why it's working only when phone is charging? I've turned off batery saver mode, but it didn't help. What's blocking app when screen is locked? And why it's not blocking when phone is plugged into the charger?
Asked
Active
Viewed 316 times
1
-
1check your service, it might be stopping when application is closed – Abdul Kawee May 23 '17 at 12:55
1 Answers
0
I think, its because of security. Android OS does not allow sending sms in background. Or it
s because of Doze Mode (or similar functionality)

Yevhenii Maher
- 81
- 10
-
So why it is working when phone is plugged into to charger? What's more, I've checked it on several phones and somehow it's working only on Xperia SP with Android 4.3 (even without charging). – user1774229 May 24 '17 at 09:29
-