[fpc-devel] New FPC JVM snapshot: Android support

Sven Barth pascaldragon at googlemail.com
Sat Dec 17 16:15:33 CET 2011

On 12.12.2011 19:50, Jonas Maebe wrote:
> Hi,
> A new FPC JVM snapshot has been put online at http://wiki.freepascal.org/FPC_JVM
> The main new feature is full fledged support for Android/Dalvik, including a Pascal translation of the Android SDK classes. To compile for Android rather than for the Java VM, simply use the -Tandroid command line parameter. The compiler will still generate Java class files, but these can then be translated into Dalvik code by the Android SDK tools just like any javac-compiled class files.

So, I have now tested your new snapshot (nice that "make" finally works 
in the top level ^^) and I've got the same error as before.
The error occurs when I try to instantiate a custom class of mine that 
implements an (inner) interface from the Android SDK. I have tested the 
following variations:

* implement a inner interface
* implement a "global" interface
* descend from TObject
* descend from JLObject
* implement in a nested class
* implement in a "global" class

All lead to the same error: ClassDefNotFoundException (and the class 
that's tried to be created) when instantiating the class.

I have attached an example containing some of the above mentioned 
variatons, a manifest file and a Makefile which you'll need to adjust to 
your setup. Then a "make prepare genrjava all" should (in theory) 
suffice to create a unsigned apk which you can sign by "make signedapk". 
This can then be installed using "make install" if you have an emulator 
(or device) running.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: interfacetest.tar.gz
Type: application/gzip
Size: 1548 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20111217/063ab29c/attachment.gz>

More information about the fpc-devel mailing list