android-wake-lock

PROXIMITY_SCREEN_OFF_WAKE_LOCK not working with Samsung

眉间皱痕 提交于 2020-01-16 18:07:51
问题 I am using the Proximity Sensor while webRtc call in android to turn screen on/off using device sensor. It is working perfectly in most of the devices but not in Samsung. When Sensor turns the screen off onStop() of the activity is called. Following is the code I am using : @Override public void onSensorChanged(SensorEvent sensorEvent) { if (sensorEvent.sensor.getType() == Sensor.TYPE_PROXIMITY) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (mWakeLock != null) { mWakeLock

How to show a incoming call activity

只愿长相守 提交于 2020-01-16 11:27:24
问题 I'm developing an Video and Voice chat app. What I need to do is to show some incoming call activity when an user try to call another user. I'm already using Firebase Cloud Message to send push message warning the device that there is a call request. But I'm facing a hard time trying to wake up the device and show in front of the lock screen the incoming call, so the user can accept or decline the call. What I'm looking for is something like what Whats App does when you call some one. Showing

How to show a incoming call activity

限于喜欢 提交于 2020-01-16 11:27:10
问题 I'm developing an Video and Voice chat app. What I need to do is to show some incoming call activity when an user try to call another user. I'm already using Firebase Cloud Message to send push message warning the device that there is a call request. But I'm facing a hard time trying to wake up the device and show in front of the lock screen the incoming call, so the user can accept or decline the call. What I'm looking for is something like what Whats App does when you call some one. Showing

GPS location and deep sleep

半腔热情 提交于 2020-01-15 10:57:20
问题 I've got a foreground service (with START_STICKY so no problem for the aspect "killed by OS")that receive a location (GPS) update every 2 seconds for navigation purpose. I don't take any wakelock. My question is: have I to take a wakelock to avoid a deep sleep? Or the location updates is enough to be "running"? 回答1: After of bit of digging in Android code, the response is: no, you don't need it. Android will grab a wakelock for you (LocationManagerService) until onLocationChange ends or your

BroadcastReceiver, Service and Wakelock

无人久伴 提交于 2020-01-02 05:13:28
问题 im receiving an intent in broadcast receiver and then i start service to do more work. now what if the device is sleep and this happen, do i have to get Wakelock (AlarmManger?), and why do i need it? does my service will stop running if the device goes to sleep without getting a wakelock. 回答1: now what if the device is sleep and this happen, do i have to get Wakelock (AlarmManger?), and why do i need it? If the device is asleep to begin with, you will not be "receiving an intent in broadcast

Android deep sleep and wake locks

≡放荡痞女 提交于 2019-12-30 12:03:14
问题 I have created an android app which runs fine in all phones. But in my Alcatel phone it doesn't as the phone goes to a deep sleep mode and the data network fails so the app doesn't get a data network and doesn't sync the data from the server . My Design ... SystemBootReceiver --> (DataSyncService)Service --> (MyBroadcastReceiver)BroadcastReceiver --> (MyDataService)Service . So here on system boot I start DataSyncService where I set up the AlarmManager (repeated) and call the

Turn off screen on Android

蓝咒 提交于 2019-12-27 10:21:35
问题 I am trying to turn on and off the display after a certain action happens (Lets just worry about turning the screen off for now). From what I understand from wake lock, this is what I have: PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "My Tag"); When I read other posts on stackoverflow and else where, they seem to tell me that PARTIAL_WAKE_LOCK will turn the screen off. But if I read the SDK

Not able to write to SDCard while screen is off even though I have PARTIAL_WAKE_LOCK

ぐ巨炮叔叔 提交于 2019-12-25 04:45:12
问题 I'm totally new to Java and Android, so I think I'm probably missing something obvious. I'm writing an app where I sample the orientation sensor and write the result to a file on the SDCard as well as display it in a log on the screen. Everything works fine while the screen is on. Since I want to also operate while the screen goes dark, I added code to acquire a PARTIAL_WAKE_LOCK. From what I can tell, when the screen goes dark the sensors are still being sampled (making me think the wake

Android - Unlocking phone with voice [closed]

≯℡__Kan透↙ 提交于 2019-12-23 17:56:19
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 8 years ago . Is it possible to unlock phone with voice command, even when device is in PowerManager.WakeLock mode?I thought of using Service as background process but can phone device react when locked?Any ideas? ps.Just to

How to use Android's Sensor Batching without AlarmManager

拟墨画扇 提交于 2019-12-23 17:19:05
问题 I want to use Androids sensor batching introduced in Android 4.4 to save some battery power. My testing device can store 184 sensor events in its fifo-queue. Using a sampling rate of 18 events/seconds I have to flush the sensor about every 10 seconds. The section on Sensor Batching in the 4.4 Documentation proposes: Use that calculation to set wake alarms with AlarmManager that invoke your Service (which implements the SensorEventListener) to flush the sensor. Since Android 5.1 the minimum