android-wake-lock

SMS gateway how to program android app [closed]

倾然丶 夕夏残阳落幕 提交于 2019-12-23 05:44:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 3 years ago . I want to make a SMS gateway app, that polls my website and checks if there are messages to send in the queue, and if there is, the app will send it to the destination number. There should also be a callback function, where I will post information about the message, what android did exactly with it. I thought

BroadcastReceiver wake lock needed if only AsyncTask is executed?

久未见 提交于 2019-12-23 01:34:16
问题 I have got a class, which extends from BroadcastReceiver and gets called from AlarmManager . In the onReceive method I execute an AsyncTask , which fetches some data from the internet and stores the data in the local database of the application. Do I need to acquire wakelock with: @Override public void onReceive(Context context, Intent intent) { PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "");

Using a wakelock in a service Android 1.5

淺唱寂寞╮ 提交于 2019-12-21 01:18:23
问题 Hello I am trying to use a service to control a wakelock so I can permanently leave the screen on when my application is running. I create the wakelock and activate it in onCreate() and release it in onDestroy() however I get the error "wl cannot be resolved". Can someone explain how I can get over this? Code below: public class WakeLockService extends Service { @Override public IBinder onBind(Intent arg0) { // TODO Auto-generated method stub return null; } @Override public void onCreate() {

Aquire partial wakelock in a IntentService

谁都会走 提交于 2019-12-20 07:37:51
问题 My IntentService gets fired from 2 places, either by an Alarm or by the Activity and since the duration is related to the amount of data it needs do fetch from the web, from what I understood, I need to keep a partial wakelock. Here's my implementation: @Override protected void onHandleIntent(Intent intent) { PowerManager pm = (PowerManager) getSystemService(POWER_SERVICE); WakeLock wakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "WakeLock"); try { wakeLock.setReferenceCounted(false

Is using WakeLock overkill while using WifiLock on Android?

本秂侑毒 提交于 2019-12-19 19:56:38
问题 My audio streaming app is working correctly with only WifiLock. But some devices report that when they turn off the screen, connection is cut and audio streaming is topped. (They say this does not happen on 3G) So, I thought maybe I can also use a Partial WakeLock. I am not sure if this fixes the issue but I think it is an option. At the same time, adding a WakeLock while a basic WifiLock is working may deplete the battery faster and may not fix the issue. What do you think about adding a

what is the proper, non-deprecated way to wake up the device?

本秂侑毒 提交于 2019-12-18 11:26:07
问题 My requirement is: after a GCM message arrives, the device should wake up to display a high-priority notification. The device should turn the screen on . Currently I'm using WakeLock to achieve this. The newWakeLock() method expects a lock level AND a flag to be passed (as the 1st param, bitwise or'd). I'm using PowerManager.ACQUIRE_CAUSES_WAKEUP flag since it does exactly what I need. However, I'm a bit frustrated about the lock level. So according to the docs, I got the following options:

Does the Android OS release a wakelock if the app or service holding it is killed?

只愿长相守 提交于 2019-12-18 10:16:36
问题 I have question about wakelock. In cases shown below, does android OS release wakelock ( PARTIAL_WAKE_LOCK if you need to specify) to prevent wakelock was left acquired and wasting battery until turning power off (not sleep). Case 1-a: App has acquired wakelock (w/o timeout option) in one of its threads (please think it is reasonable in this case) and it was designed to release wakelock when critical task was finished. App can be killed by taskmanager or notorious taskkiller, and app has no

Android Service Listener for the wakelock screen

杀马特。学长 韩版系。学妹 提交于 2019-12-17 21:36:56
问题 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 :) 回答1: There is no sanctioned way to replace the lock screen. See Is there a way to override the lock pattern screen?

PowerManager wakelock not waking device up from service

岁酱吖の 提交于 2019-12-17 16:53:52
问题 I've an app that has a background service running every minute. I want the service to wake the device up if it's asleep. I am using a PowerManager but the device doesn't wake up. Any ideas why? Thanks in advance. @Override protected void onHandleIntent(Intent intent) { PowerManager pm = (PowerManager) getSystemService(Context.POWER_SERVICE); PowerManager.WakeLock wl = pm.newWakeLock(PowerManager.FULL_WAKE_LOCK, "My Tag"); wl.acquire(); // do work as device is awake wl.release(); } [edit1]

Guarantee that android keeps on retrieving sensor data

心不动则不痛 提交于 2019-12-14 02:51:50
问题 I'm developing an app that tracks trips. After searching about this matter, I concluded that the best way to achieve this (continuously track the user's location) is to use a foreground service. In some cases is working quite well, but in some other cases (even with DOZE off), I get some time intervals in which the phone is completely still and I stop getting sensor data (either accelerometer or locations from fused location provider). This problem got worse when I tried it in an Android 9