I wanted to really quickly make a note that the first commit of my Build 2015 demo is now up on https://github.com/arunjeetsingh/Build2015. If you’ve been following me on Twitter (@aruntalkstech) you might know that I plan to build my Build demo in my GitHub repository. The code in there should build with the latest Windows 10 preview tools but not all of it runs flawlessly on 10041 or 10049. So while you can play around with it be wary of not implemented exceptions and other places you’ll fall off a cliff because we’re not done yet. Still, great way to explore what’s coming.
Here’s a quick back of the envelope map of the world showing what’s interesting in there:
- Contoso Shop: This project is a shopping app that lets you look at expensive Roombas and buy one. Eventually the Roombas will probably get replaced with something more generic because the lawyers won’t let me give iRobot free advertising.
- Woodgrove Bank: This project is a banking app that lets you check out items bought in Contoso Shop. Contoso Shop uses the new Launcher.LaunchUriForResultsAsync API to launch Woodgrove Bank. Go take a look at Section 10 here: http://www.microsoftvirtualacademy.com/training-courses/a-developers-guide-to-windows-10-preview to learn more about Launcher.LaunchUriForResultsAsync. Unfortunately, this doesn’t work yet on 10041 or 10049 so this is one of those places where you fall off a cliff.
- ShipTrack: This project is a shipment tracking app provided by the a package delivery company (say FedEx or DHL). ShipTrack also provides an app service that Contoso Shop will consume to figure out where your package is. The app service is implemented as a background task in the ShipTrackService project. Go take a look at Section 12 here: http://www.microsoftvirtualacademy.com/training-courses/a-developers-guide-to-windows-10-preview to learn more about app services.
- Take a look at the Buy method in https://github.com/arunjeetsingh/Build2015/blob/master/ShoppingDemo/ContosoShop/MainPage.xaml.cs for an example of how we use Launcher.LaunchUriForResults.
- Take a look at GetShippingStatus in https://github.com/arunjeetsingh/Build2015/blob/master/ShoppingDemo/ContosoShop/OrderHistoryPage.xaml.cs to see how we use an AppServiceConnection to get shipping information.
I’ll have more details as we continue to build out this demo. Feedback/Comments are very welcome. Leave them here or tweet them @aruntalkstech. Happy hacking! 🙂
What I’m wondering is – will the OS launch the Store app and prompt user to install the app/app service if it’s not already installed when you try to use it?
LikeLike
Also, when you try to set up a connection and fail – you simply Debug.WriteLine(“Failed to open connection: ” + status.ToString());
It would be good to establish a more user friendly standard for how to respond to these. What are possible failure reasons? How would an app typically respond? Not sure what the possible status codes are, but a switch block would be nice in the sample.
LikeLike
I intend to talk about the failure reasons during my //Build session. The goal is to keep the demo relatively simple until Build so it’s easy to get into for someone who’s just taking a quick look.
LikeLike
Not for app services because it would be weird to suddenly see a prompt asking you to install an app that the app you’re using was trying to launch in the background. Instead, we tell you whether or not the app service you’re trying to connect to is available so the app developer can offer to take the user to the store if they want to.
For launcher, we’ve always offered to take the user to the store to find a suitable app and we’ll continue to do that. If you specified a LauncherOptions.TargetApplicationPackageFamilyName (that’s a new property) we take the user to the store page of the app identified by the TargetApplicationPackageFamilyName.
LikeLike
Hi, what happens when my app calls LaunchUriForResults and while the other app is running, my app gets tombstoned?
LikeLike
On mobile, your app gets suspended. That is, it still runs but because the app you launched is in front of the user your app gets no CPU until the user is done interacting with the app you launched. On desktop, both your app and the app you launched keep running because the user can see both. Does that make things clearer?
LikeLike
What happens on the phone when the new app launches another app, that launches another app… until the phone runs out of memory? Do any of the apps along the way get tombstoned (which would mean that awaiting the LaunchUriForResults would not finish, because the app gets killed).
Thanks
LikeLike
We do a bunch of memory compression on suspended apps (on mobile) to try and make this as unlikely as possible. But you’re right, at some point along the way if you send the user 5-6 levels deep the original caller will get tombstoned So far we’ve tested this scenario with up to three apps on low memory (512MB) devices with good results. In general my recommendation is that apps launched for results should not (if it can be avoided) launch other apps for results.
LikeLike
Got it, thanks for the clarification
LikeLike