Qt Android - Reading a Directory

46
October 16, 2018, at 6:00 PM

I'm working on a Qt Android application and would like to read a directory and list all the files inside it of a certain extension.

I can successfully write to this directory but I'm unable to read from it.

Using the following call to open the directory :

QDir formulationDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation));

Returns the following error:

E File : fail readDirectory() errno=2

Writing however works just fine:

 QString path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
 QFile outFile(path.append("/" + ContentID + ".json"));
 outFile.open(QFile::WriteOnly);
 outFile.write(updatedContent.toJson());
 outFile.flush();
 outFile.close();

I have READ_EXTERNAL_STROAGE and WRITE_EXTERNAL_STORAGE in my manifest permissions and the storage permission checked under the application settings.

Am I missing something here?

READ ALSO
“onWindowFocusChanged()” not excuted when switching fragments

“onWindowFocusChanged()” not excuted when switching fragments

I have an activity, with multiple master-detail fragments in the activityFragment 1 is opened with a button click in Activity, and Fragment 2 is open with a button click in Fragment 1

44
Unable to establish second Raspberry Pi [WIFI Direct] to a device

Unable to establish second Raspberry Pi [WIFI Direct] to a device

I have 2 Raspberry Pi and an Android Tablet and the Tablet is supposed to be controlling the Raspberry Pi via the webserver from the PiThe Android Tablet has a Wifi Direct application and I was able to establish connection with one of the Pi

16
Sending E-Mail with multiple attachments: “SecurityException when openFileDescriptor” (GMail)

Sending E-Mail with multiple attachments: “SecurityException when openFileDescriptor” (GMail)

To send multiple attachments I use this code to create the mail intent:

50
Flutter equivalents to `View::onAttachedToWindow` and `View::onDetachedFromWindow`

Flutter equivalents to `View::onAttachedToWindow` and `View::onDetachedFromWindow`

What are Flutter equivalents to Android's View::onAttachedToWindow and View::onDetachedFromWindow?

43