I found this - increases battery life while apps open faster - confirmed via AccuBattery testing for a couple of weeks:
You can force ART compiler's AOT(Ahead Of Time) compiler to force compile all the apps ahead of time instead of JIT(Just In Time) which compile apps on the fly when you open and use different parts of an app.
By default google uses a profile-based method to only compile the most used parts of an app. (You can find more info by reading the source which I've mentioned below)
Remember forcing compilation take some time depending on how many apps you have installed.
Only downside is this takes up little bit more storage space due to compiled .oat files are being larger in size compared to dex files.
For example for me, apps installed without forcing compilation takes about 30GBs of space in total and after compilation it takes about 39GB.
I have a Pixel 4a. I root with Magisk and run the Advanced Charging Controller (ACC) module to stop charging at 80%. Then for convenience I run the ACCA frontend app in the rare case I want to disable that.
Then like others I run AccuBattery for stats, and uninstall/replace apps that use a disproportionate amount of power.
I try to keep the charge level in the 20-80% ideal range. I should use a slow charger too but honestly I usually can't be bothered to swap it since I tend to use the same charger for multiple devices (a nice one that does a variety of voltage and amperage outputs).
This strategy has gotten me a lot of life out of devices, but at this point with my 4a I still generally leave Android's battery saver mode turned on too.
A note for people wanting to use ACCA (GUI frontend for ACC), ACCA isn't being maintained (the ACC guys will tell you not to use it, but still can). Make sure to install ACC manually first to get the latest version, as the app downloads a version from 2021 if you don't and this can cause issues.
After that, the app works fine for basic use.
I use the accubattery app for setting charge alarm at 80%. My phone also has the option to pause charging at 85%. I don't charge my phone overnight. I simply charge my phone once or twice a day when the battery gets to ~40%-50%.
My phone support (and came with) a 33W charger, I tested it and it properly charges at 11V 3A, very quick, I used it 2 or 3 times only in emergency because I had to go and 20 minutes charges to 70% or something.
Else? My phone is on my desk, connected to the computer, it charges slowly (5V 500mA?), when it reaches 80-85% I unplug it.
I WFH so it is never a problem, I keep my phone between 30 and 80% most of the time. After 2 years battery life is still impressive I think.
One thing I do is check before buying the phone that battery replacement is not too difficult. Looking on ifixit.com and web search for "battery replacement model XYZ" both find good info about this.
I've given up on looking for phones with swappable batteries (they almost don't exist any more) but a phone where you can do a battery swap with a few simple tools is far better than one where you have to perform delicate microsurgery. Then just accept that batteries are consumables that have to be replaced once in a while.
The fact that we have threads and articles about prolonging battery longevity is a sure sign that the sealed internal battery is a technological failure if the idea is that it should outlast the rest of the phone. The real idea is of course much different.
If you wanna look for positives here, replacing the battery had at least gotten way less risky ever since everyone moved to glass phones. They are almost always opend from the back which means you don't have to touch the display - by far the most fragile and expensive part.
Of course user replaceable ones would still be way better, but still.
I thought glass phones were for wireless charging, which I've associated with difficult battery replacement, though maybe that is coincidence. I decided against some older Pixel phones because ifixit rated battery replacement as difficult. My old and new Android phones both have plastic backs. Old phone is fairly easy (undo a lot of tiny little screws, replace battery, replace screws). New one is more difficult (heat edge of phone and pry apart) but I think it is not as bad as some. Will see how it goes when the time comes.
Honestly maximizing my phones current daily battery life, so that I don't need to charge it as often.
My previous phone (Xiaomi Redmi Note 4x lasted me 4 years 2018-2022, and the reason I moved off of it, was because it's GPS was wonky and I couldn't use it as satnav, and the Micro USB port was dodgy since I got it and I grew tired of using it. It's battery life is still great and when I do use it as a temp phone, it still is great.
What I did with that phone, was root it, installed Lineage/Arrow OS without Google Play, then installed the bare minimum that is required to get Google Play to work. When I originally did this with my Note 4x the battery life went from barely 1-1.5 days to an easy 2 days depending on my usage. I think it's now at a solid 1.5 days, but it's been sitting in a drawer at 1/2 charge so... meh.
My other trick, is to reduce screen on time. Learned that lesson with an old Blu phone I had. After looking at my battery drain, it's obvious that the less I am on it, responding to messages and looking at emails, the longer it lasts. My solution there was a Pebble Time, so I can look at and respond to arrant notifications and emails. Sadly the Pebble isn't as good as it use to be, since responding to texts is bad, and Rebble isn't as active as it needs to be for me to keep using my Pebble.
My new smart watch is a Garmin Forerunner/Fenix. I had a 235 but it was missing basic watch features, my SO has a 245 which works great for their needs, and I splurged and got a Fenix 6 during a massive discount sale, the watch was over half off. Barely use it for its intended purpose, but for a notification machine that lets me see my emails and messages, all while lasting 2+ weeks, it's nice.
Current phone (Poco X3 Pro) lasts easily 3 days without a charge, and light lemmy doom scrolling or about 8-10 hours of constant screen on time.
Its gives you a extremly detailed breakdown with everything related to stuff consuming power on a device. Problem is you have to jump through a few hoops to get this running (like installing docker, adb, ...).
Most manufacturers made a decision to set the range their devices will charge to based on what is less likely to fail so quickly you'll get mad at the manufacturer, but they trade off significant battery life for slightly higher design capacity (or perhaps more likely, they see shorter battery life as a feature not a bug, as long as it doesn't catch fire, since it will mean your phone becomes e-waste faster and you give them more money).
Battery chemistry tells us that avoiding those extremes of high and low charge (shutdown earlier on low charge in the rare event that happens, stop charging at a lower level) drastically increases battery life - it is aligned with my interests, even if not the manufacturers'.
Get a chargie! (Chargie.org). I can't recommend this thing highly enough. It's a small Bluetooth device that sits between your phone and the charger. When your battery hits a set % it will shut off the power.
I've used one since I got my pixel 7 pro. Accurately says the battery health is still 98% after 14 months.