locked
Launching one installed metro app from another running metro application

    Question

  • hii

    I have one metro app from which i want to navigate to or say launch another metro app which is already installed on ma pc programmatically.After i am done with newly launched app i also want to get back to running app.

    I am using:

            

    Windows.Storage.StorageFile file1 = await Windows.ApplicationModel.Package.Current.InstalledLocation.GetFileAsync(@"NewApp.exe"); 

    await Windows.System.Launcher.LaunchFileAsync(file1);

    which gives me file not Found exception .

    Here for metro app i am giving .exe extension. is it correct or other extension is required.

    Plz help me..

    Thanks in adnvance

    Thursday, September 06, 2012 12:10 PM

All replies

  • Thursday, September 06, 2012 1:03 PM
    Moderator
  • thanks for your answer  jpsanders,

    I m also trying it by setting protocol.

    But i am not aware what name of protocol  is to be given for opening any metro app ..say i want to open "mymetroapp" what all things i need to enter while creating a protocol.

    ACtualy the scenario is:

    I open one metro aap say app#1 and login into that  with that sucess login details i need to launch metroApp#2on button click where i will perform some operation say fliiping images in flipview. The time i spent viewing an image from flipview is stored in sqlite database after i come to the end of that app i need to go to metroapp#1 witht the data from metroapp#2.

    So how it would be possible..



    • Edited by Anonymous_g Friday, September 07, 2012 8:53 AM
    Friday, September 07, 2012 8:16 AM
  • No you cannot do this.  The only way would be to use protocol handlers and if you don't know what valid protocol is available you obviously cannot invoke it.

    -Jeff


    Jeff Sanders (MSFT)

    Friday, September 07, 2012 11:38 AM
    Moderator
  • What can be the protocol for application having just a flipview for viewing images and some basic animations.

    I am really in need of solution for this query ..plz suggest some code ..


    Monday, September 10, 2012 7:34 AM
  • hey ..

    I have managed calling metro app from other metro app but still der is one problem..

    What i am doing is :I have app1, app2 and app3

    I am calling app2 and app3 from app1.

    So i am declaring app2's package name as a  protocol name in appmanifest of app2.and same for app3.

    and i am calling dem by writing the following code in app1 ::

    //To call App2

    private async void capture_Tapped(object sender, TappedRoutedEventArgs e) { var options = new Windows.System.LauncherOptions(); options.TreatAsUntrusted = true; var ur1 = "c8dec4c0-db6a-4340-9f4d-fecc0ea05916://"; Uri ur = new Uri(ur1); await Windows.System.Launcher.LaunchUriAsync(ur, options); }

    //To call App3 private async void Image_Tapped_1(object sender, TappedRoutedEventArgs e) { var options = new Windows.System.LauncherOptions(); options.TreatAsUntrusted = true; var ur1 = "dd4b843e-0b97-4d2a-a85d-fd7d0dd62a95://"; Uri ur = new Uri(ur1); await Windows.System.Launcher.LaunchUriAsync(ur, options);

    ..

    With this the app is getting launched but the problem is when i click to open app initially nothing comes ,after some time the start window comes and after that the app1 gets loaded.

    Can u please suggest some solution for this.



    • Edited by Anonymous_g Wednesday, September 12, 2012 9:57 AM
    Wednesday, September 12, 2012 9:55 AM
  • I am having trouble understanding what your problem is.

    What is the expected behavior?

    What is the actual behavior?

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, September 25, 2012 2:34 PM
    Moderator