An electronic device, comprising: a communication module; a touch screen display; a processor electrically connected with the communication module and the touch screen display; and a memory electrically connected with the processor, wherein the memory is configured to store an application program configured to transmit and receive data to/from an external electronic device using the communication module, and instructions that, when executed by the processor, cause the processor to: display a user interface in an expanded state that includes a first area at least partially overlapping with a second area, wherein the first area is configured to display at least one of an image and text that is associated with a user of the external electronic device, and wherein the second area is configured to display data that is shared with the external electronic device, receive an input through at least a portion of the first area and the second area, display an effect corresponding to the received input, transmit (5013, 5019) data to the external electronic device based on at least a portion of the received input, and switch between the user interface in the expanded state and a user interface in the form of a floating circle based on a user input, wherein the floating circle is provided based on the first area and is configured to freely move to any area of the user interface, and wherein an application executed as a background application is selected as a foreground application when switching to the user interface in the form of a floating circle. a communication module; a touch screen display; a processor electrically connected with the communication module and the touch screen display; and a memory electrically connected with the processor, wherein the memory is configured to store an application program configured to transmit and receive data to/from an external electronic device using the communication module, and instructions that, when executed by the processor, cause the processor to: display a user interface in an expanded state that includes a first area at least partially overlapping with a second area, wherein the first area is configured to display at least one of an image and text that is associated with a user of the external electronic device, and wherein the second area is configured to display data that is shared with the external electronic device, receive an input through at least a portion of the first area and the second area, display an effect corresponding to the received input, transmit (5013, 5019) data to the external electronic device based on at least a portion of the received input, and switch between the user interface in the expanded state and a user interface in the form of a floating circle based on a user input, display a user interface in an expanded state that includes a first area at least partially overlapping with a second area, wherein the first area is configured to display at least one of an image and text that is associated with a user of the external electronic device, and wherein the second area is configured to display data that is shared with the external electronic device, receive an input through at least a portion of the first area and the second area, display an effect corresponding to the received input, transmit (5013, 5019) data to the external electronic device based on at least a portion of the received input, and switch between the user interface in the expanded state and a user interface in the form of a floating circle based on a user input, wherein the floating circle is provided based on the first area and is configured to freely move to any area of the user interface, and wherein an application executed as a background application is selected as a foreground application when switching to the user interface in the form of a floating circle.