black X battery symbol

hi. Have had MacBook since summer 2008 (operating OS X, version 10.5.8).
Never had any problems of note till now. Here's what's happening, as of yesterday: When machine is charging, a black X will appear (and then go away, and then appear again) through the battery symbol -- i guess indicating that the battery isn't being read? And when the computer is running on battery, it will occasionally shut down. Hitting a key brings it back to life. Then symbol shows X again for a second or so, before returning to normal battery power and indicating how much battery life is left. According to computer, battery condition is good and it's been through only 28 cycles. Last week, i used the machine (with adaptor) in Japan and left it plugged in for a few days at a hotel, but I can't imagine that caused any problems. And yesterday, for the first time, I connected my iPhone 3GS to the MacBook, to transfer some photos. Can't imagine that had any effect, either, though weirdly my iPhone battery also drained mysteriously last night, for the first time, even though phone was shut off. Anyway, any advice as to what might be up here would be greatly appreciated. Machine is no longer on warranty. Thanks.