diff --git a/.gitmodules b/.gitmodules index d0b4f7f..883d016 100644 --- a/.gitmodules +++ b/.gitmodules @@ -16,3 +16,6 @@ [submodule "HanoiTowers/client/Credits"] path = submodules/Credits url = https://github.com/QuasarApp/Credits +[submodule "submodules/QtAndroidTools"] + path = submodules/QtAndroidTools + url = https://github.com/QuasarApp/QtAndroidTools.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 59e9e03..d91a987 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -97,7 +97,13 @@ if (HANOI_CLIENT) add_subdirectory(submodules/SimpleQmlNotify) add_subdirectory(submodules/ViewSolutions) add_subdirectory(submodules/Credits) + + if (ANDROID) + add_subdirectory(submodules/QtAndroidTools) + endif() + add_subdirectory(HanoiTowers/client) + endif() if (HANOI_SERVER) diff --git a/HanoiTowers/client/CMakeLists.txt b/HanoiTowers/client/CMakeLists.txt index 2145bf5..9490a00 100644 --- a/HanoiTowers/client/CMakeLists.txt +++ b/HanoiTowers/client/CMakeLists.txt @@ -50,6 +50,8 @@ if (ANDROID) QmlNotyfyService) addDeployAPK(${CURRENT_PROJECT} "${CMAKE_CURRENT_LIST_DIR}/android" "digitalface" "${SIGN_PATH}/DigitalFaceMobily.keystore" "${SIGN_STORE_PASSWORD}" "${TARGET_DIR}" "${HANOI_EXTRA_LIBS}") + target_link_libraries(${CURRENT_PROJECT} PRIVATE QtAndroidTools) + else() # Desctop deploying addDeployFromCustomFile("Client" "${CMAKE_SOURCE_DIR}/Deploy/Client.json") diff --git a/HanoiTowers/client/android/AndroidManifest.xml b/HanoiTowers/client/android/AndroidManifest.xml index f1556fc..7dd9b9b 100644 --- a/HanoiTowers/client/android/AndroidManifest.xml +++ b/HanoiTowers/client/android/AndroidManifest.xml @@ -10,6 +10,12 @@ <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="-- %%INSERT_APP_NAME%% --" android:extractNativeLibs="true" android:icon="@drawable/icon"> + + <!-- Sample AdMob app ID: ca-app-pub-5799112356811682~1226170116 --> + <meta-data + android:name="com.google.android.gms.ads.APPLICATION_ID" + android:value="ca-app-pub-5799112356811682~1226170116"/> + <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation|mcc|mnc|density" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="-- %%INSERT_APP_NAME%% --" android:screenOrientation="landscape" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN"/> diff --git a/HanoiTowers/client/android/build.gradle b/HanoiTowers/client/android/build.gradle index b6d056b..2833e51 100644 --- a/HanoiTowers/client/android/build.gradle +++ b/HanoiTowers/client/android/build.gradle @@ -18,6 +18,7 @@ apply plugin: 'com.android.application' dependencies { implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) + implementation 'com.google.android.gms:play-services-ads:20.1.0' } android { @@ -71,6 +72,7 @@ android { defaultConfig { resConfig "en" + multiDexEnabled true minSdkVersion = 22 targetSdkVersion = 30 } diff --git a/HanoiTowers/client/android/gradle.properties b/HanoiTowers/client/android/gradle.properties index fded106..e14afc2 100644 --- a/HanoiTowers/client/android/gradle.properties +++ b/HanoiTowers/client/android/gradle.properties @@ -9,3 +9,7 @@ org.gradle.jvmargs=-Xmx2048m # build with the same inputs. However, over time, the cache size will # grow. Uncomment the following line to enable it. #org.gradle.caching=true + +android.useAndroidX=true + +android.enableJetifier=true diff --git a/submodules/QtAndroidTools b/submodules/QtAndroidTools new file mode 160000 index 0000000..fb3474d --- /dev/null +++ b/submodules/QtAndroidTools @@ -0,0 +1 @@ +Subproject commit fb3474dd183727790294e600c07531c20af22eb6