Questions tagged [screen-off]

58 questions
11
votes
1 answer

Does Android lower the download rate when the screen turns off?

I observed that I can download a file faster if I use wget with the screen on application, that acquires a screen dim wake lock than doing the same without this application and having the screen turned off.. I downloaded exactly the same file (from…
Thanasis Petsas
  • 4,378
  • 5
  • 31
  • 57
7
votes
2 answers

StandBy like activity

I would like to create a StandBy activity for my device, and so far I created an activity that when is called will turn off my display. The code is the following: public class MainActivity extends Activity { private SensorManager…
axl coder
  • 739
  • 3
  • 19
7
votes
2 answers

How to get broadcast for screen lock in android

How to get trigger that screen is locked or on in android?? i tried using SCREEN_OFF & SCREEN_ON action in broadcast receiver but it's not working. public void onReceive(Context context, Intent intent) { Log.d("XYZ", "Screen ON/OFF"); …
yuva ツ
  • 3,707
  • 9
  • 50
  • 78
6
votes
2 answers

Android BLE disconnected when screen off (without charger)

It's working well on most Android devices. Other device's screen gets locked after 1 minutes BLE device gets disconnected,if device without charger. Thanks for any suggestions!
4
votes
1 answer

catching screen off before is too late

I've an activity that, on its onPause has to do some work but not when the screen is turned off. I've already registered the receiver for the ACTION_SCREEN_OFF intent and, theoretically, this and a static flag at application level should do the…
lorenzoff
  • 1,120
  • 3
  • 15
  • 32
4
votes
0 answers

Android force idle mode vs. really unplug the device

Currently I'm working on an app which does Bluetooth scanning in background service. I realized that the phones behaviour is different if I force the device to sleep mode by adb shell dumpsys battery unplug adb shell dumpsys deviceidle…
Fintasys
  • 1,309
  • 1
  • 9
  • 16
4
votes
0 answers

Android accessibilityservice whan screen off

I have a problem with accessibility service in android. I want to retrive result of USSD command. What I try to do: I made an AccessibilityService from gist.github.com/qihnus/1909616 Deal USSD: Intent i = new Intent(Intent.ACTION_CALL);…
Hagakurje
  • 1,002
  • 2
  • 11
  • 17
4
votes
2 answers

Recognize volume button presses when screen is off Android

I am trying to recognize when the user presses the volume rockers when the screen is off to update an activity. From what I've read, BroadcastReceivers (I think) don't work when the phone is asleep, and so the only way to do this is to keep the…
husam
  • 41
  • 2
3
votes
3 answers

Android TTS stops reading aloud after the screen is turned off for a while

I am working on an app that needs to keep reading aloud text after the screen is turned off. To achieve this goal, I put the Text-to-speech (TTS) code in the foreground service, so the TTS can keep running when the screen is off. It worked well on…
3
votes
2 answers

Sensor Data pauses upon Screen OFF even when Foreground Service & Partial Wake Lock are used in Android Wear

With Android Wear 3.2 OS update, the Accelerometer Sensor Data gets paused when the Screen goes off. I have used Foreground Service and declared its permission in the manifest.
3
votes
0 answers

How to keep the camera preview open when screen is off?

I have a small project. I need to implement a motion detection in android to close the device screen when more than 5 mins have passed, and wake it up if motion is detected. The problem is that the camera preview freezes when the device is going to…
Daniel Rus
  • 31
  • 4
3
votes
1 answer

Why foreground service stops when screen is off on Android Oreo?

Android Oreo stops my foreground service when I turn off screen. It happens, when device is unpluged. I test my app on Huawei MediaPad T5. I send test request every 30 seconds with Handler.postDelayed. I read about background executions limits in…
3
votes
2 answers

Timers not running when screen is turned off / device is locked in iOS

The app is in the background and it receives a callback upon disconnection with the BLE device, after which the app has to wait for sometime(1minute) and then execute some piece of code. The app behaves as expected even when in the background if the…
3
votes
2 answers

Android Things: Raspberry Pi screen timeout

I'm building app on Raspberry Pi with Android Things and I have 7 inch touch screen, but the screen never turns off. Is it possible to set timeout like in Android phones? or force it to turn off/on. If I remove the power line and inserted again the…
3
votes
2 answers

Android notification manager doesn't work with the screen is off

I have a count down timer that when it goes off (to zero) it checks to see if the app has focus. If not it launches a notification in the notification bar. When you click on the notification is re-opens the app. Now all of this works fine but if the…
Cameron
  • 1,612
  • 2
  • 16
  • 24
1
2 3 4