battery

How to get battery & mobile-data-usage of specific apps?

妖精的绣舞 提交于 2019-12-18 13:38:33
问题 Background Starting with some Android version (don't remember which), Android has the ability to show battery stats and mobile-data-usage (3G...) of the installed apps, so that the user will be aware of such a thing and will be able to think if the app should stay or not. I'm talking about those: The question I've seen some apps on the play store that somehow fetch this data and show it to the user. How do they do it? How can I get the battery stats and mobile data usage of a specific app? Is

Is location provider really a battery drain?

蹲街弑〆低调 提交于 2019-12-18 13:36:39
问题 I need to implement location-based service. I don't need fine location, so no GPS is needed. Easiest would be to start listening for locations updates at app start, and leave it ON: mLocationMgr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 10000, 100, mPendingIntent); Since I don't need much accuracy, I set max frequency of updates, to 10s, and 100m instead of default 0, 0. When we think location, we think battery drain, but I guess this is a shortcut and that only GPS really

How to get battery level with 1 % accuracy in ios

谁说胖子不能爱 提交于 2019-12-18 04:39:08
问题 How to get battery level with 1 % accuracy . [UIDevice currentDevice].batteryLevel Will give battery level with accuracy of 5%. But i recently used Battery Doctor App on my iphone 4S running ios 5.1, which is giving battery level with 1% accuracy . Anyone has any idea , how can we get that accuracy ... I have tried and searched a lot but not getting how they are calculating it .. Thanks in advance... 回答1: Starting with iOS 8, [UIDevice currentDevice].batteryLevel provides 1% accuracy :) 回答2:

Getting Battery Capacity Windows with Python

北慕城南 提交于 2019-12-17 18:59:36
问题 I am looking to figure out both the current Battery Capacity and the Design Capacity. So far what I could get to work is using the Win32_Battery() class which doesn't give all the information I need (at least not on my system). I used the pure-python wmi library for that. On the other hand I found this which works In Python, how can I detect whether the computer is on battery power?, but unfortunately it doesn't provide any information on Capacity neither. The Battery Information structure

Battery-safe coding

两盒软妹~` 提交于 2019-12-17 10:03:38
问题 I was wondering if there are some rules or hints how to prevent battery drain directly while coding. I know that there may be some ways to code to minimize workload on the processor or prevent leaks. However, does anybody have something like a guide or a something like a "checklist" besides the usual suspects like location service and internet connection? 回答1: I'll assume you mean your application. In my experience, the major consumers of energy are, where #1 is most important: CPU usage 4G

Android : Is there anyway to get battery capacity of a device in mah?

柔情痞子 提交于 2019-12-17 09:52:47
问题 I want to get battery capacity of a device to do some battery consumption computation, is it possible to get it somehow? For instance, battery capacity for Samsung Galaxy Note 2 is 3100 mah. Thanks for helping. 回答1: Got it! Couldn't find anything straight in SDK but can be done using reflection. Here is the working code :- public void getBatteryCapacity() { Object mPowerProfile_ = null; final String POWER_PROFILE_CLASS = "com.android.internal.os.PowerProfile"; try { mPowerProfile_ = Class

Calculating battery life in iOS

孤街浪徒 提交于 2019-12-17 04:31:29
问题 Wondering if there are references beyond the Apple tech stats for calculating battery life. I've tried comparing some existing battery apps (battery % left * Apple's figures) and I dont come up with the same answers sometimes. Also there are stats for using 2G cell (as opposed to 3G) and I dont see anything on Apple for 2G battery life. Of course, some of the apps claim they are 'the most accurate'... but I dont see that happening unless someone has a source for very accurate stats. 回答1: The

Calculating battery life in iOS

倖福魔咒の 提交于 2019-12-17 04:31:10
问题 Wondering if there are references beyond the Apple tech stats for calculating battery life. I've tried comparing some existing battery apps (battery % left * Apple's figures) and I dont come up with the same answers sometimes. Also there are stats for using 2G cell (as opposed to 3G) and I dont see anything on Apple for 2G battery life. Of course, some of the apps claim they are 'the most accurate'... but I dont see that happening unless someone has a source for very accurate stats. 回答1: The

Getting the battery current values for the Android Phone

て烟熏妆下的殇ゞ 提交于 2019-12-17 03:55:42
问题 I am trying to collect power usage statistics for the Android G1 Phone. I am interested in knowing the values of Voltage and Current, and then able to collect statistics as reported in this PDF. I am able to get the value of Battery voltage through registering for an intent receiver to receive the Broadcast for ACTION_BATTERY_CHANGED. But the problem is that Android does not expose the value of current through this SDK interface. One way I tried is via sysfs interface, where I can view the

Get Individual App Battery Usage iOS

▼魔方 西西 提交于 2019-12-13 18:34:10
问题 I want to know if there is any way I can get the percentage of battery usage for each app used by the user in iOS using Swift 2. It is like in Settings > Battery and there will be a battery usage group. Please help 回答1: No, there is no simple "show me a battery usage breakdown by app" option. It is quite complex to figure out what factors lead to battery drain. 来源: https://stackoverflow.com/questions/32819490/get-individual-app-battery-usage-ios