Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dual apps can't access storage path /storage/emulated/999/Download/somefile.pdf

I am trying to download a file from server to Download folder of andorid

As expected it is working fine

Problem

When user clones my app (dual app) , the cloned app (2nd app) throws SecurityException: Unsupported path /storage/emulated/999/Download/somefile.pdf

Research

Device : Redmi 5

App : File Manager (system app)

I found 2 options

  1. Internal Storage
  2. Storage for dual apps (it also has Download folder & other apps folder like Whatsapp)

Still my app throws SecurityException

like image 803
karthik kolanji Avatar asked Apr 29 '19 11:04

karthik kolanji


People also ask

How do I open a 999 folder in Realme?

Save this answer. Show activity on this post. Open File Manager → Choose Phone Storage → defaults folders will be visible, select Search icon/text area and type 999 and click enter, you will be redirected to 999 folder with following pre-defined folders: Android.

Where is my storage emulated 0 download?

The "/storage/emulated/" folder does not really exist. It's what might be called a "symbolic link", or, in simpler terms, a reference to where the real data is stored. You'll need to find the actual physical location on your device where it is stored. Since it's in /storage/emulated/0/DCIM/.

Where is emulated folder in Mi phone?

Go to the homepage. Select "Internal Storage". At the top of the screen, you will see that the path you are in is the storage/emulated/0 folder.


1 Answers

This is because android dual apps creates the new app instance separate from the normal file storage (kind of like a secure space) in this same way your original app won't be able to access the files of the cloned app. So in theory to make you. downloads function work again you need to find out where the new app instance has been cloned to (varies from device manufacturer) and then set that has the download location. Hope I Helped!

like image 115
Amitoj Singh Avatar answered Oct 10 '22 08:10

Amitoj Singh