power-management

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

ぃ、小莉子 提交于 2019-11-29 03:19:49
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? Vladimir Ivanov 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/what-are-the-units-for-battery-temperature-and-voltage-when-intent-battery-actio

per process power consumption in Android

放肆的年华 提交于 2019-11-28 20:57:17
Is there a way to see the power consumption of an Android process? I have a rooted HTC Hero, and I have developed some native programs in C language. I want to see the power consumptions of these programs. So, I want a way to measure the power consumption in process level and not in application level as e.g. PowerTutor application does.. Is there an API that can help me develop an application that can do this thing? Can I use /proc/ stats etc.? any ideas on this? neteinstein As said here: Android Battery usage profiling There is a private API, PowerProfile, for retrieving battery consumption

Controlling simple relay switch via USB

天大地大妈咪最大 提交于 2019-11-28 19:13:16
问题 I'm looking to control a mains powered light from a simple relay switch connected via USB to the computer. The relay switch isn't even a USB device, it's just a simple switch that requires the USB voltage to turn it on. When the voltage drops below a threshold, the switch will turn the light off. My problem is that I can't control the power output of a USB port. I'm happy to do it using any language on Windows or Linux (but preferably Java because I'm used to it). 回答1: Unfortunately, in most

Power Efficient Software Coding

流过昼夜 提交于 2019-11-28 17:01:40
问题 In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are used to clock the hardware at lower Cycles or turn of the clock entirel to some unused circutis to save power, but i am looking for some ideas from that point of view: Wherein my

Detect Changing Battery state at every percentage in android

半城伤御伤魂 提交于 2019-11-28 09:28:47
i want to detect battery change at every percentage. I am able to detect battery level once with broadcast receiver. But its not updating value automatically when % change from 66 to 67. Here is my code. private void batteryLevel() { BroadcastReceiver batteryLevelReceiver = new BroadcastReceiver() { public void onReceive(Context context, Intent intent) { context.unregisterReceiver(this); Log.i("Battery CHANGED******",":: IN RECEIVER"); int rawlevel = intent.getIntExtra("level", -1); int scale = intent.getIntExtra("scale", -1); int level = -1; if (rawlevel >= 0 && scale > 0) { level = (rawlevel

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

谁说胖子不能爱 提交于 2019-11-28 04:59:37
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 events stop being delivered (verified by using a Log.e message every N times onSensorChanged gets called).

Monitor battery charge with Win32 API

廉价感情. 提交于 2019-11-28 03:49:47
问题 I'm trying to write a small app that monitors how much power is left in a notebook battery and I'd like to know which Win32 function I could use to accomplish that. 回答1: For Vista and up you can use RegisterPowerSettingNotification For earlier functions see the Power Management Functions in this section of the MSDN page "Power Management Functions: Windows Server 2003 and Earlier" You can see example code of the Vista method on codeproject. 回答2: I recommend the use of the Win32

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

懵懂的女人 提交于 2019-11-27 17:03:46
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 Xiaomi - Settings > Developer Options. Disable "memory optimization". To enabled Developer Options go to

per process power consumption in Android

牧云@^-^@ 提交于 2019-11-27 13:20:06
问题 Is there a way to see the power consumption of an Android process? I have a rooted HTC Hero, and I have developed some native programs in C language. I want to see the power consumptions of these programs. So, I want a way to measure the power consumption in process level and not in application level as e.g. PowerTutor application does.. Is there an API that can help me develop an application that can do this thing? Can I use /proc/ stats etc.? any ideas on this? 回答1: As said here: Android

Correct method for setKeepScreenOn / FLAG_KEEP_SCREEN_ON

二次信任 提交于 2019-11-27 11:42:30
I am using the method setKeepScreenOn(true) and haven't been able to figure out how to call this in relation to the current Activity (which has a content view set). I've been able to get it to work by calling it on one of my buttons which is always present in the view, but this feels wrong - and I'm sure there must be a way to get around this. I tried referencing the current focus like this: getCurrentFocus().setKeepScreenOn(true); but that threw a NullPointerException. Maybe there was no current focus. So, can anyone tell me how I can reference the view class which I am working inside? Thanks