I'm using Android 9
on my device, there are many times when I'm away from my phone and it is charging in a different room or someone else is using it, is there was a way to send over the battery percentage say bp over to my PC at regular intervals via the internet.
There maybe apps that can do this but I'm interested more in a script or terminal based approach
Ideas I'm thinking of are:
- using a script manager on my phone like https://play.google.com/store/apps/details?id=org.androidideas.scriptlauncher
crontab
with a script that sends out bp to a copy pasta and my PC can have it's own script reading that- using
cat /sys/class/power_supply/battery/capacity
ordumpsys battery | grep "level:" | awk '{ print $2 }'
once my device is rooted as mentioned here : How to get battery status in terminal? and doing that every N minutes usingcron
I have Termux
installed and my device is not rooted yet how do I proceed.