Hacker News new | past | comments | ask | show | jobs | submit login

A friend uses an old phone as a power outage detector. The phone is constantly charged but is set to automatically notify once it's below (IIRC) 97% charge. If a blackout occurs, the battery would drain and the phone would notify. It's not an accurate measurement, but works well in practice.



Surely there's a system call that tells whether or not the phone is charging?


There must be, but my friend chose an almost out of the box solution using an app from the Play Store, and the app only supported alerts per charge level.


3c toolbox might possibly be able to do this more flexibly; it allows running shell scripts in scheduled tasks and "watchers" (run hard on device status). Shell script can probably be used to send a text message.


Or automate for android


"Contains Ads" No thanks




But the phone must also have a connection to a cell tower? Seems expensive.


There's a local provider which has a plan with absurdly low limits (something with about 100 Mb total, tens of SMS messages, etc.) + a low fixed price per month to match. Power outages are rare enough that this application doesn't need much of plan.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: