You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 4, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+14-1Lines changed: 14 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,16 @@ Utils for easy c++ and qml integration of common android features
9
9
- Show a toast
10
10
- Trigger haptic feedback
11
11
- Change the statusbar color
12
+
- Adds the `ContentDevice` class (android only)
13
+
- QIODevice class for android contents
14
+
- Allows you to open genric `content` uris
15
+
- This includes local files, as well as data from services like Dropbox, Google Drive, etc.
16
+
- Adds the `FileChooser` class
17
+
- The Android equivalent of a file dialog
18
+
- Shows an android file chooser activity to get/create a content uri
19
+
- Provides `FileDialog` qml type that provides a file dialog for all platforms
20
+
- On Android, uses the FileChooser
21
+
- On other Platforms, the [Qt labs FileDialog](https://doc.qt.io/qt-5/qml-qt-labs-platform-filedialog.html) is used
12
22
13
23
## Installation
14
24
The package is providet as qpm package, [`de.skycoder42.androidutils`](https://www.qpm.io/packages/de.skycoder42.androidutils/index.html). To install:
@@ -37,4 +47,7 @@ include(vendor/vendor.pri)
37
47
In that case, make shure you initialize androidnative.pri by adding `AndroidNative::SystemDispatcher::registerNatives();` to your `JNI_onLoad` implementation!
38
48
39
49
### QPM_ROOT
40
-
This variable should contain the root directory of qpm, i.e. the `vendor` directory. By default (if you don't set the variable), it is set to `$$_PRO_FILE_PWD_/vendor`. If your qpm vendor folder is not located in the same directory as your pro file, set this variable to the **absolute** path of your vendor folder. If you use the `_PRO_FILE_PWD_`, you can simply make the path relative to this directory, e.g. `QPM_ROOT = $$_PRO_FILE_PWD_/../vendor`.
50
+
This variable should contain the root directory of qpm, i.e. the `vendor` directory. By default (if you don't set the variable), it is set to `$$_PRO_FILE_PWD_/vendor`. If your qpm vendor folder is not located in the same directory as your pro file, set this variable to the **absolute** path of your vendor folder. If you use the `_PRO_FILE_PWD_`, you can simply make the path relative to this directory, e.g. `QPM_ROOT = $$_PRO_FILE_PWD_/../vendor`.
51
+
52
+
## Android URI permissions
53
+
To open generic content uris, you need to get permissions for those. For local files, this are the normal read/write external storage permissions. For other content, i.e. from Dropbox, those permissions are granted for every uri. Those permissions will stay as long as your application is running, but if you want to access them later, e.g. after a restart, you need to persist the permissions. The FileChooser can do this for you, by setting the required `chooserFlags`. If you get Security exceptions when trying to read/write a file, this is what you need to adjust.
0 commit comments