Is there any Android API pascal translation for camera, phone book, etc ... using Android Native SDK?
procedure TCDWidgetSet.LazDeviceAPIs_OpenUrl(url: string);var lJavaString: jstring; lStr: String;begin lStr := url; lJavaString :=javaEnvRef^^.NewStringUTF(javaEnvRef, PChar(lStr)); javaEnvRef^^.SetObjectField(javaEnvRef, javaActivityObject, JavaField_lcltext, lJavaString); javaEnvRef^^.CallVoidMethod(javaEnvRef, javaActivityObject, javaMethod_LCLDoOpenUrl);end;
public void LCLDoOpenUrl(String url){ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(browserIntent);}
for example I have a String Field lTXTCallerID and it calls a native void method. now on the native side I need to get the Field lTXTCallerID and convet it to pascal string.
This is the only thing I am stuck, when I figure that out, I will create a complete API for camera, contacts, etc... and send it to you so you can integrate it.
procedure Java_AFX_Trigger(); cdecl;var eo: jobject; eb: jboolean; e: string; str: TStringList;begin eb := 1; eo := javaEnvRef^^.GetObjectField(javaEnvRef, eo, java_EventVar); e := javaEnvRef^^.GetStringUTFChars(javaEnvRef, eo, eb); //<- HERE IT BREAKS if e = 'TEST' then begin Log('TEST IT WORKS MAN :) <br>'); end;end;
Samsung Galaxy works just fine but on a phone it crashes (very fast), do you have any idea why. its not even logging something.