im working on a app coded in C#. Also im using Visual Studio XAMARIN and my android phone for that.
I want to install a apk programmatically. I download a apk from web programmatically (solved yesterday with the help here) and now i try to install the apk file. I found this: Android: install .apk programmatically
But this is in Java and i cant use java for my Application. i tried to do it like there in C# but failed.
This is the code i tried to use:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(newFile(Environment.getExternalStorageDirectory() + "/download/" + "app.apk")), "application/vnd.android.package-archive");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
but i cant use things like uri.fromFile etc. Also (im not sure where it was) i read that someone said its not even possible to do it in C# and now i dont know what to belive.