My app has 3 activities; MainActivity has a large ImgeView with a jpg picture in main layout. Activities are changed with this code: Intent i = new Intent(this, Activity1.class); startActivityForResult(i,70);// arbitrary and back to MainActivity with code: protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); switch (requestCode) { case 70: // ..
Category : wakelock
I have started a foreground service from my application to take the user’s location every 5 minutes. It’s working fine until the device went to the doze mode. To overcome the above issue I follow the below approaches. The foreground service has acquired a partial wake lock to keep the CPU awake The application is ..
I am working with AOSP-Q i.e developing custom ROM. According to my understanding, after device is booted, if i write any value to /sys/power/wake_lock(ex: echo MY_WAKELOCK > /sys/power/wake_lock) then device shouldn’t suspend after screen timeout. This suspend is partial means only cpu will wakeup and other userspace functions should be suspended. But in my case ..
There is an application that every day creates about 100-200 new wakelocks for android. each wakelock is used once and after using it is no longer needed, but remains in the system. Thus there are a lot of unused wakelocks in the system. How do you think this is correct? or is it bad for ..
There is an application that every day creates about 100-200 new wakelocks for android. each wakelock is used once and after using it is no longer needed, but remains in the system. how do you think this is correct? or is it bad for system performance? if you are wondering what kind of application it ..
I have a streaming app and I want to avoid that the screen turns off while streaming. It works on most of my devices but it doesn’t on certain Samsung devices (Samsung Galaxy S21 Ultra, Samslung Galaxy S10 etc). What I tried so far: Add this to the onCreate view of my activity this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); Add ..
I acquire a wake lock on a Foreground Service and apparently it works fine. But i don’t know if Android allows forever locks or if due to low battery it can be released by OS. Thanks Source: Android..
To save battery in my Android foreground service, when I detect that the phone is still and the screen is off, I call unregisterListener to avoid using the accelerometer, and I release the wakeLock. When I turn the screen on, I acquire the wakeLock and I call registerListener to start using the accelerometer again. After ..
I have implemented agora voice call in my application. Its working fine on older devices and tabs but on new devices after locking the screen for 1 minute the receiver cannot hear audio. I guess android system puts the app in sleep mode. I have tried to use WAKE_LOCK to keep the app alive but ..
I know that Wakelocks are a thing. I use it in my code, however, I don’t think it works. I use a TimePicker which the user can choose a time, and I later set a alarm for that time like this: receiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { // ..
Recent Comments