I just read this question about packaging for Android:
Android - Application (apk) Maximum size
Where it mentions that apk files have a maximum size for the market place:
http://www.google.com/support/androidmarket/developer/bin/answer.py?hl=en&answer=113469
When using the Qt for Android:
http://sourceforge.net/p/necessitas/home/necessitas/
How much space does that take up?
You don't have to include the Qt libraries in your application so the space of the app depends only on the application itself.
The guy behind necessitas has also created ministro which fetches the Qt libraries required by your application.
Ministro is a system wide Qt shared libraries installer/provider
service. It acts as a bridge between your apps and Qt libraries.
Ministro service is release under GPL v3+ license.
Have a look at this [QuickStart video] which demonstrates the process of writing/installing a Qt Application in Android
EDIT
Of course if you want you can select to use deploy local qt libs with your application instead of the device libs. In this case the extra space required depends on the Qt modules you use.
Related
I am new to V-Play. I just wanted to test it with Hello World app. My Single page app's Main.qml is 523 bytes only. But V-Play is building 20+ MB APK. Are Qt libraries that big?
This is the normal behavior; the thing is that the Qt libraries are not that small.
For instance, if you develop a QtQuick application, you have at least QtGui, QtCore, QtQuick dependencies.
If the size it's a problem for you, there is an alternative: use Ministro. Ministro is an Android service that provides Qt libraries, so different apps could share the main libraries.
See Using Ministro to Install Qt Libraries for more information.
Am using Qt to build app on android, Qt Quick mainly its really nice, but my main problem is the start up size is around 27 MB which is huge for initial size.. is there a way to reduce this size ?
If you you don't want to use Ministro Service, you should include only the necessary Qt modules. Omitting the unnecessary modules will reduce the APK size significantly. This is a quote from BogDan Vatra the man who ported Qt to Android :
Qt files can go slightly over 40Mb/platform if you are going to use
all of Qt modules. Of course your application doesnt need all the
modules, so, if your application uses only Qt Quick Controls + Qt SVG
+ Qt Multimedia + Qt Sensors + Qt XML modules, Qt files (libs + plugins + additional files) are ~20Mb/platform and your APK will be
~10Mb.
You can see Choosing the right deploying system
Yes. You are most likely bundling Qt itself with your app. That's the default setting in Qt Creator. Go into your project settings (the Projects button to the left of the UI) and under Android/Run/Make Install, click on the Details button. There you can switch the Qt Deployment from Bundle to use Ministro Service.
This way your apk will be a lot smaller, but you need to install the Ministro Service from Play Store. Ministro contains Qt libraries that other apps can use.
Hope that helps...
What's the best way to choice (select/open) file using Qt in Android ?
I'm tried to use QFileDialog But did not get good result , Is there anyway to use android native open file dialog in Qt ?!
In Qt 5.3, the Qt Quick Controls look good but they don’t (yet) look the same as Android’s Java Controls. This is something that’s planned to be fixed for Qt 5.4.
You can use Ministro to have Native look in your app :
Switch to Projects mode
Select the Run Settings for Android
Open Deploy configurations Details
Select Use Ministro service to install Qt
Now the Qt Widgets will have a native Android look. But there is a big drawback: Your App has now a dependency to the Ministro App. The App will check on startup if Ministro is installed on your device. If it is not installed the user is forced to install it over the Android Play Store.
I want deploy app with Qt 4 or 5 libs (Core & GUI) in apk. Is it real? I use necessitas to create apps. google.com didn't help in this answer.
P.S.: sorry for my English, it's not my native language.
If you mean that you don't want to use Ministro, then it should be possible. The page below gives some directions how to:
http://community.kde.org/Necessitas/QuickStartDevelop
On March 1, 2013, the page above has the following:
Deploy Configurations
Also on the Run view you can set the Deploy Configurations, by selecting Details at the right hand side these are the different options you can choose between.
Use device's qt libs
Deploy local qt libs
Install Ministro system
The Use devices qt libs option depends also on the Use local qt libs option. When Use local qt libs is unchecked your application will need the Ministro package to run. However if Use local qt libs is checked, Qt Creator will pass special parameters to the application, forcing it to use Qt libraries from the /data/local/qt path on the device.
The Deploy local qt libs option makes Qt Creator deploy qt libs found in the Qt SDK chosen (e.g. android-lighthouse-4.8.0). This option is useful when you hack on the Qt framework to test it. This option automatically selects the Use local qt libs option. This option get automatically unchecked after Qt Creator pushes the Qt libs. This option can be checked every time you need to push your local Qt modifications.
Install Ministro system option installs the Ministro package (you must provide the apk yourself; download it from from here). It is useful when you try to test your application on Android Virtual Devices.
If you want to go with Ministro for the libraries, here are directions on how to get it set up:
https://play.google.com/store/apps/details?id=eu.licentia.necessitas.ministro
http://sourceforge.net/p/necessitas/home/necessitas/
What is Ministro ?
Necessitas is also the Home of Ministro, an Android application which provides a system wide downloader and installer of the LGPL Qt shared libraries. You can find Ministro on the Android Market or as direct download here.
EDIT: Some more links:
http://community.kde.org/Necessitas
http://necessitas.kde.org/
http://qt-project.org/wiki/How_to_Create_and_Run_Qt_Application_for_Android
Hope that helps.
I can cross-compile any C/C++ application, statically link it Linux libraries and run it on Android. What was the need of an Android-ndk then? Android-ndk limits us to bionic which has a small subset of gnu libc. Isn't it a better idea to straightaway cross-compile applications and run them through Android shell? Is there any limitation to cross-compiling that I can't see? This URL : Can Linux apps be run in Android? answers my question to some extent but eventually leaves me confused and without clarity.
I think this is enough for Android-NDK
The Android NDK is a companion tool to the Android SDK that lets you build performance-critical portions of your apps in native code. It provides headers and libraries that allow you to build activities, handle user input, use hardware sensors, access application resources, and more, when programming in C or C++. If you write native code, your applications are still packaged into an .apk file and they still run inside of a virtual machine on the device. The fundamental Android application model does not change.
The NDK provides:
A set of tools and build files used to generate native code libraries
from C and C++ sources
A way to embed the corresponding native libraries into an application
package file (.apk) that can be deployed on Android devices
A set of native system headers and libraries that will be supported
in all future versions of the Android platform, starting from Android
1.5. Applications that use native activities must be run on Android 2.3 or later.
This thing you can not find in other cross-compilation with arm toolchain..
As mentioned in the link http://developer.android.com/sdk/ndk/index.html NDK is a companion for App development folk to create performance sensitive native code. NDK exposes some of the native implementation of Android which could not be found in the general Linux environments. Some of them include the Android/Bitmap, Android/nativeWindow etc. Using these Android natives applcation can speed up CPU intensive processes like some compression or decompression of images.
Even though the externally cross-compiled executables may run in the Android there no guarantee that versions of the standard library implementaions are the same. NDK provides a easier and Android compatible toolchain and other resources, using which is much easier to application developers than having to find a compatible cross-compiler for their usecase.