Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 3 Support (Qt 5) › How to write files on an Android device?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #22152

    Abe

    I tried to use fileUtils for an Android app, but the write operation doesn’t work:

     

    W MyApp : [WARNING] File open for “/storage/emulated/0/Documents/note-1568593407.txt” did not work.

     

    I think this happens, because of the requirement, that the user has to grant access to file storage. Setting the permission in the manifest file is not sufficient any more. Does Felgo  offers a solution or do I have to implement some JNI stuff?

    #22159

    Alex
    Felgo Team

    Hi,

    your chosen location might indeed require an extra permission. There is no QML API available for this yet, you can use the C++ API (https://doc.qt.io/qt-5/qtandroid.html#requestPermissions) or use JNI. You can use JNI just like with normal Qt.

    Alternatively you can also choose another non-external storage location (e.g. FileUtils.AppDataLocation) that does not require an additional permission.

    Note that if you want to use QML live reloading together with C++ or native code, you can build your own Live Client: https://felgo.com/updates/release-2-16-1-live-code-reloading-with-custom-c-and-native-code-for-qt#how-to-build-your-own-live-client-with-custom-cpp-and-native-code

    Cheers,
    Alex

    #22198

    Abe

    Thanks for the suggested solution. For demonstration purpose, I’ll try the local storage and add the request for permission in my Qt class for opening and storing files.

Viewing 3 posts - 1 through 3 (of 3 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded