[SOLVED][Android] call external library with a string type in parameter ? lazarus / 43-Android ---------------------------------------------------------------------- ROCABDEL · 2012-06-15 08:06 I just did the test on the bass library, but I could not go too far .. I happen to load the dll and initialize it, the problem is how to call a function with a "string" type.. ex: in Bass.pas i:  Code: [Select]BASS_StreamCreateFile      : function(mem: BOOL; f: Pointer; offset, length: QWORD; flags : DWORD): HSTREAM; and in BASS.java i:  Code: [Select]public static native int BASS_StreamCreateFile(String file, long offset, long length, int flags); I called in the first BASS_StreamCreateFile with PChar(F) but the second I do not know how to call it. Sorry for my English  thx ---------------------------------------------------------------------- felipemdc · 2012-06-15 08:23 You can access Java APIs using JNI, I just added an example here: http://wiki.freepascal.org/Android_Programming#Example_1:_Creating_a_J ava_object_and_calling_a_Java_method Try to use it as an example and build your own JNI code. If you have trouble then post here your partial JNI code and I will help you fix it and make it work. ---------------------------------------------------------------------- ROCABDEL · 2012-06-15 08:28 Ok thank you felipemdc  to answer so fast  I will try Thx ---------------------------------------------------------------------- felipemdc · 2012-06-15 09:52 Yours is a bit different from my example, so I created a pseudo-code which might work explaining how to call static methods here: http://wiki.freepascal.org/Android_Programming#Example_2:_Calling_a_st atic_method ---------------------------------------------------------------------- ROCABDEL · 2012-06-16 22:37 thank you it works, I think I understand now, the problem is resolved. Thanks for the beautiful work you do, good continuation ...