Share to SD card for Android

Most Android applications offer the possibility to share files. However, sometimes it is necessary to store the files on the device storage. The simplest solution to accomplish that would be another app which stores the shared files on the device storage or external SD card. I would like to present my application "Share To SDCard". This application is available in all common app stores or for download at the end of this page.

How it works
Please note that the following desription is intended for nerds only. The application offers an intent-filter for every file type (*/*). If the application receives an intent of type ACTION_SEND or ACTION_SEND_MULTIPLE, the transferred URI is opened using an InputStream. The application then starts the file dialog for creating a new document (ACTION_CREATE_DOCUMENT) which has been available since API Level 19. Therefore, this app also requires at least Android 4.4 (KitKat). The URI from the callback procedure (onActivityResult) is opened using OutputStream and the data is copied from the InputStream to the OutputStream. As a side effect, the application does not require any permissions, as these are provided by the internal file dialog.

How to do: Step 1
Start an application which offers to share files. In the following example I use Screenshot Recorder.

How to do: Step 2
Select a file you want to store on SD-card.

How to do: Step 3
Tap on the «Share» button which have the symbol looking usually like so:

How to do: Step 4
Now you will face a «Complete action using» list. This is a list of installed applications on this device which offers support for the file type of the selected file. You will find «Share To SDCard» in this list. Just tap on «Share To SDCard».

How to do: Step 5
Now you will face the file dialog for creating a new document. In the upper left corner you can choose the destination. Usually there are 3 options. The Downloads-directory, the device internal memory and the external SD-card (if available).

Select a destination folder where you want to store this file and press the «Save» button in the right down corner. Next to the «Save» button you have also the opportunity to change the filename. If the file with this name already exists, the filename gets automatically extended with a bracket number.

If there are more than one file you will face the file dialog for every single file. To cancel the action just press the «Back» button.

Note about Android 4.4.x (Kitkat)
Due to a bug in Android 4.4.x (Kitkat) you will face error message "This file could not be opened" if you try to share a file with the build-in file explorer.

Download:

Change log:

  • Version 1: Initial version
  • Version 2: Added a How To Do
  • Version 3 and 4: Because, Google Play didn't liked my donation button
  • Version 5: Now they like it
  • Version 6: Improvement for file name
Published: 24. Feb 2020
Categories: Tools Android

Comments

  • Raul Mella 10 months ago

    nice app

  • Sunita 10 months ago

    Thank you