Skip to content

Commit

Permalink
Adapted code to the latest changes of Qt 6.6
Browse files Browse the repository at this point in the history
  • Loading branch information
FalsinSoft committed Dec 7, 2023
1 parent 2426264 commit 5d88010
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 32 deletions.
6 changes: 3 additions & 3 deletions Documentation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -554,12 +554,12 @@ <h3>Sharing</h3>
&lt;category android:name=&quot;android.intent.category.OPENABLE&quot;/&gt;
&lt;data android:mimeType=&quot;image/*&quot;/&gt;
&lt;/intent-filter&gt;</pre>
<p>Regarding the file sharing provider the code is the following:</p>
<p>Regarding the file sharing provider make sure the following tag is present:</p>
<pre class="prettyprint">&lt;provider android:name=&quot;androidx.core.content.FileProvider&quot;
android:authorities=&quot;${applicationId}.qtandroidtoolsfileprovider&quot;
android:authorities=&quot;${applicationId}.qtprovider&quot;
android:grantUriPermissions=&quot;true&quot;
android:exported=&quot;false&quot;&gt;
&lt;meta-data android:name=&quot;android.support.FILE_PROVIDER_PATHS&quot; android:resource=&quot;@xml/sharedfilepaths&quot;/&gt;
&lt;meta-data android:name=&quot;android.support.FILE_PROVIDER_PATHS&quot; android:resource=&quot;@xml/qtprovider_paths&quot;/&gt;
&lt;/provider&gt;</pre>
<p>You can name the <i>resource</i> as you prefer but don't change the <i>authorities</i> name cause the tool refer to this label (qtandroidtoolsfileprovider) for configure the correct resource.</p>
<p>For share simple data from your app to other apps the following function are available:</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public boolean shareBinaryData(String mimeType, String dataFilePath)
try
{
fileUri = FileProvider.getUriForFile(mActivityInstance,
packageName + ".qtandroidtoolsfileprovider",
packageName + ".qtprovider",
new File(dataFilePath)
);
}
Expand Down Expand Up @@ -174,7 +174,7 @@ public boolean shareFile(boolean fileAvailable, String mimeType, String filePath
try
{
fileUri = FileProvider.getUriForFile(mActivityInstance,
packageName + ".qtandroidtoolsfileprovider",
packageName + ".qtprovider",
new File(filePath)
);
}
Expand Down
28 changes: 15 additions & 13 deletions QtAndroidToolsDemo/android/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,17 @@


<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:smallScreens="true"/>
<application android:name="org.qtproject.qt.android.bindings.QtApplication" android:hardwareAccelerated="true" android:label="QtAndroidToolsDemo" android:requestLegacyExternalStorage="true" android:allowNativeHeapPointerTagging="false" android:allowBackup="true" android:fullBackupOnly="false" android:icon="@drawable/icon">
<activity android:name="org.qtproject.qt.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:label="-- %%INSERT_APP_NAME%% --" android:launchMode="singleTop" android:screenOrientation="portrait" android:exported="true" android:theme="@style/splashScreenTheme">
<application android:name="org.qtproject.qt.android.bindings.QtApplication" android:hardwareAccelerated="true" android:label="QtAndroidToolsDemo" android:requestLegacyExternalStorage="true" android:allowBackup="true" android:fullBackupOnly="false" android:icon="@drawable/icon">
<activity android:name="org.qtproject.qt.android.bindings.QtActivity" android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:label="QtAndroidToolsDemo" android:launchMode="singleTop" android:screenOrientation="sensorPortrait" android:exported="true" android:theme="@style/splashScreenTheme">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/>
<meta-data android:name="android.app.extract_android_style" android:value="minimal"/>
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splashscreen"/>
<meta-data android:name="android.app.splash_screen_sticky" android:value="true"/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
Expand All @@ -25,26 +34,19 @@
<category android:name="android.intent.category.OPENABLE"/>
<data android:mimeType="image/*"/>
</intent-filter>
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
<meta-data android:name="android.app.arguments" android:value="-- %%INSERT_APP_ARGUMENTS%% --"/>
<meta-data android:name="android.app.extract_android_style" android:value="minimal"/>
<meta-data android:name="android.app.splash_screen_drawable" android:resource="@drawable/splashscreen"/>
<meta-data android:name="android.app.splash_screen_sticky" android:value="true"/>
</activity>
<!-- For adding service(s) please check: https://wiki.qt.io/AndroidServices -->
<service android:name="com.google.android.vending.expansion.downloader.impl.DownloaderService">
<meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/>
</service>
<receiver android:name="com.google.android.vending.expansion.downloader.impl.DownloaderService$AlarmReceiver" android:enabled="true"/>
<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.qtandroidtoolsfileprovider" android:grantUriPermissions="true" android:exported="false">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/sharedfilepaths"/>

<provider android:name="androidx.core.content.FileProvider" android:authorities="${applicationId}.qtprovider" android:exported="false" android:grantUriPermissions="true">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/qtprovider_paths"/>
</provider>

<meta-data android:name="com.google.android.gms.ads.APPLICATION_ID" android:value="ca-app-pub-3940256099942544~3347511713"/>
<meta-data android:name="com.google.android.gms.ads.AD_MANAGER_APP" android:value="true"/>
</application>

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="com.android.vending.CHECK_LICENSE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand Down
19 changes: 10 additions & 9 deletions QtAndroidToolsDemo/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@ apply plugin: 'com.android.application'
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar'])
implementation 'com.google.android.gms:play-services-ads:21.+'
implementation 'com.google.android.gms:play-services-auth:18.+'
implementation 'com.google.android.gms:play-services-auth:20.+'
implementation 'com.google.android.ump:user-messaging-platform:2.1.0'
implementation 'androidx.annotation:annotation:1.7.0'
implementation 'androidx.core:core:1.10.1'
implementation 'com.google.guava:guava:24.1-jre'
implementation 'com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
implementation 'com.google.http-client:google-http-client-gson:1.26.0'
implementation('com.google.api-client:google-api-client-android:1.26.0') {
exclude group: 'org.apache.httpcomponents'
exclude module: 'guava-jdk5'
}
implementation ('com.google.apis:google-api-services-drive:v3-rev173-1.25.0') {
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
exclude group: 'org.apache.httpcomponents'
exclude module: 'guava-jdk5'
}
implementation 'com.google.android.ump:user-messaging-platform:1.0.0'
implementation 'androidx.annotation:annotation:1.1.0'
implementation 'com.google.guava:guava:28.2-android'
implementation 'androidx.activity:activity:1.5.1'
implementation 'androidx.fragment:fragment:1.5.5'
implementation 'androidx.appcompat:appcompat:1.4.2'
}

android {
Expand All @@ -49,7 +50,7 @@ android {
* Changing them manually might break the compilation!
*******************************************************/

compileSdkVersion androidCompileSdkVersion.toInteger()
compileSdkVersion androidCompileSdkVersion
buildToolsVersion androidBuildToolsVersion
ndkVersion androidNdkVersion

Expand Down
4 changes: 2 additions & 2 deletions QtAndroidToolsDemo/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.jvmargs=-Xmx2048m
org.gradle.jvmargs=-Xmx2500m -XX:MaxMetaspaceSize=768m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.parallel=true
android.useAndroidX=true
android.enableJetifier=true
4 changes: 4 additions & 0 deletions QtAndroidToolsDemo/android/res/xml/qtprovider_paths.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<paths xmlns:android="http://schemas.android.com/apk/res/android">
<files-path name="files_path" path="/"/>
</paths>
3 changes: 0 additions & 3 deletions QtAndroidToolsDemo/android/res/xml/sharedfilepaths.xml

This file was deleted.

0 comments on commit 5d88010

Please sign in to comment.