0

I just need some clarification, let's assume i have a Mobile App A(designed with xamarin forms) and another Mobile App B(not necessarily designed with Xamarin). Will it be possible to open Mobile App B directly from Mobile App A with just the click of a Button.

Thanks in advance.

  • http://stackoverflow.com/questions/11421048/android-ios-custom-uri-protocol-handling has answers on how to do what you are asking. Opening another app WITHIN your app cannot be done, but launching the other app if it is already installed is possible. – Jason Short Oct 31 '16 at 16:47

2 Answers2

1

Yes you need the Application Package name, for example Uber opens up like this:

Android:

Device.OpenUri(new Uri("uber://"));

//Google Maps: "comgooglemaps://?views=traffic", "google.maps://"
//Yelp: "yelp:///search?term="

And so on.

Mario Galván
  • 3,964
  • 6
  • 29
  • 39
1

I assume you want to start a new activity and open the new APK, so you have to start an Intent to open the new application

// Here filePath is the Path for the .apk
Java.IO.File a = new Java.IO.File (filePath);

Intent intent = new Intent(Intent.ActionView);
intent.SetDataAndType(global::Android.Net.Uri.FromFile(new Java.IO.File(filePath)), "application/vnd.android.package-archive");
intent.SetFlags(ActivityFlags.NewTask | ActivityFlags.ClearTask);

try 
{
    var c = Android.App.Application.Context;
    c.StartActivity(intent);
    dialog.Dismiss();
    this.Finish();
} 
catch (Exception e) 
{
}
Bruno Caceiro
  • 7,035
  • 1
  • 26
  • 45