Discussion:
[Interest] How to use gradle with Qt/Android apps?
Nuno Santos
2015-10-03 15:41:14 UTC
Permalink
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
m***@rpzdesign.com
2015-10-03 15:58:04 UTC
Permalink
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
Nuno Santos
2015-10-03 18:54:09 UTC
Permalink
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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
Gianluca
2015-10-03 18:58:08 UTC
Permalink
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.
Post by Nuno Santos
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
Nuno Santos
2015-10-03 19:51:44 UTC
Permalink
Gianluca,

The instructions I have pasted are precisely from QFacebook.

That why I was trying to use gradle.

--
Nuno Santos
Post by Gianluca
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.
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.
Post by Nuno Santos
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
m***@rpzdesign.com
2015-10-03 19:10:11 UTC
Permalink
Nuno:

I would not say that you have to use something.

It's just that your life will be easier if you jump into Android Studio
1.2x+ for your java work and back to Qt Creator for your C++ stuff.

I think they work quite nicely together.

Why re-invent that Java support wheel?

If it has already been done, then go for it. But what is the gain in
solving something that Android studio already does?

md
Post by Nuno Santos
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
Nuno Santos
2015-10-03 19:54:11 UTC
Permalink
You are right, I will try!

One question:

After choosing gradle instead of ant, how do I open the project on Android Studio? I'm still confused.

Thanks,

--
Nuno Santos
Post by m***@rpzdesign.com
I would not say that you have to use something.
It's just that your life will be easier if you jump into Android Studio 1.2x+ for your java work and back to Qt Creator for your C++ stuff.
I think they work quite nicely together.
Why re-invent that Java support wheel?
If it has already been done, then go for it. But what is the gain in solving something that Android studio already does?
md
Post by Nuno Santos
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
m***@rpzdesign.com
2015-10-03 20:00:24 UTC
Permalink
Look at Android Episode 4, 5 or 6 at the KDAB site.

Bogdan Vatra made it.

md
Post by Nuno Santos
You are right, I will try!
After choosing gradle instead of ant, how do I open the project on Android Studio? I'm still confused.
Thanks,
--
Nuno Santos
Post by m***@rpzdesign.com
I would not say that you have to use something.
It's just that your life will be easier if you jump into Android Studio 1.2x+ for your java work and back to Qt Creator for your C++ stuff.
I think they work quite nicely together.
Why re-invent that Java support wheel?
If it has already been done, then go for it. But what is the gain in solving something that Android studio already does?
md
Post by Nuno Santos
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
--
No spell checkers were harmed during the creation of this message.
Nuno Santos
2015-10-03 20:05:44 UTC
Permalink
I will! Thx

--
Nuno Santos
Post by m***@rpzdesign.com
Look at Android Episode 4, 5 or 6 at the KDAB site.
Bogdan Vatra made it.
md
Post by Nuno Santos
You are right, I will try!
After choosing gradle instead of ant, how do I open the project on Android Studio? I'm still confused.
Thanks,
--
Nuno Santos
Post by m***@rpzdesign.com
I would not say that you have to use something.
It's just that your life will be easier if you jump into Android Studio 1.2x+ for your java work and back to Qt Creator for your C++ stuff.
I think they work quite nicely together.
Why re-invent that Java support wheel?
If it has already been done, then go for it. But what is the gain in solving something that Android studio already does?
md
Post by Nuno Santos
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
--
No spell checkers were harmed during the creation of this message.
Nuno Santos
2015-10-04 19:48:22 UTC
Permalink
Thanks to your tip I have managed to use grade. Episode 6 was crucial.

Regards,

Nuno
Post by m***@rpzdesign.com
Look at Android Episode 4, 5 or 6 at the KDAB site.
Bogdan Vatra made it.
md
Post by Nuno Santos
You are right, I will try!
After choosing gradle instead of ant, how do I open the project on Android Studio? I'm still confused.
Thanks,
--
Nuno Santos
Post by m***@rpzdesign.com
I would not say that you have to use something.
It's just that your life will be easier if you jump into Android Studio 1.2x+ for your java work and back to Qt Creator for your C++ stuff.
I think they work quite nicely together.
Why re-invent that Java support wheel?
If it has already been done, then go for it. But what is the gain in solving something that Android studio already does?
md
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.
- 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)
android update project --path . --target android-19
- Add to the Qt project a custom Android package source directory: ANDROID_PACKAGE_SOURCE_DIR = $$PWD/Android
# 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
Post by m***@rpzdesign.com
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
Post by Nuno Santos
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
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
_______________________________________________
Interest mailing list
http://lists.qt-project.org/mailman/listinfo/interest
--
No spell checkers were harmed during the creation of this message.
--
No spell checkers were harmed during the creation of this message.
Loading...