0

What is the best way to make a file chooser (It should be able to choose any type of file) and file up loader in android?

min target version - 14 and target version 25

Cœur
  • 37,241
  • 25
  • 195
  • 267
Sanal
  • 418
  • 6
  • 17

2 Answers2

1

All is build in in Android already.

Just start an intent with Intent.ACTION_GET_CONTENT to select any file on the device.

On newer systems you also can use ACTION_OPEN_DOCUMENT.

greenapps
  • 11,154
  • 2
  • 16
  • 19
  • Thanks for your reply. I have used Intent.ACTION_GET_CONTENT only but how do we create a file from the Uri.? – Sanal Mar 10 '17 at 05:26
  • You dont. And why would you? Just open an InputStream for the uri. Then you can read the content from it and write to an outputstream on the internet. – greenapps Mar 10 '17 at 06:32
0

Hello for simple file selection you can use android default selection process. FileSelection

and the fastest for file uploading you can use retrofit fastest File uploading

Community
  • 1
  • 1
  • `Hello for simple file selection you can use android default selection process. FileSelection`. That does not select a file but offers a file to the OS. – greenapps Mar 09 '17 at 12:45