Android Question Any way to share a file with a 3rd party app without WRITE_EXTERNAL_STORAGE permission?

JohnC

Expert
Licensed User
Longtime User
My app shares a file to a third party app (using an intent).

Is there a way to share a file to third party apps without having to declare WRITE_EXTERNAL_STORAGE permission?

I know I can use the new on-demand permission feature to not declare this when the app is being installed, but because my app absolutely needs this to run (and it's not an optional permission), asking for permission later just so the app can run is the same thing as declaring it when installing my app.

So, is there anyway to store a file so it's accessible by a third party app so I wont have to declare WRITE_EXTERNAL_STORAGE or ask for run-time permission after the app is running?
 

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

JohnC

Expert
Licensed User
Longtime User
That's what I was hoping for too and you'll see in that thread I asked Erel about that, but he says 4.3- will still need it and even 4.4+ will need it at runtime.
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Erel, maybe I'm not on the same page.

My understanding is that with "Runtime Permissions", I don't have to declare the permission in the manifest.

But when my app is running and when it first needs to access the storage card, it will then prompt the user and ask for permission to allow my app to access the storage card.

Isn't this correct?
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
Erel, I did.

Are you talking about the "GetSafeDirDefaultExternal"?

From what you mentioned about it, it seems like it's just a folder that my app can *privately* use that can/is located on the external sd card of the users device. And I see this as helpful if my app just needed extra memory instead of using the internal defaultdir's memory.

But like I stated in my OP, I need a storage area that I can *share* a file with a third party app.

Are you saying that files my app creates in the folder of GetSafeDirDefaultExternal can be read by other apps?
 
Upvote 0

JohnC

Expert
Licensed User
Longtime User
OK, I'll give it a shot - If files in GetSafeDirDefaultExternal can be read by other apps, then that would do the trick! :)

I had the impression that GetSafeDirDefaultExternal was just useful to give apps extra storage memory outside of the internal memory, but that it was still sandboxed for security reasons.
 
Upvote 0
Top