Integrate Qt-Creator and Android Studio:
step 1. compile using qmake, i.e. build in Qt-Creator
step 2. enter the build directory and add gradle.properties with the following content:
androidCompileSdkVersion=23
androidBuildToolsVersion=24.0.0
qt5AndroidDir=/Users/<uid>/Qt5.6.0/5.6/android_armv7/src/android/
The these properties in gradle.properties will be referennced by main build.gradle like below:
android {
/****************************************************
The following variables:
- androidBuildToolsVersion,
- androidCompileSdkVersion
- qt5AndroidDir - holds the path to qt android files
needed to build any Qt application
on Android.
are defined in gradle.properties file. This file is
updated by QtCreator and androiddeployqt tools.
Changing them manually might break the compilation!
****************************************************/
compileSdkVersion androidCompileSdkVersion.toInteger()
buildToolsVersion androidBuildToolsVersion
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java']
aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl']
res.srcDirs = [qt5AndroidDir + '/res', 'res']
resources.srcDirs = ['src']
renderscript.srcDirs = ['src']
assets.srcDirs = ['assets']
jniLibs.srcDirs = ['libs']
}
}
lintOptions {
abortOnError false
}
}
step 3. copy back to qt project directory after android java/ui is finished