Похожие чаты

How can I get file path/uri in kotlin? Android studio

7 ответов

31 просмотр

At the first step, it depends on the android version of the system which the app is running in. As far as I know , from the api level 28 , a subject is introduced that is "Scoped storage". Since then , the way of accessing the external storage changed. There are several documents in google written about this. My personal opinion is to read them to get the whole information about it

Gallant- Автор вопроса
-
At the first step, it depends on the android versi...

I've checked many of dem isn't working for me I'm tryna upload the file to php with retrofit multipart but I'm not sure I'm getting the part correctly

Gallant
I've checked many of dem isn't working for me I'm ...

What do you wanna do?? You want the user to pick for example a picture so that you get the uri. You want to the the uri of some files in a special directory?? .....

Gallant- Автор вопроса
Gallant
Yes I want to get the uri

There are several alternatives for that. One of them is to use ACTION_OPEN_DOCUMENT_TREE that opens sth like a file explorer for the user then you switch to the directory you want. Then the user should press the button and agree. Then , you are able to get the uri of all the contents of that directory. Another alternative is to open the gallery and pick an image so that you have the uri of that image. (You can find the solution here) If you wanna pick another media (audio , video , download , etc ) , you can find its solution in stackoverflow and all of them are using Intent class. Another alternative is to load all the images by from the gallery by using the MediaStore class so that you have the uri of any of them. (You can do this not only with images also with music , downloads , videos). If your app is sth like a file explorer that should access the whole external storage and you wanna get the uri of each file you want , I saw the solution in the google documents but I have forgotten it.

Gallant- Автор вопроса

Похожие вопросы

Обсуждают сегодня

Господа, а что сейчас вообще с рынком труда на делфи происходит? Какова ситуация?
Rꙮman Yankꙮvsky
29
А вообще, что может смущать в самой Julia - бы сказал, что нет единого стандартного подхода по многим моментам, поэтому многое выглядит как "хаки" и произвол. Короче говоря, с...
Viktor G.
2
@Benzenoid can you tell me the easiest, and safest way to bu.y HEX now?
Živa Žena
20
This is a question from my wife who make a fortune with memes 😂😂 About the Migration and Tokens: 1. How will the old tokens be migrated to the new $LGCYX network? What is th...
🍿 °anton°
2
30500 за редактор? )
Владимир
47
а через ESC-код ?
Alexey Kulakov
29
What is the Dex situation? Agora team started with the Pnetwork for their dex which helped them both with integration. It’s completed but as you can see from the Pnetwork ann...
Ben
1
Гайс, вопрос для разносторонее развитых: читаю стрим с юарта, нада выделять с него фреймы с определенной структурой, если ли чо готовое, или долбаться с ринг буффером? нада у...
Vitaly
9
Anyone knows where there are some instructions or discort about failed bridge transactions ?
Jochem
21
@lozuk how do I get my phex copies of my ehex from a atomic wallet, to move to my rabby?
Justfrontin 👀
11
Карта сайта