powermanager Questions

8

I am currently implement a feature where the users are requested to ignore battery optimisation for the application. The reason for doing so, is that the main functionality of the application is un...
Retsina asked 17/8, 2017 at 19:25

3

I need to programmatically turn the screen on when the user turns off with power button, and yes I always have the correct flags in the Activity to keep screen on, but it does not avoid user pressi...
Faitour asked 7/5, 2015 at 1:50

4

Solved

Android 6 and 7 have some power optimizations (doze mode) which restrict app networking when device is not used. User may disable optimization mode for any app in Battery settings: Is it possib...
Calciferol asked 31/8, 2016 at 18:22

3

Solved

I am currently utilizing the below referenced code for a wake lock on an alarm notification activity. However, SCREEN_DIM_LOCK has been depreciated. So, what should I be replacing it with? //Insta...
Emma asked 17/3, 2014 at 5:26

2

For creating a receiver I'm extended WakefulBroadcastReceiver in my old project. But now it's deprecated. Instead of WakefulBroadcastReceiver which Receiver I should use now and how to convert belo...
Kairouan asked 10/11, 2017 at 7:3

3

I am making an Android app that needs to have the phone reboot or turn off when a button is clicked. Is this possible? Or will the phone require root access?
Architectonics asked 11/2, 2011 at 7:13

1

On Android development board, I am trying to wake up the AP based on an interrupt received on a GPIO, can anybody help me with this? My understanding on this is: We need to create an input device...
Electroscope asked 24/6, 2014 at 18:48

2

Solved

A friend of mine recently inherited an old laptop and has freshly installed windows 7, and wants to increase the battery life. Initially the battery lasted around 20mins, but by manually allowing t...
Bloodstone asked 23/12, 2013 at 17:58

2

Solved

I am attempting to put a device to sleep and I have found references all over about using the PowerManager class's goToSleep(long) method but I do not see it in the documentation and it does not wo...
Montague asked 11/2, 2015 at 16:23

2

Solved

i am trying to implement an WakeLock in my Android App. I have the following code in my onCreat(): pm = (PowerManager) getSystemService(Context.POWER_SERVICE); myWakeLock = pm.newWakeLock(WindowMa...
Poniard asked 13/4, 2014 at 17:25

1

Code - public class ShutdownReceiver extends BroadcastReceiver { private static final String TAG = "ShutdownReceiver"; @Override public void onReceive(final Context context, final Intent inten...
Serin asked 3/1, 2013 at 4:30

4

I have this code: wakeLock = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK | PowerManager.ACQUIRE_CAUSES_WAKEUP | PowerManager.ON_AFTER_RELEASE, "MyWakeLock"); And the FULL_WAKE_LOCK is crossed ou...
Capitulate asked 24/9, 2013 at 7:52

1

Solved

this is my code for setting alarm: public void SetAlarm(Context context, int tag, long time){ AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE); Intent i = new Intent...
Puffery asked 3/3, 2013 at 15:13

1

Solved

I need to do an application that turn off the mobile screen and go to sleep programmatically. For example if screen is on for more than 5 minutes without user_present, I should turn it off. I trie...
Byrnie asked 29/11, 2012 at 14:15

0

I use the code below to turn the screen on and off. Both pieces of code work on most devices (tested on Galaxy Note, Galaxy S2, etc. etc.) but don't work on a few (mostly tablets but some phones as...
Polymorphism asked 16/11, 2012 at 12:27

1

Solved

Hello I am trying to implement a wake lock for an application. PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL...
Kataway asked 14/6, 2009 at 16:20
1

© 2022 - 2025 — McMap. All rights reserved.