Home · All Classes · Grouped Classes · Annotated · Functions

Qtopia Java Integration

Java Integration

When integrating a Java VM into Qtopia, it is important that the installed Java applications operate seamlessly with native Qtopia applications. To ensure this, the following considerations should be made:

ConsiderationDescription
Use .desktop filesJava applications should be referenced by .desktop files in the $QPEDIR/apps/Applications or $QPEDIR/apps/Games directory (depending whether it is an application or a game). They should not be isolated in a separate tab or in a totally different interface.
Use unique executablesFor the Qtopia execution model to function correctly the following line must be specified in the .desktop file:
    Exec= line

where line is a unique executable name.

This executable name may simply be a symbolic link to the actual executable which then uses argv[0] to determine its behavior. This is essential for QCop communication between the application and the launcher. In particular, the following will not work:

    Exec=jvm appname

.

Use QtopiaApplicationQtopiaApplication must be used, not QApplication, otherwise all the framework provided for Qtopia will not function correctly. In particular, QtopiaApplication communicates with the launcher via QCop to handle things such as the taskbar icon, raising, quitting, opening documents and changing styles and fonts.
Use QtopiaApplication::exec()This ensures that functionality such as QCop processing is initiated. If you must use your own event loop rather than exec(), you must at least call QtopiaApplication::setMainWidget(). If is not possible, additional functionality will need to be added to QtopiaApplication to support your event loop.
Follow Qtopia ConventionsThe widget toolkit or bindings used by the JVM should follow the Qtopia conventions. For example, it should use QtopiaApplication::execDialog() rather than QDialog::exec().

Note: These items are listed in order of the Qtopia application execution control flow and so correspond to the order in which they can be easily tested.

The above rules can be relaxed to some extent, however additional integration coding will be required in QtopiaApplication and the Qtopia launcher (qpe) process.


Copyright © 2008 Nokia Trademarks
Qtopia 4.3.3