I was looking for another problem I'm having, but I have to share what I did on my grand kids tablets. After a metric ton of research, if you have a loose connection when you plug up to charge, find something small and sharp (I used a steak knife). On your device (Not Cable!) use the tip of the knife, slowly and very carefully take the tip of the knife, it goes between the outside of the charge port, work it gently around the outer edges of the charger port. Look inside while you are there and make sure the little tang inside is not bent or damaged.
If your device is completely drain dead, plug it up to your computer first. Let it charge there for about an hour. Then you can move it over to your regular charger.
When the battery drains it lets you know when it's time for more juice,no problem. If it gets totally drain dead, it will only charge if your really lucky. The battery needs just a touch of power to kick itself into recharge mode.
Source of research: BatteryUniversity.com