battery

Android app high CPU usage, no services or wakelocks

為{幸葍}努か 提交于 2019-12-13 05:48:19
问题 I've forked the system messaging app and it is consuming the majority of my CPU, and others have reported the same. I cannot for the life of me determine why. I figured the drainage could be possibly two things (because of how much it is draining): a wakelock that has not been released, or a service doing continuous computation. Here's what I have tried: adb shell dumpsys power This shows Wake Locks: size=0 so I am assuming it is not a wakelock issue (the app uses wakelocks, of course, but I

Get battery recharge time

二次信任 提交于 2019-12-13 04:22:24
问题 I was asking how to find out the recharge time of the battery. There are several apps that can do this but I didn't find something except this How to find the battery recharge time of android mobile programatically? Is there any new possibility except measure the time for 1 percentage and calculate it? If not how can I measure the time? 回答1: You can do it in a different way.But for the 1st time each phone that has installed your app it will need to charge from 1 percent to full.It will

Battery API is not working on chrome pop up window

人走茶凉 提交于 2019-12-13 02:46:53
问题 is there a way to get the Battery object in chrome pop up windows I am using this code to create pop up chrome.windows.create({'url': 'mypop.html', 'type': 'popup'}, function(window) { }); but having problem to return the battery object using this code var battery = navigator.webkitBattery; when I am calling the javascript file on the mypop.html page. Is it the chrome security issue that disallow battery object on pop up page? 回答1: Looks like its been removed from Chrome as navigator

How to get the exact battery level?

a 夏天 提交于 2019-12-13 00:35:59
问题 This is simple code of my simple batteryLevel Test app. - (void)viewDidLoad { [super viewDidLoad]; UIDevice *device = [UIDevice currentDevice]; device.batteryMonitoringEnabled = YES; mLabel.text = [NSString stringWithFormat:@"%0.5f",device.batteryLevel]; } This is the image of my app, hope you can see the status bar battery level and my application battery level. I don't know why these levels are different....? one is 99% and apps level is 0.95 which is actually 95% 回答1: // Enable this

Exactly how much power is drained by registering a broadcast receiver for ACTION_BATTERY_CHANGED?

社会主义新天地 提交于 2019-12-12 11:26:16
问题 I am planning to write an app whose sole purpose will be to monitor the battery level, and launch an intent the moment it drops below a certain level. My one concern is that this itself will be a battery drain, and no one will want to use it. So my question is: Exactly how much power is drained by using the ACTION_BATTERY_CHANGED broadcast receiver? Does anyone know approximately how much battery life we're talking about? 回答1: I don't think you'll drain much power. This broadcast is sent only

Battery circle like Battery Widget Reborn

蹲街弑〆低调 提交于 2019-12-12 09:09:09
问题 I am trying to make draw a circle based on the battery percentage. I have the following code: Bitmap.Config conf = Bitmap.Config.ARGB_8888; // see other conf types Bitmap bmp = Bitmap.createBitmap(200, 200, conf); Paint mPaint = new Paint(); mPaint.setDither(true); mPaint.setColor(Color.BLUE); mPaint.setStyle(Paint.Style.STROKE); mPaint.setStrokeJoin(Paint.Join.ROUND); mPaint.setStrokeCap(Paint.Cap.ROUND); mPaint.setStrokeWidth(5); circle = new Path(); circle.addCircle(100, 100, level,

Battery is draining because of alarmManager and Broadcast Receiver I think

流过昼夜 提交于 2019-12-12 02:22:09
问题 HI i have an app like a applock (not applock) , which checks for current app running with list of selected apps by a user , if it matches then I hv my code . I have an service which doesnt have any loops calls StartupReceiver .Class(broadcast Receiver) which inturn calls CheckRunningApplicationReceiver.Class(broadcastReceiver) which checks the current activity . I am calling CheckActivity for every 0.5 second . And i do lot of storing and retrieving strings in internal storage inside the

UIDeviceBatteryStateDidChangeNotification not working on iOS 8

空扰寡人 提交于 2019-12-11 18:08:25
问题 I am working on a Cordova app and I need to know the initial state of the battery and get a notification when the state changes. I am using iOS 8 on an iPod Touch 5g. I am getting the code from: https://github.com/apache/cordova-plugin-battery-status/blob/master/src/ios/CDVBattery.m, so it should work... I do this in AudioController.mm: #import "AudioController.h" #import <UIKit/UIKit.h> #import <AVFoundation/AVAudioSession.h> #import <MediaPlayer/MPMusicPlayerController.h> #import

Android App Google Play Services Battery Drain

混江龙づ霸主 提交于 2019-12-11 13:17:58
问题 When using Google Play services API for location and In App Billing request, does the associated Battery/CPU/Wifi/Network usage show up under battery stats under Google Play Services or under the App's Name ? To my experience OS always shows usage under the associated app's name. However I have a user claiming that my app causes Google Play Services battery drain with 8-10% on his Nexus 6P when my app does not even show up on his battery stats at all. Is this somehow possible ? 来源: https:/

Finding battery current (mA/mAh) on Android Tablet

爱⌒轻易说出口 提交于 2019-12-11 06:25:42
问题 This question was migrated from Android Enthusiasts Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I'm creating an application, and I need to be able to get the battery current (mA/mAh) . I have the voltage/temp/level etc and this is the final thing I need to get, and coincidentally the hardest too. I've looked at CurrentWidget source code (https://play.google.com/store/apps/details?id=com.manor.currentwidget&hl=en) and searched Google high and low, and I