Necessitas/FAQ: Difference between revisions

From KDE Community Wiki
No edit summary
No edit summary
Line 11: Line 11:


For an example on how to use OpenSLES, see [http://community.kde.org/Necessitas/AndroidAudio here].
For an example on how to use OpenSLES, see [http://community.kde.org/Necessitas/AndroidAudio here].
=== I don't like the android style plugin, can I switch back?  ===
Yes you can.
There are two options way to do it:
* if you want to use the old plugin with the android palette and fonts, then '''AFTER''' you create the application object set the style to plastique: '''QApplication::setStyle(new QPlastiqueStyle);'''
* if you want to disable the new plugin completely (no palette and fonts) then you have edit the QtActivity.java and set '''QT_USE_ANDROID_NATIVE_STYLE''' environment variable to '''0'''.

Revision as of 12:13, 15 November 2012

Can I call a C++ method from JAVA?

Yes, using JNI ! Check this example.

Can I call a JAVA method from C++?

Yes, using JNI ! Check this example.

I need Audio support

Sadly, currently Qt has no built in multimedia support ATM, if you need to play wav files, Android API-9 is coming with OpenSLES support, if you want to play other formats you can use Android MediaPlayer , check this example.

For an example on how to use OpenSLES, see here.

I don't like the android style plugin, can I switch back?

Yes you can. There are two options way to do it:

  • if you want to use the old plugin with the android palette and fonts, then AFTER you create the application object set the style to plastique: QApplication::setStyle(new QPlastiqueStyle);
  • if you want to disable the new plugin completely (no palette and fonts) then you have edit the QtActivity.java and set QT_USE_ANDROID_NATIVE_STYLE environment variable to 0.