Android Question help needed: file.makedir

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
hi

i'm trying to create a directory on external storage
got the permission
on older versions of andriud it works
on version 13 it does not and no error is generated - it just ignores it...
targetSDK = 31

this is the code i use

B4X:
    File.MakeDir(File.DirRootExternal,"/DirName")

thanks
 

jahswant

Well-Known Member
Licensed User
Longtime User

This is the new way of managing files from your application.
 
Last edited:
Upvote 1

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User

This is the new way of managing files fron your application.
thanks for this but this is not what i need
i need EXTERNAL folder as it must be shared with another app that will access it
i see so many other apps that creates folders in external for their use
so my question is how do they do it? how can i do it too?
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
I believe it is no longer possible to create an external directory without user intervention.

see :
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Also pay good attention to all informations listed her

 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Also pay good attention to all informations listed her

thanks for that detailed reply
i read them all
but
i see so many apps in google play store that are not file managers etc that do the very same - they create a folder in external storage
music apps, all kind of photo / graphics apps etc
so how can they do it?

i can use a radical solution - using my web service to store and retrieve those files so i don't use phone's storage but i think this is totally crazy

one last issue that can help:
if i run my second app as intent, is there a way in 2nd app to know how was it run? - directly by the user or by by app?
i don't want any user activating the 2nd app - only from 1st app

thanks
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
they create a folder in external storage
music apps, all kind of photo / graphics apps etc
they are probably OLD apps and do not target sdk 31.

You´ll not be able to do that with new apps on Playstore.

so how can they do it?
Forget about this idea. It will not work anylonger.

All possible solutions are listed here already.

You should implement a system to talk to the other application with INTENT.

Or do save all data in the cloud (your server) and all Clients/Apps communicate with the server.
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
they are probably OLD apps and do not target sdk 31.

You´ll not be able to do that with new apps on Playstore.


Forget about this idea. It will not work anylonger.

All possible solutions are listed here already.

You should implement a system to talk to the other application with INTENT.

Or do save all data in the cloud (your server) and all Clients/Apps communicate with the server.
yes, looks like this is the path i will take - use my server...
now, the question that will lead the solution is - can i tell in app #2 the one that #1 loads as intent (1 calls 2)
how was it loaded?
either as intent by #1 or the user launched it
is there a way to know?
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
You can easily share files from an internal folder to another app. This works without restrictions (so no worries about new Android versions). See my example: Share from internal
Wow, are you saying that if I have 2 apps, I can access files in dirinternal of one of them from the second app as well?
If I got this right you solved my problem...
 
Upvote 0

KMatle

Expert
Licensed User
Longtime User
Wow, are you saying that if I have 2 apps, I can access files in dirinternal of one of them from the second app as well?
If I got this right you solved my problem...

No. The user can share e.g. a file manually to another app.

What exactly do you want to achieve? (what do these apps do?) Are both apps from you or do you want to use another app to do some stuff?
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
simple:
i have 2 apps - A and B where A is the main one and the user uses only A
in some cases A needs to run B
for B to run it needs a file shared with it by A
that's why the folder in external is required
b then when ends will leave some data in another file in that folder for A to read and continue

i understand this is going to be banned or already banned by google (i see so many other apps that created folders in external and i can't see why they can and i can't)
 
Upvote 0

asales

Expert
Licensed User
Longtime User
i understand this is going to be banned or already banned by google (i see so many other apps that created folders in external and i can't see why they can and i can't)
"I think" you need a special permission from Google.
See this:
and this:
 
Upvote 0

Zeev Goldstein

Well-Known Member
Licensed User
Longtime User
"I think" you need a special permission from Google.
See this:
and this:
Yes, unfortunately Google is going to be Apple like by closing more and more the os.
I've found alternative solutions so this is no more a critical issue for me...
 
Upvote 0
Top