I try to request LOCATION_HARDWARE permission for reading usb.
in delphi I try this code:
procedure getPermiss;
var
LPermissions: TJavaObjectArray<JString>;
begin
LPermissions := TJavaObjectArray<JString>.Create(1);
LPermissions.Items[0] := StringToJString('android.permission.LOCATION_HARDWARE');
try
TAndroidHelper.Activity.requestPermissions( LPermissions, 1);
except
on E : Exception do
begin
ShowMessage('Exception class name = '+E.ClassName+' ' +E.Message);
end;
end;
end;
but on test in Android Phone show this error: "JNIFatal: Invoke Method Not Found"
I see that the requestPermissions method of Activity needs 3 parameters, and in delphi needs only 2.
The method signature on AndroidStudio is requestPermssions(Context, String[], int)
and on delphi is requestPermissions(String[], int)
hidden the first (Context)
Is this difference the problem? how can I solve ?
Tks