2

I am using a QtApp on android. My QtApp has a AndroidManifest.xml as well where I can declare android permissions that my app needs.

My app is well able to save anything into the private directory of the app which is /data/user/0/com.something.something.myapp/files/.

Now, I want to be able to create & save files into /sdcard/Download/ folder of my android device. But I am unable to save it anything into the /sdcard/Download/ !!

I have the following permissions declared in Manifest as well.

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />

What am I missing here? I do the following call get application directory on android

QString app_private_location = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);

Question: Is there some Qt API to get the /sdcard path in android?
Or do I have to rely on android native code for this? I tried passing /sdcard/Download/ manually but does not help.

TheWaterProgrammer
  • 7,055
  • 12
  • 70
  • 159

1 Answers1

1

You have to get the path by using JNI in the Qt Android Extras module. You can find an example of what you want in this post:

How to get the android <shared-storage> path from Qt?

mohabouje
  • 3,867
  • 2
  • 14
  • 28