1. An electronic device comprising: a housing; a controller positioned inside the housing; a wireless radio frequency (RF) circuit positioned inside the housing and electrically coupled to the controller; a display exposed through the housing and electrically coupled to the controller, wherein the display comprises a touchscreen; an audio process circuit positioned inside the housing and electrically coupled to the controller; a sensor electrically coupled to the controller; and a storage device which stores an operating system and an application, wherein the storage device stores instructions that, when executed, cause the controller to detect, using the sensor, a first tapping pattern provided by a user on the electronic device in a setting mode, store the first tapping pattern in the storage device in association with the application, receive, using the sensor, a second tapping pattern provided by a user on the electronic device while the display is in a screen-off state, determine whether the second tapping pattern corresponds to the first tapping pattern, and directly perform a function of the application from the screen-off state which is matched to the first tapping pattern, upon a determination that the second tapping pattern received during the screen-off state of the display corresponds to the first tapping pattern.