[Interest] How to use gradle with Qt/Android apps?

Gianluca gmaxera at gmail.com
Sat Oct 3 20:58:08 CEST 2015


I’m using gradle for Android app… and I’m using Qt as GUI and Qt Creator to code everything.

The process you describe to include an Android library is the old one before the use of gradle. Now the process is different.

Take a look at this library made by me:
https://github.com/GMaxera/QtFacebook

In the readme there is written both methods. So, you can compare the differences and try to found as to use your library into your Qt/Android project.

Ciao,
Gianluca.


Il giorno 03/ott/2015, alle ore 19:54, Nuno Santos <nunosantos at imaginando.pt> ha scritto:

> So, using gradle means that I have to use Android Studio or any other Java IDE to manage the project? Meh… I love Qt Creator so much that I want to be able to do everything from it. 
> 
> I have found this instructions in order to include an android lib source into the ant building process but it doesn’t seem to be working:
> 
> - Unzip the facebook android sdk package
> - Inside the unzipped directory, locate the subdirectory 'facebook' and copy it in another location (in a subdirectory of your Qt project it's fine)
> - Open the copied directory and in a command line window execute the following command to create a custom build.xml ant build file (select the version of android sdk you are using):
> 	android update project --path . --target android-19
> 
> - Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
> - In the Android package source directory add the project.properties file (or edit it) and append the following content (pay attention to android.library.reference.1, if you already added other library references you should ensure that the number is unique and progressive; moreover the path should be the relative path from your project android build directory to the directory with facebook sdk):
> 
> # Project target.
> target=android-19
> ## Reference to the Facebook SDK
> android.library.reference.1=../../facebook
> 
> facebook sdk source dir is inside the project dir. When building everything happens as before. Does anyone know if this process is valid? 
> 
> Thanks,
> 
> Regards,
> 
> Nuno
> 
>> On 03/10/2015, at 16:58, md at rpzdesign.com wrote:
>> 
>> Just open it directly in Android Studio 1.2xx+ -> latest version
>> 
>> Whatever you do, run away from eclipse.
>> 
>> Make sure Qt-Creator is generating Gradle upon build (some dialog check 
>> box somewhere inside Qt Creator related to android)
>> 
>> From inside Android Studio perspective, Qt is just a bunch of SO 
>> libraries. So don't try to "step" into those.
>> 
>> That help?
>> 
>> md
>> 
>> 
>> 
>> On 10/3/2015 9:41 AM, Nuno Santos wrote:
>>> Hi,
>>> 
>>> I have seen the use gradle option on Qt Creator for a long time now but I have never used it.
>>> 
>>> I want to integrate FacebookSDK into a Qt App and it seems that it is easier to do with gradle since they now provide the SDK as a project and not as a jar.
>>> 
>>> I didn’t find official information on how to use gradle.
>>> 
>>> How do I specify a custom build.gradle file for a Qt Android app project?
>>> 
>>> Thanks,
>>> 
>>> Regards,
>>> 
>>> Nuno
>>> _______________________________________________
>>> Interest mailing list
>>> Interest at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/interest
>>> 
>> 
>> -- 
>> No spell checkers were harmed during the creation of this message.
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
> 
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest




More information about the Interest mailing list