Delphi 10.2 Tokyo Android install .apk programmatically (new version)

  

How can I download the app from the web address, and install it with a new version

I use this code, but I get an error
“android.content.ActivityNotFoundException …..”

procedure TfLogin.Button1Click(Sender: TObject);
var
Intent: JIntent;
begin
Intent := TJIntent.Create;
Intent.setFlags(TJIntent.JavaClass.FLAG_ACTIVITY_NEW_TASK);
Intent.putExtra(StringToJString(‘EXTRA_NOT_UNKNOWN_SOURCE’), true);
intent.setDataAndType(TJnet_Uri.JavaClass.parse(StringToJString(‘https://examples.com/xxx.apk’)),
StringToJString(‘application/vnd.android.package-archive’));
Intent.addFlags(TJIntent.JavaClass.FLAG_GRANT_READ_URI_PERMISSION);
SharedActivity.startActivity(Intent);
end;

The mistake I get

Comments are closed.