Originally Posted by bebolf
If your IS is S-OFF then you should be able to use ClockworkMod Recovery to wipe battery status. And to calibrate new battery, you need to charge the new battery until full (there's some dispute on whether to leave it charging for 8 to 12 hours), and then use it until the phone tells you to charge (~1% left).
But NEVER drain your battery to 0%
Finally repeat that process for at least 4 times, new battery calibration done!
Not 100% correct.
If you notice that your battery-left-show-thingy doesn't really match how much battery you really have left, you should use the phone untill it dies. When the phone dies because the battery is "empty" (in quotation marks since it isn't 100% empty if I can recall what I learned from my electronics course correctly..) it re-calibrates the battery stats and should be more accurate next boot.
But except for that fact you're right
If you want the battery to have as long lifetime as possible, keep between 30% and 70% all the time, and when you're not going to use the battery for a long time charge it to 40%!
Some good reading if you want to know more
(well, I know this is a bit off topic, but someone might find this info quite good to know