The voltage divider and analog-in approach seems more desirable, because it's an analog reading, not just a 1 or 0. I would probably have the Arduino-powered device send it's battery voltage via serial to a computer, which would log the voltages until the thing dies (one-time calibration). Then, that value would help the Arduino know when it is going to run out of power.
A voltage divider is nice and simple way to implement a battery meter. It won't tell you how much life is left in the battery but the voltage can provide a serviceable indication of the battery state.
There is lots of info on voltage dividers on the net. In this example http://www.staff.cofa.unsw.edu.au/~bradmiller/physical_computing/analog_io.html, two 4.7k fixed resistors should be used instead of the resistors shown and the +5v will actually be the +9v from the battery.
The Arduino code below uses integer math (floating point consumes lots of memory).
Notes:
The battery voltage on the divider ranges from 0 to 10 volts.
The voltage on the arduino pin ranges from 0 to 5 volts (assuming two 4.7k resistors)
So an analogRead value of 1024 = 10 volts on the divider
Therefore one bit is equal to 10v divided by 1024
// function to print the voltage on the given pin to the serial port
// the pin should be an analog port that has two 4.7k resistors
// connected as a voltage divider to a 9 volt battery
// CAUTION, the voltage on the pin must not exceed 5 volts
void printVolts(int Pin) {
int value = analogRead(Pin);
Serial.print("voltage is: ");
Serial.print(value / 102,DEC); // print the integer value of volts
Serial.print("."); // decimal point
Serial.println(value % 102,DEC); // hundredths of a volt
}