http://ads.buzzcity.net/adpage.php?partnerid=40096
分类: 嵌入式
2011-05-10 21:08:14
where X is the number of CPU cores+1
Before we start let's clarify what is an android application? Android applications are java apps packed into a package. In this package you can also embed one or more (shared) libs which can be loaded from java code and can interact with java using JNI. Currently you can't have a binary application in the package so, qt application, embedded in this bundle, are in fact shared libs.
For more informations about android application architecture, please consult Android Application Fundamentals page.
I see 3 scenarios to use Qt on Android:
Using Qt to write entire applications for AndroidUsing Qt to write entire applications for Android is very easy, you have to have a java application which will load the qt application and start it.
You don't have to write your own jni<=>java connections , all the magic is done from java by com.nokia.qt package, take a look toexamples/android/QtTest/src/com/nokia/qt, (I hope Nokia want sue me because I used this name ;-) ) and from c++ by the android graphics system plugin located to src/plugins/graphicssystems/android. For more informations you can read .
You can use the powerful QtCore, QtXml, QtSvg, QtSql, etc. to help you to write your own libs to help your java part. Here you will have to take care about java <=> jni integration. For example you can use Qt's stl like containers (QVector, QList, etc.).
Using Qt to write standalone applications (not bundled in a package) for AndroidThe last scenario to use Qt is to use it as a standalone applications, you need to make sure the CONFIG variable doesn't contain android value.
CONFIG -= android