1. An electronic device, comprising: a housing; a lens protection cover, installed on the housing; an image capturing unit; a light-source sensor, detecting external light which comes into the electronic device through the lens protection cover; a processor, determining whether the detected external light is less than a threshold; and a visible light source generator, connected to the processor, generating visible light; wherein when the processor determines the detected external light is less than the threshold, the processor activates the visible light source generator to generate the visible light and activates the image capturing unit to capture a fingerprint image of a user's finger which is put on the lens protection cover for fingerprint recognition.