Qt for Android

By Jozef Mlích - Last updated: Friday, November 16, 2012 - Save & Share - 11 Comments

The Necessitas Project deals with porting Qt to Android devices. Achieving this goal is very close. In this article we will describe various aspects of development for Android in Qt.

To understand how Qt works on Android, it is necessary to know some basic principles of Android. The first prerequisite for using Qt for Android is the use of Android SDK and NDK. Software Development Kit (SDK) is a package of tools enabling development of Java applications. Acronym NDK means Native Development Kit. This package includes a C and C + + compilers for Android.

The following diagram is roughly indicating how Qt applications on Android usually work. On the device it is installed Ministro application first, that is set as the dependence of the main application. Application Ministro takes care of downloading individual modules Qt. The actual main application will be then smaller. This method also ensures libraries reusability (the other applications can also use these libraries). The Ministro tells to the main application (when it is started) only the path where Qt is installed, or pulls in missing modules.

Diagram of the application function

On the other side of the diagram it is the application package. To the application there are attached the “loader” and “bridge” which mediate communication with Qt and the device. To obtain data from Dalvik (Davlik is the Java virtual machine in Android) it is apparently used the JNI (Java Native Interface). Usage of the components “loader” and “bridge” is for the Qt application programmer transparent.

Installing the SDK

Qt Creator since version 2.6 has experimental support for the development for Android. After starting it is necessary choose “About Plugins” in the menu “About” and find the plug-in for Android. When it turns on, it appears the item Android in the Settings (menu “Options”).

Necessitas project seeks to simplify development environment installation. On the project website necessitas.kde.org you can download the installation package that will install the Qt Creator IDE (development environment), Android SDK, Android NDK and sets the environment so that it can be used directly.

Android SDK paths in Qt Creator

In the “Devices” tab appears “Android Device”. If Android SDK startup detects the device it installs the package to this device. Otherwise, the Virtual device is started in the simulator window.
One of the problems that can occur during installation is the lack of support for OpenJDK 1.6 in the distribution. For example, Fedora 17 does not have the appropriate packages in its repositories. Apparently it is a patent or a licensing issue with OpenJDK.

http://kojipkgs.fedoraproject.org//packages/java-1.6.0-openjdk/1.6.0.0/65.1.11.fc17
$ rpm -i neco.rpm -- nodeps

Development

For the user interface development it is Qt Quick available. More complex elements of the user interface are not supported. There are relatively simple controls only such as buttons, check and combo boxes. On devices as Symbian or MeeGo Harmattan these elements are included in qt-components. Although there are other “qt-components for Android” too, they are not part of Necessitas SDK. These other components may not meet the User Interface Guidelines for Android.

Permissions settings

Another issue is the functionality of the module Qt Mobility library. Is not easy to tell, if all modules will work properly (as access to a microphone or a camera is likely to be problematic). To make it a try, it is necessary in the project settings (Project -> run -> Package Configuration -> Libraries -> … “) select the appropriate module. Service Ministro then pulls it into the System. In these project settings it can be also set permissions for the application (see figure).

Now we have the fourth Necessitas SDK alpha version, so it still contains a large number of bugs. Nevertheless, it is possible to create interesting programs in C + + using Qt without having to program in Java.

Sdílejte:

Share this:

Posted in Uncategorized • • Top Of Page

11 Responses to “Qt for Android”

Comment from Hero sky epic guild wars triche
Time 18. 10 2015 at 03:07

I got this web site from my friend who told
me regarding this web page and now this time I am visiting this web site and reading very informative articles or reviews here.

Comment from SNIPER X WITH JASON STATHAM Hack
Time 24. 10 2015 at 02:02

Lateг we’ve wrote our ߋѡn Store API for iOS and Andrօid on Cocos2dx.

Comment from melia biyang
Time 10. 1 2016 at 09:55

Hurrah! In the end I got a blog from where I know how to really get useful information concerning my study and knowledge.

Comment from Medical Marijuana Card Maryland
Time 17. 1 2016 at 07:38

02 A 3 f, is in violation of the Federal Equal Protection Act under the 14th Amendment to the US Constitution. ARIZONA is the first
instance of a patient filing a lawsuit against the state regarding authorization to cultivate.
Advances in science has now made it possible for the experts to
unravel the mechanism of how exactly the drugs work in the brain.

Comment from travel to phuquoc
Time 17. 1 2016 at 17:38

The temples found in Ho Chi Minh City bear the heavy influences from China
and India. Floating market is so popular activity in this
Mekong delta area. Cat Ba may be the biggest area in Halong Bay,
attracting much traffic.

Comment from manfaat binahong untuk kanker
Time 27. 1 2016 at 10:20

Thanks for finally talking about >Qt for Android Openmobility <Liked it!

Comment from Chana
Time 26. 2 2016 at 03:38

Youu do that by requesting a PAC Code from your current community and letting tthe new community knopw this.

Comment from www.emilaybreast.net
Time 13. 3 2016 at 10:39

Emilay Breast dibuat dari bahan alami herbal dan tumbuhan tanpa mengandung bahan kimia yang berbahaya bagi tubuh anda.

Comment from blogspot.com
Time 13. 6 2016 at 10:52

That is really interesting, You are an excessively professional blogger.
I have joined your rss feed and look forward to looking for extra
of your wonderful post. Additionally, I have shared your website in my social networks

Comment from 8tracks.com
Time 6. 8 2016 at 01:50

De ontwikkelaars hebben ons de mogelijkheid om hun eigen clans,
waarin de leden kaarten uitwisselen wanneer nodig, waardoor de kans op een uitdaging
met vertegenwoordigers van vijandige groepen verhogen creëren.

Comment from 33Elena
Time 17. 5 2017 at 14:06

I must say it was hard to find your blog in google.
You write awesome articles but you should rank your page higher
in search engines. If you don’t know how to do it search on youtube:
how to rank a website Marcel’s way

Write a comment


Yandex Mail.ru Google LiveJournal myOpenId Flickr claimId Blogger Wordpress OpenID Yahoo Technorati Vidoop Verisign AOL