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

md at rpzdesign.com md at rpzdesign.com
Wed May 22 15:56:12 CEST 2013


Felipe:

Any comments on how you would mix C and pascal into the same binary
for JNI/Android?

I have some encryption routines in C that I need to link to Pascal and 
then get called by Java.

md

On 5/22/2013 7:29 AM, Felipe Monteiro de Carvalho wrote:
> 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.
>




More information about the fpc-pascal mailing list