Javatrans Symbian OS notes

Chris Greenhalgh, 2006-03-29; last update 2007-05-30

Introduction

This file (may) hold information specific Javatrans targetted to Symbian OS.

Restrictions

Symbian is a real pain and makes the whole of the translated code much more unreadable than it might be in ANSI C++/Posix. In particular:
Doh.

Threading issues

If using generated code from a Symbian application be aware that a symbian application normally has only a single thread, and this thread is the only thread which can perform UI operations (because the UI libraries use thread-local storage).

Based on the approach used in Java Swing, under symbian the following additional java_lang_Thread class methods can be used to (a) determine if user code is being called from the main application thread or from another (internal) thread and to (b) hand off calls to user code from an internal thread to the main application thread via a Symbian active object scheduled by the main thread (cf. the Swing event dispatch thread). These methods are:
As an additional convenience the following non-standard java_lang_Thread constructor can be used to avoid having to defined framework-supported subclasses of java_lang_Runnable in order to define the code to be called using this mechanism:

Sample code/projects

I have been developing/testing for Symbian using Symbian 8.0a series 60 FP2 SDK, and Carbide.vs with Visual Studio .NET 2003.

There are two solutions in CVS:

Although set up to build under VC++ these include the normal Symbian project and package files, and so should importable/buildable in other IDEs/environments.

Known Issues

See Javatrans_introduction.html

Change Log

2006-03-29