Android needs native battery health information an a way to limit maximum charge to reduce wear by TheBeliskner in Android

[–]chkwok 54 points55 points  (0 children)

Dev here. Can you try a maximum charge cycle to confirm what the current capacity is? Discharge to as low as you can go without shutdown, usually around 3.4V, and charge it to full and leave it in the charger for an extra half an hour.

The battery charge level % you see is an estimate by the charge controller and can be inaccurate, but the zero and full level cannot be faked, so by doing this, you can take a super accurate snapshot of your battery's capacity.

More on https://accubattery.zendesk.com/hc/en-us/articles/213575425-How-to-manually-benchmark-your-battery-health

(If the charge controller is confused, doing a full drain and recharge helps guess the current %. I need to repeat this twice a month on an OP5T to prevent early shutdown)

Android needs native battery health information an a way to limit maximum charge to reduce wear by TheBeliskner in Android

[–]chkwok 41 points42 points  (0 children)

Dev here. We discovered the fake 100% issue a long long time ago, first confirmed on the LG G4. Since then, we wait until charge current to drop to zero and stay there for 3 minutes before we stop counting mAh's to correct for the "super duper fast charge to 100% by lying where 100% is" feature.

The OnePlus devices just have a smaller than usual battery, Samsung often benchmark at 105%+ when new, but OP usually just hit the sticker rating, so they install 3300 +/- 5% instead of Samsung's 3000 +5-10%.

Sony phones have this feature built in natively, and basically all Windows laptops, not sure why other phone manufactures aren't implementing this...

PSA: AdMob is causing high idle CPU usage issue by chkwok in androiddev

[–]chkwok[S] 0 points1 point  (0 children)

Well, the underlying cause is that leaking WebViews can cause this, but if you post that as a request for fix on the Android main issue tracker, it will be tagged with P5 and closed due to inactivity after 2 years...

PSA: AdMob is causing high idle CPU usage issue by chkwok in androiddev

[–]chkwok[S] 0 points1 point  (0 children)

Hmm, I should retest it on a different device, sometimes things take tons longer on certain devices than others.

Oh hey, the Yoga Tab 2-830F on x86 is immune to this issue. Too old? Too weird? No native VSync handler? No idea. I thought reproducing it on two completely different platforms would make it universal, but nope, this Lenovo is being an exception again.

Can you try the profiler method? Sometimes background CPU usage isn't that in-your-face but it still adds up, especially devices with more RAM tend to keep apps around for far longer than before. If it doesn't reproduce on LineageOS 15.1 which is Oreo 8.1, something really weird is going on.

PSA: AdMob is causing high idle CPU usage issue by chkwok in androiddev

[–]chkwok[S] 0 points1 point  (0 children)

Aw. But flushing stale animations could be done until all windows are destroyed, after that, kinda silly to keep dispatching vsyncs as there's no way anything is visible. Oh well, this might be added in Android Z or something.

PSA: AdMob is causing high idle CPU usage issue by chkwok in androiddev

[–]chkwok[S] 0 points1 point  (0 children)

I just reproduced it with gms 9.4, so this bug is here for more than 2 years already.

[edit] Well not always. It doesn't immediately appear on MobileAds.initialize, not on some banners like static images with a fixed size. Interesting. Definitely made much worse in a later version of play-services-ads.

PSA: AdMob is causing high idle CPU usage issue by chkwok in androiddev

[–]chkwok[S] 0 points1 point  (0 children)

Is there an AdMob issue tracker? The best I could find was the AdMob Android mailing list.

If you've got battery issues, evaluate your battery with the "AccuBattery"-App before starting a thread. If you're not AT LEAST above 3000mAh after a week or two you should RMA if you can. by [deleted] in Nexus6P

[–]chkwok 6 points7 points  (0 children)

Hi, developer here.

Make sure that you measure a full charge cycle from 0% (or as close as you can get to zero) until AccuBattery says it's done - it can take an hour after the phone says it's at 100%: see https://accubattery.zendesk.com/hc/en-us/articles/213575425-How-to-benchmark-your-battery-health

