Deploying on other platforms as well
-
Hi all,
I used Qt Installer Framework (QIF) to make an installer for my app. It was very complex, and ...ed me until I reached the end point. :)
Anyway, it works well on Windows now.
I have heard this about Qt:Code Less
Create More
Deploy AnywhereIt appears to be correct. But my question is should I return to those Docs once again to make my app work on Android?
Honestly I feared looking at Docs for that. (They are really complicated)
Does it take the same time to make it work on Adnroid as it took to make an installer using QIF?Thanks.
-
@tomy In case of android, QtCreator itself can create an apk which can then be readily installed on android devices.
-
it's not quite as easy as @p3c0 wrote it.
Beforehand you'll have to create your android -kit.
Install SDK,JDK and NDK and link them with QT, create an Manifest etc. It takes a moment to setup, but the docu will help you hereBut
once you have succesfully build/compiled your project, qt automaticaly creates an apk for you, in the Release/Debug directory.
Which you only have to copy to your Android device/ Google-Playstore
-
@J-Hilk Ofcourse. Everything needs some pre-requisites ;)
What I wanted to convey that you dont need extra installer framework for creating android apk's and that it can done from the QtCreator itself.
-
What both of you said was showing the process easy; it made me pleased. Thanks.
But I need a tut or an example to start and get the end. Honestly, I'm aware of none of the things you mentioned. (Just like QIF previously).
OK. how should I start? Is there any tut with a example except for Docs? I like anything around the world except for Docs.
-
Here you go:
http://doc.qt.io/qt-5/androidgs.html
http://doc.qt.io/qtcreator/creator-deploying-android.html
-
Thanks p3c0,
Pardon me, but isn't there any other tut you are aware of rather than Docs?
My Qt Creator is 5.7 and not 5.8. Matters?
-
@tomy Unfortunately no. But a quick google search throws some good results. You can try one of them. If you encounter any errors, feel free to ask here :)
-
Thanks. My Qt Creator is 5.7. Is it good or I need to install 5.8?
-
@tomy Yes Qt version 5.7 will work. Installing newer versions are always better unless there are any regressions.
-
@tomy
5.7 is fine,
But I personaly try to be always on the leatest release version. Usually lots of bug fixes and new features and very few incompatibilities.
-
Here you go:
http://doc.qt.io/qt-5/androidgs.htmlUsing this link I went for installing Android Studio 2.3.2. Then went to Download the NDK and Tools.
for that, first I created a new project (just by following the wizard) -> Tools > Android > SDK Manager > SDK Tools tab.
My page looks this way and there is no LLDB, CMake, and NDK, to check their boxes!
-
@tomy You dont need to do anything in android studio.
After you install Qt, follow rest of the tutorial:
http://doc.qt.io/qt-5/androidgs.html#installing-qt-for-android
-
@tomy In the bottom right corner there is a check button "Show Package Details", click on it...
-
@jsulm
I'd previously checked that box but there wasn't/isn't those items.@p3c03):
@tomy You dont need to do anything in android studio.
After you install Qt, follow rest of the tutorial:
http://doc.qt.io/qt-5/androidgs.html#installing-qt-for-androidLet's us clarify the items:
I'd previously installed Qt 5.7. OK?
Then I installed Android Studio.
Then I downloadedjdk-8u121-windows-x64-demos
and downloaded and installedjdk-8u121-windows-x64
.
Then I went for that link on this path.One question: what files should be located for each "Browse" part of JDK Location, Android SDK Location and Android NDK Location there?
And as well as, when I want to download NDK by the download button there, it again directs me to the previous link I mentioned above.
-
what files should be located for each "Browse" part of JDK Location, Android SDK Location and Android NDK Location there?
the root folders which you get when you extract them
And as well as, when I want to download NDK by the download button there, it again directs me to the previous link I mentioned above.
Download this (if linux host):
https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zipfrom here
https://developer.android.com/ndk/downloads/index.html
-
Thank you.
I did those and also download apache-ant-1.10.1-bin. Then set the folders as this. Please take a look at the warning message right on the bottom of Android SDK Location!then I continued by Creating The Project:
In number 7 (Select kits), I should select a kit for my new project. When click on Manage to select the Android, it again shows the page with the warning message!I tried well to select a folder as root but wasn't that successful!
Two questions:
1- How to solve this massage please?
2- Which kits should I select? Only Android, or I can select all kits?
-
Android studio is not the same thing as the SDK however I don't know where the SDK is located with the Android Studio installer. I usually get the command line tools from the bottom of the download page.
-
Android studio is not the same thing as the SDK however I don't know where the SDK is located with the Android Studio installer.
You mean I downloaded and installed Android Studio uselessly?
I usually get the command line tools from the bottom of the download page.
I think, anyway, we should have a SDK for put its path to the kit page, not?
-
No, I just don't know where the SDK is located when you install Android Studio.
However, Android Studio itself is, indeed, not needed to build Qt applications.
-
@SGaist
If it's probably in the path where Android Studio is installed, OK, I will search for it. But what to search? A file, folder what?!!!
-
Folder, a SDK is always at least a folder since it should provide all tools / libraries / whatnot to do development. You can search for a file named
adb.exe
.
-
Very nifty point. :-)
I found it here
C:\Users\CS\AppData\Local\Android\sdk\platform-tools
so I addC:\Users\CS\AppData\Local\Android\sdk
as the location path. Agree?I did it. But how to select Android kit!? Apparently I should add it!
-
Looks good yes.
Did you install the Qt for Android version ?
-
@SGaist
I have Qt 5.7 Creator + all the files and folders mentioned above installed/downloaded on my Windows 7 x64 machine.
I don't know what that is.I think I should add an Android kit for the project. But how!?
http://doc.qt.io/qtcreator/creator-developing-android.html
-
When using the online installer for example you have the option to install Qt for various Visual Studio, MinGW and Android. if you don't already have a kit then it's likely that you didn't install Qt for Android development.
-
@SGaist
No, I've installed MinGW, because I was coding for windows. should I also install another Qt Creator!!!?
-
No, just Qt for Android. Qt Creator is capable of handling several version of Qt in parallel without any problem.
-
@SGaist
Good news. so how to add that on my Qt Creator please?
-
Start the online installer, then add/remove and check the Android option.
-
@SGaist
Can't I use the maintenance tool?
-
Yes, sure thing, it's that one that I had in mind, sorry.
-
No it's fine. Actually it is me that I should say "sorry" for getting your time.
I went for it, but unfortunately it doesn't include a Qt for android version. :(
-
Did you use the offline installer at first ?
-
@SGaist
No. directly used the maintanence tool.
My offline installer is this qt-opensource-windows-x86-mingw530-5.7.0 (size 1.10 GB).
-
So your original installation comes from an online installer, correct ?
-
@SGaist
No, because of disconnecting the Internet here, I firstly dowloaded that offline installer and used it for installing 5.7
-
There's also an offline installer for the Android build.
-
@SGaist
Do you mean that I should download and install qt-opensource-windows-x86-android-5.7.0.exe? If so, should I install it over Qt Creator folder or what?
-
Do you mean that I should download and install qt-opensource-windows-x86-android-5.7.0.exe?
Yes
If so, should I install it over Qt Creator folder or what?
Better to uninstall the previous one