Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the most convenient way to export data from an Android application to a desktop PC

I'm wondering whether there is a best practice (or a prefered way) to export data generated in an Android application to a desktop PC!?

The scenario is the following: my Android application collects sensor data, which I want to export (e.g., as a CSV file) for later analysis on a desktop PC (let's assume it's running Windows). Once the data is exported, I don't care about it anymore; In particular I do not want to import it again. The only constraint is that a normal PC user (without indepth knowledge about Android's file system, cloud storage, etc.) should be able to perform this task.

It seems to me that this is a common task, and I'm looking for a simple way (from a user perspective) to achieve it. If possible, the solution should not require to implement my own cloud service or desktop client. Please note that I'm not asking for technical details, but for a general method to solve my problem.

A few straight-forward solutions come to my mind, but I'm not sure about the pros and cons.

  • Putting the file on the SD disk and let the user copy it.
  • Uploading thedata to a cloud storage such as Google drive.
  • Sending the data via email (although this might be a bad idea due to a potential huge file size).

An ideal way seems to be something as described here: How do I export text from iOS application to desktop PC? Unfortunately, it's Apple ...

like image 662
Dan Avatar asked Oct 27 '25 08:10

Dan


1 Answers

You already gave good suggestions. I would be inclined to have a "Share with" button as other apps already have, and have several choices depending on the installed apps on the device. In particular have one of the choices to save the file to the sdcard, so that the user can copy it to the PC with a USB cable, and other choices to send by mail, share with Dropbox (if available) etc.

enter image description here

The above can be accomplished by using an intent with action ACTION_SEND, and Android will take care of displaying the available options. For the "copy to sdcard" choice, maybe you can write an activity that is part of your application that also listens for the ACTION_SEND action, and if selected just copies the files to the sdcard.

like image 54
German Avatar answered Oct 28 '25 21:10

German