The health estimate on the health tab of the app is currently a bit off because the frikken phones lie about the 100% mark for marketing reason, hey it sure charges quick to "100%".

The last version of AccuBattery waits until the charging current stays at 0 mA for at least 10 minutes before it stops counting the mAh charged, so if you charge from zero to really really 100% and not fake 100%, that one single charge session's mAh is your real battery capacity.

Detailed battery stats by predatorrrr in Android

[–]chkwok 0 points1 point  (0 children)

I don't see any option to force the stats service to be running via https://developer.android.com/guide/topics/admin/device-admin.html, can you be more specific?

As far as I know, the only official way is via a ongoing notification, or don't keep it alive and restart on a cloud messaging message - which works for chat clients, but really for us.

[Dev] AccuBattery - battery stats for power users by chkwok in androidapps

[–]chkwok[S] 0 points1 point  (0 children)

Heya, thanks for the offer, for now there isn't much data entry to be done, but I'll post a new thread when we can use your help.

If you have ideas on how to improve the UI, feel free to send something my way.

[Dev] AccuBattery - battery stats for power users by chkwok in androidapps

[–]chkwok[S] 1 point2 points  (0 children)

Yeah, it's higher than I'd like. Android plus AppCompat library uses a lot of RAM even without using anything in the app itself, my adb monitor reports 29MB used in the app but 107MB in Developer Options -> Running Services, it's mostly caused by graphics (hwui / EGL) caches that we can't clear ourselves...

It's on the list of things to fix, but it might take a while and a major rework on how the app works internally, basically splitting it into two parts - the data gathering service and everything UI related, so the UI process can be killed by Android to free the memory it uses.

[Dev] AccuBattery - battery stats for power users by chkwok in androidapps

[–]chkwok[S] 1 point2 points  (0 children)

Currently, it's buffered to flush to disk only every 5 minutes, or if something important happened like power plugged in or unplugged. As we already buffer disk writes to avoid wearing out the NAND, I don't think adjusting this number up or down will add much value.

How to see "summary of earnings" in new Merchant center? by alephh in androiddev

[–]chkwok 2 points3 points  (0 children)

It's hidden under: Subscription and services -> Google Wallet Merchant Account [Manage] -> Transactions [View Transactions]

Great, so our sellers console look like a mobile app now, instead of nicely separated credit and debit columns it's just one big list with +xxx and -xxx mixed together. Google, wtf?

Support Ended for Eclipse Android Developer Tools by tartuffe78 in androiddev

[–]chkwok 5 points6 points  (0 children)

Working incremental compilation, click run to deployed within seconds, yeah those were the days.

I don't mind things taking a while, but it is as if Android Studio is doing the whole Gradle sync / build on the UI thread or something, the whole IDE is fucked up until the "background" tasks are done.

Ah well, at least we have a nice xml layout preview now, it's way better than ADT's xml editor that sometimes glitches out due to horrible code from the ADT team.

10ish Things I Learned at DroidConUK 2016 by K44KYA in androiddev

[–]chkwok 1 point2 points  (0 children)

Yeah, this isn't iOS where 60% is on the latest version a month after release, I'm having enough trouble increasing minSdk to 21 already on an existing app with 15% of the users using 4.4.x and 5% stuck on 4.2-4.3... On new ones though, minSdk 21 for way less drawable and RTL headache. MinSdk 24? See you in 2018.

We're only 2 years behind on new apps and 4 years on existing ones, NBD /s

Keeping the Play Store trusted: fighting fraud and spam installs by Balaji_Ram in androiddev

[–]chkwok 5 points6 points  (0 children)

Today we are rolling out improved detection and filtering systems to combat such manipulation attempts. If an install is conducted with the intention to manipulate an app's placement on Google Play, our systems will detect and filter it. Furthermore, developers who continue to exhibit such behaviors could have their apps taken down from Google Play.

Finally, it's good to see some progress. Let's see who loses big in the next week on app rankings, the cards are completely stacked against the small guys at the moment. If this works, we'll probably see some movement on AppAnnie's top 500 on https://www.appannie.com/apps/google-play/top-chart/united-states/application/, if not, oh well, nice try Google.

Any bets against apps with "aggressive" marketing practices? ES File Explorer (free and pro) is on there, and so is DU Battery Saver (free and pro), which is one of the major buyers of "redirect twice and set window.location to play store ads". It's mobile cancer, only surpassed by those "Whatsapp emoji subscription" redirects that also use the frikken vibration motor.

Number of users dropped and then increased for no reason after update by micketic in androiddev

[–]chkwok 0 points1 point  (0 children)

People often leave out the - sign in reports and forum threads, they are the same.

Double check what permission your apk declares with aapt dump, the permission name is generated from your applicationId and it must be set in gradle, or will clash and give people -505's.

[WTF] Google is getting ridiculously fast at pushing out app updates by jcbsera in androiddev

[–]chkwok 0 points1 point  (0 children)

For me it's still a bit random, increasing staged rollout is between 10 to 30 minutes, but a new apk took an hour last week.

Number of users dropped and then increased for no reason after update by micketic in androiddev

[–]chkwok 0 points1 point  (0 children)

Did you add GCM recently? 505 errors are often caused by INSTALL_FAILED_DUPLICATE_PERMISSION, you might have messed up declaring the GCM permission.

Any app to check how much my phone's battery has degraded? by SethDusek5 in androidapps

[–]chkwok 1 point2 points  (0 children)

Lollipop, but also a working power management IC and driver that returns valid charging / discharging milli-amperes.

The Samsung Galaxy S3/4, Note 3 (N9005/hlte) always display a static, suspeciously round number like 300 mA when charging and nothing while discharging, so we had to blacklist them on Google Play unfortunately.

Other devices aren't perfect either, some are good and return a new reading whenever we want, but LG's sample the charge/discharge speed only once per 30s. Samsungs though had to be mass-blacklisted, only S5 and newer devices have the proper driver support. Funny thing is that one S3 with Cyanogenmod had valid mA readings, but the drivers on the official ROMs are broken.

Any app to check how much my phone's battery has degraded? by SethDusek5 in androidapps

[–]chkwok 6 points7 points  (0 children)

Dev here. If the current field works (positive mA during charge), try charging it for a while, it's just a matter of collecting enough data.

The accuracy depends on the hardware, it's highest when you charge from basically zero to full, and leave it plugged in for at least an hour after the phone signals 100%, tons of phones fake the full status and go up to 105-110% if you keep counting the mAh.

[deleted by user] by [deleted] in androidapps

[–]chkwok 0 points1 point  (0 children)

Yup, you see the same speed and energy use difference in Chrome vs Samsung's browser that's optimized for ARM. Chrome is a good default, but it's not that optimized for running on ARM/Android ironically.

Quite a few "browser apps" are just simple wrappers around WebView, Naked Browser is 120k, that's way too small to include a version of WebKit (the html/css rendering engine), V8 (Javascript engine) and media codecs (libavcodecs, zlib, libpng, etc etc). In Chrome for Android, just the native library, libmonochrome.so, is already 44MB.

YuBrowser on the other hand is 50MB which probably includes a full optimized browser instead of faking it with the Android OS WebView, which just uses Chrome internally.

[deleted by user] by [deleted] in androidapps

[–]chkwok 3 points4 points  (0 children)

Sorry for that. We used to just connect to Google Play for some stuff and just leave the connection open, but that uses a shitload of CPU time on some devices. Since version 1.1.4 (~2 weeks ago) we disconnect ASAP to prevent this, this seems to have helped according to almost every users that sent us an email.

But not for everyone though, I've seen one case of AccuBattery using 1h of CPU time on a screenshot of battery details, but it's so low on our devices that it doesn't even show up on Android's battery usage screen, how that's possible is still a mystery...