battery

How to get battery level with 1 % accuracy in ios

冷暖自知 提交于 2019-11-29 06:10:56
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... Nandan Sawant Starting with iOS 8, [UIDevice currentDevice].batteryLevel provides 1% accuracy :) If you turn off Setting->General->Usage->Battery Percentage, Battery Doctor shows your battery

Getting Battery Health Information on iOS

社会主义新天地 提交于 2019-11-29 02:34:53
问题 There are currently apps in the app-store (so it does not require jailbreak) that tell you : Exact percentage value of battery level you have on your iPhone. I have tried Apple's official Code Sample, although it tells you when your iPhone is charging and discharging but it gives me values in 5% steps. How do these apps get exact values of battery percentage ? Applications like Battery Health show Current Maximum Capacity vs Manufacturer's Capacity Current Discharge Rate Lifetime Battery

Android data storage - File vs SQLite

扶醉桌前 提交于 2019-11-29 01:51:45
I am developing an application that periodically sends information to an external server. I make a local copy of the data being sent, for backup purposes. What is the best option to store the data in terms of saving battery life ? Each data submission is a serialized object (the class has 5 fields, including a date, numbers and strings) of about 5K-10K. Any other idea? I have no idea in terms of battery life directly but one criteria would be which is easier to manage? Fewer operations to manage the data would mean fewer CPU cycles and in turn longer battery life. I would say the SQLite option

How does Android determine if an app has “High Battery Use” under “Recent Location Requests”?

北慕城南 提交于 2019-11-28 20:36:22
问题 As of Kitkat (4.4) Android reports that my app is "High battery use". I use Network Location as well GPS. If I disable GPS, then it seems the app gets marked as "Low battery use". I'm wondering if there are any tips to using GPS while keeping the "Low battery use" label. Perhaps if you poll infrequently enough - or is it hardcoded to GPS = battery killer? EDIT: I understand that changing those parameters will conserve battery life. My question was more of whether Android will recognize these

Getting iPhone's battery level

元气小坏坏 提交于 2019-11-28 19:58:29
I have a simple question. How do I get iPhone's battery level? [UIDevice currentDevice] batteryLevel] Simple enough? However there is a little catch - I can't use UIKit . Here is what I wrote so far, but I don't think it works: // notification port IONotificationPortRef nport = IONotificationPortCreate(kIOMasterPortDefault); CFRunLoopAddSource(CFRunLoopGetCurrent(), IONotificationPortGetRunLoopSource(nport), kCFRunLoopDefaultMode); CFMutableDictionaryRef matching = IOServiceMatching("IOPMPowerSource"); kern_return_t kr = IOServiceAddMatchingNotification(nport, kIOFirstMatchNotification,

Replacing the battery indicator (Android)

喜夏-厌秋 提交于 2019-11-28 09:23:50
问题 There's an open source battery indicator that I greatly prefer to the default one. I was wanting to modify it to replace the default battery indicator. Is this even possible without building a whole custom ROM? 回答1: I do not believe it is possible without building a whole custom ROM. 回答2: Yes, it is possible to do without building a new custom ROM, but you still need root access. the .png files for the battery indicator are in the framework-res.apk, you can extract that, replace just the .png

Battery broadcast receiver declared in manifest file does not work?

一个人想着一个人 提交于 2019-11-28 08:00:42
问题 There are two ways to make a broadcast receiver known to the system: One declares it in the manifest file with this element. The other is to create the receiver dynamically in java code. Now, the receiver has been created dynamically in java code and it does work normally.But why the first way "Declare in the manifest file" failed? Is there anyone to success? Thanks. AndroidManifest.xml <receiver android:name="pj.batteryinfo.BatteryReceiver"> <intent-filter> <action android:name="android

Socket connections and Polling. Which is a better solution in terms of battery life?

只愿长相守 提交于 2019-11-28 03:56:10
So... I'm making an application for Android. The application needs to send and receive realtime chat data (needs to be a socket) but it also needs to send commands (which don't as the client knows when it is sending something). I need to know what is a better solution in terms of saving the user's battery. a) Opening and Closing the connection every time a command is sent, if the chat tab is opened then keep the connection constant. b) Keep the connection constant all the time. I've taken a look around the internet but have gotten mixed answers, some say keeping a persistent connection is bad

Battery effects of web apps?

无人久伴 提交于 2019-11-28 01:39:13
问题 I am learning about mobile web apps, and they look interesting. Among other things, I am wondering whether there is a significant difference in battery consumption between the native apps and web apps? (Phonegap, intel xdk, etc)? 回答1: There can be a significant difference due to use of transceivers (i.e. the receiver and transmitter on your phone/tablet). On any mobile device, whether notebook, tablet or phone, the processor and peripherals drop into power conserving sleep states. Processor

Create “Battery usage” intent android

六月ゝ 毕业季﹏ 提交于 2019-11-28 00:04:00
On my nexus one, there is a handy app reachable from Settings > About Phone > Battery use. I'd like to StartActivity() that app from one of my Activities. I can see in the log that when Settings runs it, this intent is logged: Starting activity: Intent { act=android.intent.action.MAIN cmp=com.android.settings/.fuelgauge.PowerUsageSummary } I'm having trouble relating that to something in Android Java source. I can't even find "fuelgauge" in the GIT source. Can anyone point me to the right file, or anything else helpful, like how to create the right kind of Intent? Thanks Peter Code is as