Predicting the residual energy of the battery source that powers a portable electronic device is quite important in designing and employing an effective dynamic power management policy in the device. This paper presents a closed-form analytical model for predicting the remaining capacity of a lithium-ion battery. The proposed high-level model relies on online current and voltage measurements and, at the same time, correctly accounts for the temperature and cycle aging effects. The accuracy of the high-level model is validated by comparing our analytical model with the Dualfoil simulation results (under some simplifying assumptions), demonstrating 5% error between simulated and predicted data.