Android Question How user can select a file on his phone?

Alex_197

Well-Known Member
Licensed User
Longtime User
Hi all
Happy 2024

I need to add a feature to my app that will allow to the user to select a file and upload it to the server.
How to select a file manually?

Thanks
 

Alex_197

Well-Known Member
Licensed User
Longtime User
I saw it but the file is already on the user's phone, all I need is to let the user to select this file and get the file name and the path to this file so my code will be able to upload it to the server. Upload part is ready all I need is to select this file.

For example - yhe user has a pdf file with his driver license - so I need to ask hom to select this file on his phone.
 
Upvote 0

Alex_197

Well-Known Member
Licensed User
Longtime User
Yes - and this code example shows you how to load external files, just as you asked. Look again.
External - means the file located outside of the phone? Like the Good drive? I don't need to load it. The file is already on the phone. I just need a file name and the path to this file.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
Look at Content Chooser - it works for folders on the phone too. But be aware that with current Android versions not all folders on the phone are accessible.
 
Upvote 0
Top