VMS
VMS

Reputation: 139

Public path of Android Q

I have tried to write the file into "/mnt/sdcard" path its return error. Code on JNI layer(C++) using normal fopen("new.txt","w")

And also tried the same with "/mnt/sdcard/Android/data/" even failed.

Device: Android Q Beta4

fopen("/mnt/sdcard/new.txt","w") fopen("/mnt/sdcard/Android/data/new.txt","w")

We already Refer the storage restriction in Android Developer page for Android Q.

Which path used for store the public information?

Upvotes: 2

Views: 420

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007296

Apps cannot store data in arbitrary locations on external or removable storage in Android Q (by default) or Android R (for all apps). The fact that you happen to be using the NDK does not change this.

Your Java code should pass down a valid filesystem path for your NDK code to use (e.g., getExternalFilesDir() on Context).

Upvotes: 2

Related Questions