[Q] Get screen on time. - Android Software Development

I would like to make an application monitors battery usage and stores some info in a database. I don't know how to get the "Time on" info for the display. It's in the stock battery use application.
TL;DR : How to get time display has been on since last recharge? Thanks.

Related

Battery use not showing apps

Hi,
I noticed that most users can monitor their app, services battery usage through the default settings>about>battery use.
However, mine shows only display, idle, standby and calls. Do I have to enable something to be able to see them?
Bought the Galaxy S 4 days ago. Ex iPhone user, got tired of apple and decided to try android as an alternative. So far so good.
--
crazyhendrix
*#*#4636#*#*
Battery history and show the partial wake and cpu and 'other' usage gives a much better picture of battery eating apps than that battery usage one (this menu is exposed in the likes of Android System Info app, or Spare Parts, or SGS tools)
Sent from my GT-I9000 using XDA App
Under 2.2 the battery history is not really detailed and just shows things that used a lot of power, in your case (and everyone else's) the display uses the most power and after that comes usually the radio and calls. If you want more details follow the instructions above or charge the phone and play 15min of angry birds or so, that should show up
Cool. Thanks guys!
--
crazyhendrix

NEED HELP: New To Note/Android.

Before getting the Note, I've been an iphone user ever since the first one came out. I switched especially because of the nice large screen which is handy for the type of work I do.
Some questions though:
1- Battery Life: I was pretty handy on the Iphone in getting everything I didn't need (some notifications, location services on certain apps) turned off to safe battery...while keeping only the ones I wanted. I haven't figured out how exactly to do this on the Note. My battery life is poor...at least compared to what I was getting on the iphone. I typically start my day at 8:30AM, and yesterday by 6PM the battery was already at around 10% (where I can't take pictures....)
2- Must I have GMAIL app and MAIL app? For some reason the GMAIL app's emails update much quicker than the main app I use MAIL. So when a new mail notification comes in I have to manually refresh the MAIL app for it to catch up with the GMAIL app. Otherwise I would have to wait a couple of minutes of the mail to show on MAIL app.
3- On Mail App I have two email accounts. Why is it that my welcome page is the page showing my accounts rather than my "ALL MAIL" page which is where I left it originally?
Thanks for sorry for the NOOB questions.
Ad 2):
Depending on what other email account you have there colud be an specific app for that provider that also supports push email (eg. Yahoo). Or you colud configure Google Mail to poll for mails from your other accounts.
1.) try to close auto sync, bluetooth, gps and use wifi everytime its available because 3G drain much more battery. and lower the brightness on ur screen to ur lowest, that can save a lot of battery (just open them when u need to use it)
or Root your Note and use custom rom. There are many roms that help you with battery.
hope that helps.
lemsanc said:
Before getting the Note, I've been an iphone user ever since the first one came out. I switched especially because of the nice large screen which is handy for the type of work I do.
Some questions though:
1- Battery Life: I was pretty handy on the Iphone in getting everything I didn't need (some notifications, location services on certain apps) turned off to safe battery...while keeping only the ones I wanted. I haven't figured out how exactly to do this on the Note. My battery life is poor...at least compared to what I was getting on the iphone. I typically start my day at 8:30AM, and yesterday by 6PM the battery was already at around 10% (where I can't take pictures....)
2- Must I have GMAIL app and MAIL app? For some reason the GMAIL app's emails update much quicker than the main app I use MAIL. So when a new mail notification comes in I have to manually refresh the MAIL app for it to catch up with the GMAIL app. Otherwise I would have to wait a couple of minutes of the mail to show on MAIL app.
3- On Mail App I have two email accounts. Why is it that my welcome page is the page showing my accounts rather than my "ALL MAIL" page which is where I left it originally?
Thanks for sorry for the NOOB questions.
Click to expand...
Click to collapse
Battery - 10% in a day??! How much were you using the phone?
Allow the phone to fully charge and discharge for a full cycles. The screen is a big consumer of power - don;t use auto-brightness and keep the screen down to the best workable level for you. Also, the more apps you have using push syncing, the worse your battery will be.
Depending on what you're using the phone for, you should easily get a full day's reasonable use out of it.
I agree with the point shaoran_ojo made about wifi - but also turn wifi off when you're not using it.
Finally, it's absolutely right that many of the custom ROMs will give you better battery life
You can check the battery usage over time, if you go to Settings menu and then About phone -> Battery usage. You will see there what eats most power (most likely, Display).
Touch the chart in the upper part of this page to expand it - see if you can relate biggest drops of battery charge to some particular activities. For example, playing Crayon Physics drains the battery extremely fast.
Do you happen to be in areas with poor cell coverage? I've had phones drain like there's no tommorow in poor coverage areas, especially when GPS is turned on since most phones are equiped with assisted GPS chips that use cell-tower triangulation in order to get a faster fix on your position.
You could root your phone and switch to custom kernels or roms for better battery life as well as performance. A few ways in which you could then save battery are by undervolting or underclocking the processor or using an app like titanium backup pro to freeze battery draining apps. Wifi is also a big battery drainer. You can set the wifi sleep policy to screen off to curb its usage or keep it off entirely when you dony need it. Gps and bluetooth can be kept off and the screen brightness can be lowered. Im sure you wont be disappointed with the note's battery life after you tweak it right.
Sent from my GT-N7000 using XDA App
lemsanc said:
1- Battery Life: I was pretty handy on the Iphone in getting everything I didn't need (some notifications, location services on certain apps) turned off to safe battery...while keeping only the ones I wanted. I haven't figured out how exactly to do this on the Note. My battery life is poor...at least compared to what I was getting on the iphone. I typically start my day at 8:30AM, and yesterday by 6PM the battery was already at around 10% (where I can't take pictures....)
Click to expand...
Click to collapse
First of all decrease the screen brightness if possible. I have my brightness set to minimum and I have Screen Filter (free in the market) installed and set to 50%. This setup works for me when I am indoors and when I am outside I just disable Screen Filter. Hopefully it will work for you too, maybe with a little tweaking of the exact percentage.
Then take notice if your phone is unusually hot when you haven't used it in the last 5 minutes. This may indicate there is an app keeping your device from sleeping. Check the battery usage (Settings -> About Phone -> Battery Usage). Tap the graph and look for unusual drops and periods when the screen is not on but the device is awake.
If you notice something, BetterBatteryStats (paid in the market) might help reveal the source of the problem. Cpu Spy (free in the market) will show you how much time has the device spent in each CPU frequency.
If you are comfortable with it just root your device and install a custom kernel. I can't begin to explain how much this can increase the battery life.
Hope this helps and is not too hard to understand despite my bad english.

NexusHD2-ICS-4.0.3-CM9 V1.4 - Battery Life

Hi,
I have been using this series of ROMs for the last few versions. I'm a low user and usually I can get nearly 2 days of usage out of my phone. In idle by current history log shows phone usage goes to about 6mA.
I have noticed an issue were the current jumps upto about 80 to 90mA and stays there, draining the battery very quickly. This seems to happen when I receive a text message for which I miss the notification, so although the phone is supposed to be in idle (screen is blank etc) current consumption has jumped up?
Any ideas?
Regards,
Check the forum for this ROM.
Someone mentioned this is because some programs try to connect to the internet a lot to retrieve advertisements. If they fail, the try again many times and this is draining the battery.
Near the end (page 163 or so) Someone mentioned a program (LBE?) that you can use to disallow internet access, but trick the program into thinking it was successful.
EDIT: Here is the post: http://forum.xda-developers.com/showpost.php?p=22909699&postcount=3631
I'm also running this ROM, and have 52% left after 24 hours typical use (WLAN on all the time) :-D

[Q] Screen destroying battery

So I just figure I'll ask about this, but I have a feeling people will suggest I wipe and I just don't have time to do that anytime soon... But it appears that my screen is absolutely destroying my battery life. I keep the screen off whenever I'm not using the phone, but just now in 6hours on battery i'm down to 69% and 57% of it is all screen. The next biggest is 11% on Android OS. Just doesn't seem normal right? Any ideas?
Screen wil always be at the top of the battery list in Settings, if it is not there is something seriously wrong.
One thing you need to understand; the percentage listed there is not the actual percentage of drain. It's how much of the actual percentage is caused by those apps/systems/hardware.
So 57% screen means that of the total drain, 57% is caused by the screen. The total drain is not 57%.
Try using BetterBatteryStats and Wakelock Detector to find out what is really draining your battery. You can find them here on XDA, and on Google Play.
Do you have autosync on? What wallpaper? Location services?
Send From My Samsung Galaxy Note 3 N9005 Using Tapatalk
All my syncing is on yea, just a plain wallpaper, not a live one, and I have Access to my location and use Wireless Networks checked in location services. GPS is off whenever I'm not using navigation. I'll check out those apps. someone else suggested batterydoctor so I'm playing with that one right now, not that it's really telling me anything except to kill apps, which I know is against the general consensus on these boards (killing apps manually)... And of course it says to turn my brightness down or to auto, which I don't even like the phone when it's not on full brightness so that's a no go.

Awake with Screen Off percentage

Hi All,
I currently own a Nexus 6P and was find the battery life OK.. not great.
Lasts me the whole day but did expect better considering the size of the battery.
I recently installed BetterBatteryStats - my device unrooted and with stock rom etc. so the detail the app could give me was limited.
But from the screenshot attached you can see that at about 20% battery after about a days use - with around 4hr SOT - it shows that 34% of my entire battery usage was when my screen was off.
Which is more than the whole time the screen was on.
Now, I did use Apple Music on my way to and from work on this day which according to the app had a CPU Total time of around 45mins - so could probably minus that from the awake with screen off stats.
Nevertheless- this would still be a massive amount of the battery usage.
In terms of config of the phone, I have wifi on always on, bluetooth is off and bluetooth scanning is off, wifi scanning is on and location is set to high accuracy.
Was just wondering if anyone else had used this app or similar to get their daily stats. Would like to know if there is possibly an app on my phone which is draining my batter faster than expected.
I've attached additional screenshots as well all taken around the time.
One last thing - one of the screenshots attached is something which keeps showing up in my battery stats - Media Server. I have no idea what this is but any knowledge on that would be great.
Thanks a bunch!
dontmess said:
Hi All,
I currently own a Nexus 6P and was find the battery life OK.. not great.
Lasts me the whole day but did expect better considering the size of the battery.
I recently installed BetterBatteryStats - my device unrooted and with stock rom etc. so the detail the app could give me was limited.
But from the screenshot attached you can see that at about 20% battery after about a days use - with around 4hr SOT - it shows that 34% of my entire battery usage was when my screen was off.
Which is more than the whole time the screen was on.
Now, I did use Apple Music on my way to and from work on this day which according to the app had a CPU Total time of around 45mins - so could probably minus that from the awake with screen off stats.
Nevertheless- this would still be a massive amount of the battery usage.
In terms of config of the phone, I have wifi on always on, bluetooth is off and bluetooth scanning is off, wifi scanning is on and location is set to high accuracy.
Was just wondering if anyone else had used this app or similar to get their daily stats. Would like to know if there is possibly an app on my phone which is draining my batter faster than expected.
I've attached additional screenshots as well all taken around the time.
One last thing - one of the screenshots attached is something which keeps showing up in my battery stats - Media Server. I have no idea what this is but any knowledge on that would be great.
Thanks a bunch!
Click to expand...
Click to collapse
The phone calls may also count towards your screen off drain in better battery stats? Honestly 4 hours is about the average screen on time for a stock 6P. I expected it to be more too. I wouldn't worry too much about Media Server unless it's really chewing up battery. It will run when you're playing music.

Categories

Resources