[fpc-pascal] Working Free Pascal android JNI example

Benjamin Jan Alexander Rosseaux benjamin at rosseaux.com
Sun Jun 27 09:50:35 CEST 2010


Hello,

I've done a working Free Pascal android JNI example (with working .apk 
for current ARM-based Android device of the second device generation 
(because with VFPv3, so Motorola Droid/Milestone, HTC Desire, Nexus One, 
Samsung Galaxy S, and so on) inside)

http://vserver.rosseaux.net/stuff/FPCAndroidJNINativeTest.zip

It contains androidprt0.as as replacement for the empty arm/linux 
dllprt0.as of the FreePascal RTL from the SVN, because otherwise the 
Android Dalvik VM refuses to load the .so library because of 
missed/absent global/import/export symbols (_haltproc_eabi, __strptr, 
__operatingsystem_parameter_argv and so on).

It contains also a own JNI header port from the Android NDK, and own ARM 
Toolchain hook binaries to inject some command line parameters to the 
original "as" and "ld" binary calls. For "as": "--march=armv7-a 
-mfloat-abi=softfp -mfpu=vfp3" and for "ld": "--fix-cortex-a8"

And important FPC parameters are -CpARMv6 -CfVFPV3

I've done it, because i'm needing my own ECMAScript 5th edition engine 
called BESEN in a Android project of me.

Someone can make maybe a true patch from this for FreePascal for a 
offical android target support in FreePascal. And my OpenGL ES 2.0 
headers (what I did originally for Nokia N900 for Maemo 5) are already 
in the FPC bugtracker, which should also under Android after a 
single-line-change of the OpenGL ES library path.

Benjamin 'BeRo' Rosseaux





More information about the fpc-pascal mailing list