If you missed the earlier solutions discussed, you should check here; Solutions: Battery Not Charging Issue of Android Devices.
Here, I would discuss another discovery I found for the battery issues most android devices develop. I discover this while working on an HTC One X in my workshop. The HTC One X was brought for the same battery issue.
When the HTC One X was brought, it charges but it does not retain current. You could charge the phone for 24hrs and in the end, it might still end up having just 20% left.
So, based on the recent experience I have had on phones having similar problems, I proceeded to repair the phone.
I noticed that everything on the phone were still stock. By this I mean, the phone had not been tampered with before and there was no sign that any engineer had worked on the phone. For this reason, I proceeded with caution.
How I Resolved the Battery Issue
Since the HTC One X was still stock, I could not have been able to do much on it until I unlocked its bootloader and flashed a custom recovery on it.How to Unlock HTC Bootloader
How to Flash Custom Recovery On HTC Androids
So,
1- I unlocked the phone's bootloader.So, at this point, I checked to see progress on the phone so far.
2- Flashed a custom recovery, TWRP Custom Recovery to be precise.
Guess What! I charged the phone for about 20mins and the battery metre recorded 17% charged!
I put off the phone and charged it again for 30mins. I put on the phone and noticed 27% charged on the battery metre. The phone works fine till now, at least; no battery problem again.
Conclusion
Most recent custom recoveries like TWRP, CWM and 4EXT have better battery managment especially; 4EXT recovery.