Seguimos intentándolo sin mucho éxito...
He intentando varios códigos, pero no consigo dar con la tecla, lo último que he probado es este código:
Código:
procedure TMainForm.OpenAPK(AFileName: string);
var
LIntent: JIntent;
LAuthority: JString;
LUri: Jnet_Uri;
begin
LAuthority := StringToJString(JStringToString(TAndroidHelper.Context.getApplicationContext.getPackageName)+'.fileprovider');
LUri := TJFileProvider.JavaClass.getUriForFile(TAndroidHelper.Context, LAuthority, TJFile.JavaClass.init(StringToJString(AFileName)));
LIntent := TJIntent.JavaClass.init(TJIntent.JavaClass.ACTION_VIEW);
LIntent.setDataAndType(LUri, StringToJString('application/vnd.android.package-archive'));
LIntent.setFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION);
TAndroidHelper.Activity.startActivity(LIntent);
end;
He añadido la siguiente unit: "github.com/DelphiWorlds/KastriFree/blob/master/API/DW.Androidapi.JNI.FileProvider.pas"
Ahora el error que obtengo es: "Java type JFileProvider could not be found", y no se por donde seguir
