[fpc-pascal] Re: Android JNI failing in Galaxy S4

Felipe Monteiro de Carvalho felipemonteiro.carvalho at gmail.com
Wed May 22 15:29:36 CEST 2013


Hello,

On Wed, May 22, 2013 at 1:50 PM, md at rpzdesign.com <md at rpzdesign.com> wrote:
> Are you saying that you are writing JNI routines in Pascal for android?

Yes. And luckly it works in all devices =) I was a bit scared that I
might hit a wierd problem here involving code generation or whatever,
but ... just a normal typo in my program.

> If so, can you post some of the things like the pascal header files you use
> to allow for the creation of the .so files
> so that Java can call into pascal across the JNI interface.

See here:

http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/bindings/android-ndk/

The file jni.pas is what you are looking for. The rest are Android NDK
headers. I think that it should work for any Java platform.

In the folder "examples" there, there is a full Android JNI example.

In lazarus/lcl/interfaces/customdrawn/* there is also a lot of JNI
code for Android which can be utilized as examples to learn how to use
JNI.

-- 
Felipe Monteiro de Carvalho



More information about the fpc-pascal mailing list