Delphi FMX – Run APK Installation programmatically
var
aFile:Jfile;
Intent:JIntent;
begin
aFile:=TJfile.JavaClass.init(stringtojstring(‘/storage/sdcard0/Android/data/com.CloudCon.AtualizacaoAutomatica/files/’),stringtojstring(‘Rota.apk’));
Intent := TJIntent.Create ;
Intent.setAction(TJIntent.JavaClass.ACTION_VIEW);
Intent.addFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
Intent.setDataAndType(TJnet_Uri.JavaClass.fromFile(aFile),StringToJString(‘application/vnd.android.package-archive’));
SharedActivityContext.startActivity(Intent);
end;