android-wake-lock

Android Service Listener for the wakelock screen

感情迁移 提交于 2019-11-28 14:37:37
Hii all, Im developing an emergency calling application. What i want is when some person uses this specific code the phone will unlock and then only my application would be running. Im juz thinking i need a reciever for it and just wondering wether i will have to create my own Home screen and a lock screen for my application. any ideas on this please??? many thanks in advance :) Jake Basile There is no sanctioned way to replace the lock screen. See Is there a way to override the lock pattern screen? The previous answer was to another question that got merged with this one: I would look into

sendMessage doesn't work properly (Wearable)

风流意气都作罢 提交于 2019-11-28 14:28:28
If I'm sending some bytes using sendMessage from Huawei p9 (Android 6.0) into Android Wear (Sony) the messages are not delivered if the screen of handheld device is turned off. The notifications inside wearable are not updated until the screen in the phone is turned on (in 1 minute)! Will setUrgent help? I already added the application in "list of granded applications" that can work while the screen is off. The application already works in WAKELOCK state. Is it a feature for all Android 6.0 and newer devices? IS IT POSSIBLE TO AVOID THIS? ANY CLUES? I've waste 3 days to find the solution To

Android: Wake & unlock phone

被刻印的时光 ゝ 提交于 2019-11-28 06:36:50
I am trying to figure out how to wake and unlock the phone with a service. I have been referring to this post but, I can't figure out why it isn't working. This is the code that I have so far: public class WakephoneActivity extends Activity { BroadcastReceiver mReceiver; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { // Log.v(TAG, "Screen OFF onReceive()"); screenOFFHandler.sendEmptyMessageDelayed(0, 2000); } };

Android - How can I wake up the phone from a hard sleep to take a picture?

人走茶凉 提交于 2019-11-28 06:36:43
I want to take pictures from the Android device's camera periodically over a matter of hours, to create a time lapse video effect. I set an Alarm Manager with an AlarmManager.RTC_WAKEUP flag set to start up a service every few minutes. The service holds a partial wakelock, does some work, and then calls a Broadcast Receiver through the Alarm Manager which starts up an Activity. The activity is created (or is resumed), turns on it's own wakelock, and sets up the camera preview surface. Once the surface is setup the SurfaceHolder listener's surfaceChanged() method is called, which finally takes

Disable Screen Lock(Power) Button in Android

别来无恙 提交于 2019-11-27 22:27:20
问题 I want that when my application is running the power button (which upon pressing locks the screen & screen goes BLACK), should be disabled. So that the user cannot lock the screen. I have noticed this thing in Samsung Galaxy S phone's Default Camera App. That's the same reason I am trying to do the same. I have also a Camera related App. 回答1: try this one int val=android.provider.Settings.System.getInt(getContentResolver(), SCREEN_OFF_TIMEOUT); android.provider.Settings.System.putInt

sendMessage doesn't work properly (Wearable)

三世轮回 提交于 2019-11-27 19:35:46
问题 If I'm sending some bytes using sendMessage from Huawei p9 (Android 6.0) into Android Wear (Sony) the messages are not delivered if the screen of handheld device is turned off. The notifications inside wearable are not updated until the screen in the phone is turned on (in 1 minute)! Will setUrgent help? I already added the application in "list of granded applications" that can work while the screen is off. The application already works in WAKELOCK state. Is it a feature for all Android 6.0

PowerManager.PARTIAL_WAKE_LOCK android

依然范特西╮ 提交于 2019-11-27 09:50:32
I am very confused whether to acquire this wakelock. E.g. I have this type of code that is called from onReceive() of a BroadcastReceiever (CONNECTIVITY_CHANGE, BOOT_COMPLETED etc) asynchronously i.e. I am launching an IntentService from onReceive() which performs heavy lifting. private static void insertInDatabase(Context context /*, some data to be inserted in database*/) { Database helper = Database.getInstance(context); PowerManager pm = (PowerManager) context .getSystemService(Context.POWER_SERVICE); final WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, wakelockName);

Samsung “App optimisation” feature kills background applications after 3 days

旧城冷巷雨未停 提交于 2019-11-27 08:49:23
We are currently developing an Android app that is a fitness-tracker application. It runs constantly in the background, and it works fine on most devices, but we've been having issues with the application dying completely on some Samsung devices. After some investigation, it seems like some Samsung devices has a completely custom "App Optimisation" feature ( http://forums.androidcentral.com/samsung-galaxy-s6/599408-app-optimisation-after-updating.html ), which is basically a (very) primitive version of the Doze feature that exists in later versions of Android which basically just murders apps

scheduling alarm for every second in android 5.1

爱⌒轻易说出口 提交于 2019-11-27 04:31:35
问题 I want to run alarm service for every second in my application.It is working fine below 5.1 version. but it is not triggering in 5.1 devices. I am using commonsware wakeful intent service.The logcat message is saying that " Suspiciously short interval 1000 millis; expanding to 60 seconds ". How can I poll for every second in 5.1? Can anybody suggest me how to achieve this? Explanation little bit more: My use case is I need to do some operation for every 30 minutes interval. AFAIK For this

Android - Wake Up and Unlock Device

别说谁变了你拦得住时间么 提交于 2019-11-27 03:01:06
Application description: The application is intended as a safety program for a specific client (not to be deployed publicly). When the application has not detected movement for a certain period of time, the application should sound an alarm and bring itself to the foreground if it is in the background or the device is asleep. The problem: In the event the device is asleep and locked, we need to wake up and unlock the device. Using various techniques found here on SO and other places, we've been able to (partially) wake and unlock the device, however this ONLY behaves properly when the device