One more important note for shared libraries on Android.
If the library is NOT a JNI library (which I suppose is always the one created by LAMW) you have to simulate that, otherwise it will hang on Android systems <4.2!
At least this blocker comes with recent FPC trunk (downloaded a week ago).
The cause is well described in fpc source (compiler/systems/t_android.pas).
I spent hours and hours isolating the cause.
If coming to this issue and your library hangs on such old device, add this to your library:
{$IFDEF ANDROID}
function JNI_OnLoad(VM: Pointer; {%H-}reserved: pointer): Longint; cdecl;
const
JNI_VERSION_1_6=$00010006;
begin
Result := JNI_VERSION_1_6;
end;
exports
JNI_OnLoad name 'JNI_OnLoad';
{$ENDIF}
Note: In FPC that came with Laz4Android 1.5 the libraries work fine even without this fix. Clearly because there were huge changes made in Android RTL during this time.
Yury, as it seems you are the author of the new android RTL, did you make here something recently or what else would you recommend here?
Although this fix works (and even the GetAppConfigDir works because the RTL sets IsJNILibrary to true), it is quite a dirty fix.