Send and recive data from android to PC

Iā€™d like to know how to export data from the user activity.
I need to crate a CSV file to contain details about the user activity (button pressed ETC.) and eventually get access to it ( with android studio?) to send it back to the PC (probably on TCP SOCKET).

Thank you for your help :slight_smile: