Measuring battery life remaining with just an analogue in pin

I don't know if your method would work, but the Arduino can measure its own working voltage with this code: Google Code Archive - Long-term storage for Google Code Project Hosting..