Via Cà Matta 2 - Peschiera Borromeo (MI)
+39 02 00704272
info@synaptica.info

Delphi FMX – Run APK Installation programmatically

Digital Innovation Partner

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;