power-management

What are the units for battery temperature and voltage when Intent.BATTERY_ACTION_CHANGED on android device?

☆樱花仙子☆ 提交于 2019-12-18 03:56:15
问题 I retrieved battery temperature and voltage information using the intent Intent.ACTION_BATTERY_CHANGED and the values I got are pretty weird. I could not get any clue: temperature=270 and voltage=3782 ! What are these values? Do they have any units like celsius, fahrenheit or milli or micro volt? 回答1: voltage- int, current battery voltage in millivolts temperature - int, current battery temperature in tenths of a degree Centigrade From here. 来源: https://stackoverflow.com/questions/4860415

Accelerometer stops delivering samples when the screen is off on Droid/Nexus One even with a WakeLock

丶灬走出姿态 提交于 2019-12-17 17:44:31
问题 I have some code that extends a service and records onSensorChanged(SensorEvent event) accelerometer sensor readings on Android. I would like to be able to record these sensor readings even when the device is off (I'm careful with battery life and it's made obvious when it's running). While the screen is on the logging works fine on a 2.0.1 Motorola Droid and a 2.1 Nexus One. However, when the phone goes to sleep (by pushing the power button) the screen turns off and the onSensorChanged

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]

How to start Power Manager of all android manufactures to enable background and push notification?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 10:11:38
问题 Some Android devices due to custom Android tweaks are done by manufacturers has some politics about Power Management that breaks some features like push notifications. Huawei - Only Pre-EMUI 5.0 / Android 7 - Go to Settings > "Protected apps", check your app. Sony - Tap on the battery icon. Go to Power Management > STAMINA mode > Apps active in standby > Add your app. Asus - Check your app in the Auto-start Manager. Xiaomi - Security (App) > Permissions > Autostart - Enable your app *New

How to start Power Manager of all android manufactures to enable background and push notification?

China☆狼群 提交于 2019-12-17 10:09:06
问题 Some Android devices due to custom Android tweaks are done by manufacturers has some politics about Power Management that breaks some features like push notifications. Huawei - Only Pre-EMUI 5.0 / Android 7 - Go to Settings > "Protected apps", check your app. Sony - Tap on the battery icon. Go to Power Management > STAMINA mode > Apps active in standby > Add your app. Asus - Check your app in the Auto-start Manager. Xiaomi - Security (App) > Permissions > Autostart - Enable your app *New

Created a script to toggle lid close action (sleep/do nothing) I can see it take effect, but it doesn't work

◇◆丶佛笑我妖孽 提交于 2019-12-13 04:08:20
问题 I've made a vbs script which basically toggles the close lid action between Sleep and DoNothing. The idea is to have an icon on my desktop to save going ControlPanel>PowerOptions>ChangeWhatClosingTheLidDoes every time. I'm on Windows 7 x64 by the way. When I run it, in control panel I can see that the lid close action changes, however when I actually close the lid, there is no change in behavior. Any suggestions on what could be preventing the system from obeying it's instructions?? It's

How to get an estimated amount of talktime,music/video playback time, idletime that could be possibly done based on the current level of battery left

妖精的绣舞 提交于 2019-12-12 14:20:09
问题 I am working on the amazing android platform. I am creating an app which deals with the phone's battery level.I am showing the current battery level of the phone, along with few other technical things.I wanted to get an estimated amount of talktime,music/video playback time, idletime that could be possibly done based on the current level of battery left on the phone.Using this the user can get an idea that if his battery level is at 50% then possibly he can do another 2 hours of call talk (or

What is the Cocoa equivalent of UpdateSystemActivity?

☆樱花仙子☆ 提交于 2019-12-12 10:57:11
问题 I'm converting a Carbon app to a Cocoa app and I can't find the Cocoa equivalent for: UpdateSystemActivity(UsrActivity); Any Mac people out there care to point me in the right direction? Thanks. UPDATE : I'm building 64bit. Building 32bit works fine, but I get symbol not declared in this scope errors for UpdateSystemActivity (and others) when I build for 64bit. UPDATE2 : I'm importing the following: #import <Cocoa/Cocoa.h> #import <Carbon/Carbon.h> #import <OpenGL/CGLMacro.h> Is there some

Android : Do something when battery is at a defined level

梦想的初衷 提交于 2019-12-12 07:32:16
问题 I'm stuck with a little problem here. I want my app to do something, but only when the battery is at 10%. My app doesn't watch the battery level constantly; it just waits for a LOW_BATTERY intent. It works if i don't specify a level, but it works 3 times: 15%, 10%, and 5% I only want it to do something at 10%. Here is my code : public void onReceive(Context context, Intent intent) { if(intent.getAction().equals(ACTION_BATTERY_LOW)) { int level = intent.getIntExtra(BatteryManager.EXTRA_LEVEL,

Communication between Android devices

别说谁变了你拦得住时间么 提交于 2019-12-12 05:37:07
问题 I'm looking for a way to allow a device to send secure notifications to another device with minimal battery loss. I am currently doing this using a SSLServerSocket however I feel like keeping a socket constantly open is very poor for battery life. The other option I considered was to just have a socket listening for a connection but I'm not sure if this is any better. I need the notifications to be sent instantly so using a timer and connecting every x number of minutes is not optimal. Are