I got used with programming in Nokia's QtSDK (C++) and published a few simple apps in the Nokia's Store. I want to move to Android platform now but am quite confused how to do it in a simple and natural way.
I have a nice working (desktop) app which would perfectly fit for tablet devices. It was written in C++. I have difficulties in understanding how to move that code to Android platform and publish the app in Google's Play Store.
The question is: can it be compiled in QtCreator and would fulfill publish requirements or should it be moved to AndroidSDK? I want to avoid Necessitas plugin.
Thanks.
Qt targets Android, so you don't need to abandon Qt at all. Simply download Qt for Android, add it to available Qt versions and Qt kits in Qt Creator, and follow the documentation to tweak your project to run on Android !
Related
I am trying to digest the following information from Flutter site.
How does Flutter run my code on Android?
The engine’s C and C++ code are compiled with Android’s NDK. The Dart
code (both the SDK’s and yours) are ahead-of-time (AOT) compiled into
native, ARM, and x86 libraries. Those libraries are included in a
“runner” Android project, and the whole thing is built into an APK.
When launched, the app loads the Flutter library. Any rendering,
input, or event handling, and so on, is delegated to the compiled
Flutter and app code. This is similar to the way many game engines
work.
Is each Flutter app (more precisely each Android app that is created with Flutter) published with Flutter engine attached?
Yes, it is included in every app. There is no code sharing between apps on Android/iOS. Also each app could have a different version of the engine (depending on when it was compiled)
Note that the with the upcoming Flutter 1.0, the overhead (on Android) is less than 5M, which is not bad. I believe the overhead is similar on iOS.
libflutter.so is 27.1MB on my emulator for each of a full / production app and a hello world app.
I developed an android application with cordova and I want to convert it to iOS as well. Before starting my project I heard that we are able to convert same project with multiple platforms using cordova. But now I don't know how to convert my project to IOS. Can any one suggest good tutorial OR examples to do it.
And also mention what are all prerequisites to convert my android application to IOS using phone gap.
Suggest me some tutorials with examples.
First, you'll need an actual Mac computer. I suggest a MacBook Air, as they are cheaper than an iPhone. Then purchase an Apple developer license (USD 100/year) if you plan to submit this app to the App Store. Finally, you can migrate your Cordova source code to Xcode to compile the iOS version as explained in this guide:
Build Cordova iOS app from Visual Studio for Windows
The artice explains how to create a new app in Xcode and then export your source code from the Windows PC to the Mac. You can safely ignore all references to Visual Studio if you aren't using it, because it's not needed: Just follow the steps from the For your iOS app section.
I have a C++ application that uses Qt 4.8 and OpenCV 2.4.2. It is developped using Visual Studio. I have to migrate this application for Android and iOS.
Which is the plan to follow? I should make the minimal change to the existing code.
Unfortunately, there’s no easy answer to this. The fact that you’re using Qt is a great start, and using it as much as possible will go a long way towards making your code portable from Windows to other OSes.
I would look at upgrading first to Qt 5, as Qt introduced great support for both iOS and Android.
After that, the build chain is going to be your next obstacle. It looks like the Qt Visual Studio Add-in has an option to export a .pri file from the VC++ project, which would be a very handy starting point. Generate the .pri file and compare it to the project file created by QtCreator for an Android and iOS app, and try to copy the mobile-specific parts into your generated .pri file.
Other potential pitfalls are:
Visual C++ is a much more permissive compiler than gcc (Android) or Clang (iOS and Android)
Your app's dependencies must all be cross-platform as well. I’m sure OpenCV is, but it’s something to keep in mind
On iOS, all libraries must be linked statically
Is it possible? I mean, yeah, pyqtdeploy intro page said: "pyqtdeploy is a tool for deploying PyQt applications. It supports deployment to desktop platforms (Linux, Windows and OS/X) and to mobile platforms (iOS, Android and Windows RT)."
I've installed Qt 5.3.0 for Android and all it's prerequisites (SDK, NDK, etc.). Also I made test project with simple button and label in QtCreator for testing deployment. Everything is fine. Next step was trying pyqtdeploy for making Qt project, pretty simple. But when I'm trying to build this project, linker said that there is no QtCore, QtWidget libraries. As I can recognize it, I've no static-linked PyQt libraries and that they must be compiled for arm architecture. Is it right? But then I've realised, that python library itself also must be arm compiled. And can I build this libraries from source in Qt?
Search did nothing. If this is true, why no one (riverbank, python) have no compiled libraries for arm?
Maybe I'm missunderstood something. In this case I got more global question.
How to deploy PyQt5.3 Python 3.4 application to Android with pyqtdeploy and Qt 5.3.0 for Android?
Wait for the next release of pyqtdeploy, which will probably give better instructions or include cross-compiled libraries. The pyqtdeploy project is being actively developed. Yes, you can use it for Android now, but you are on your own for cross-compiling many static libraries.
I found a related answer here: How do cross-platform mobile app development frameworks work?
but I was thinking more about c++ cross-platform SDKs work (e.g. Corona, Marmalade, EdgeLib, etc.). They provide the ability to export binaries for iOS and Android while allowing the developer to use C++ code. My assumption is listed below, but please correct it if I am wrong anywhere:
User writes code in C++.
SDK has an interface layer with C++ functions called in user code requesting mobile OS specific functionality. This interface layer is built from code required to implement that SDK function call in the specific mobile OS(written in Java for Android and Obj-C for iOS).
Part I am most confused about because I don't have much mobile dev experience points: Do iOS and Android both have C++ cross compilers that can compile the general logic code written in C++ in the user's app?
MoSync is an example of a C++ based cross platform mobile toolkit - this one starts by using the open source GCC compiler to compile your app's C++ code into an assembly-like format. A custom tool by MoSync (called the 'PipeTool') then combines this assembly format with their pre-compiled libraries into various target formats, including java bytecode (for Android) or Objective-C source (for iOS). More detail about this process here.
The final compilation on the target platform (Android or iOS) is left to you, using the native IDE (Xcode for iOS and Eclipse IDE with Android SDK for Android). So to create an iOS application you'll still need to be a member of the Apple iOS developer program (US$99 per year) for example, whereas the Eclipse IDE and Android SDK are free.
Your example of Corona SDK is not fully relevant since Corona builds into the native binary format using their custom build servers in the cloud - what goes on there is not fully documented as its a closed source toolkit. You pay a subscription fee per year to Corona to be able to build apps. I'm not sure about the other ones you mentioned (Marmalade, EdgeLib, etc.) but would assume they are similar to MoSync.
Check out codenameone.com - they use Java but eventually compile into C++ for iOS and Java for Android.
The difference is their environment includes all the graphics and they create the controls themselves so you get an actual native application with just one codebase.