According to one embodiment, an electronic device includes a first detector, a memory and circuitry. The first detector detects either attachment of the electronic device to a human body or removal of the electronic device from a human body. The memory is configured to store control data. The circuitry executes a process foe transmitting a command for performing a process specified by the control data to at least one external device specified by the control data either when the attachment of the electronic device is detected or when the removal of the electronic device is detected.