The relay is simply a switch which is turned on or of by an electrical magnet when you apply current on the coil it operates the relay
but the problem is that the relay coil needs power to work , a good idea is to take the DC of the charger
"as the mobile will be always be connected to the charger "