A lap around the Windows Phone 8.1 development platform
CC Attribution - NonCommercial - ShareAlike 3.0 Unported:
You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this
Wigley, Andy
Windows Phone 8.1 is out, and the stand-out new feature is convergence of the Windows and Windows Phone platform, making it easy to build universal apps that run on both platforms. But that’s not all! There are loads of new APIs that enrich the phone platform, lots of new platform features such as new Background task possibilities, GeoFencing, advanced sharing and much, much more. In this talk, we’ll take a tour around the new Windows Phone developer platform, outlining the new app development options and calling out the major new platform capabilities that you can take advantage of in your Windows and Windows Phone apps.
 Alright, good. Right, welcome. Thanks very much for coming along to this talk. I'm Andy Wigley. I work out of the UK. I'm a technical evangelist. I do a lot of work with the Windows Phone team. I'm most well known for the Jumpstart videos. We've got a whole new set out that we recorded last month. So the building out to Windows Phone 8.1 Jumpstart out on that short URIs out on Channel 9. There's also a Microsoft Virtual Academy course version of it if you prefer to do your learning in a more structured way. In case you're interested, that's what the studio looks like. That's in Redmond Town Centre. So there's me and Matthias Shapiro behind the desks there. And then you've got all this kind of high-tech stuff at the background, a guy on the right answering questions and a guy at the back doing all the mixing and then cutting between. We've got three cameras, one on the centre and both of us and then one for each of the speakers. It's a lot of fun, but well, intense session, as it says in the comments there, it certainly were intense. It's like two and a half days live to camera. So I'm still kind of recovering after all that. It's good fun. Load to content. Now, what this session is about is about the new Windows Phone 8.1 platform. It's about the underlying principles of how it works, why it does, and what it is we've given you. So it's pretty high level. After lunch, I hope some of you will be able to come back and do a real deep dive into building universal apps with kind of real techniques and these are the problems, this works and this is how you should organise your code and make the most of it. So I'm going to do a quick demo of that in this. So those of you who don't want to come back after lunch, you'll get a flavour for universal apps. Because the big goal of Windows Phone 8.1 was this, well, enabling great apps. We want to kind of catch up with the opposition and also and exceed them in good many places as well. So there's a whole pack of new APIs to help you build great apps for Windows Phone 8.1. But yeah, the big deal is this platform convergence. This is about bringing Windows 8.1 and Windows Phone 8.1 together so we can now very easily create apps that will run on both platforms. And improving all the capabilities. So we're fixing the little missing bits from the previous release and hopefully give you all that you need to create great apps. So yeah, it was this one Windows, this is this one Microsoft thing in action, delivering the shared developer platform which she shared from top to bottom. So we've now got Windows XAML, same XAML on both. So in Windows Phone 8, we had XAML and obviously Windows 8.1 store, we've got XAML. They're actually kind of different XAML. They're very close. The tags are all the same and the elements do the same and this kind of thing and you work on data templates. So the techniques are the same. But there were different namespaces, slightly different capabilities. It did mean that if you were trying to do, has anybody tried to build a sort of what we'd now call a universal app for Windows Phone 8 and Windows 8.1? Anybody here tried that? Nobody has. Okay, well, it's good because it's kind of painful. You can do it, but you kind of have to have everything very well organized and the XAML flavors, like I said, were kind of the same but different enough just to be annoying. So if you're copying XAML from one to the other, it was kind of hard. But we've now got unified XAML. We've got the Windows runtime runs right across both of these platforms now. It's all the same thing. The app model, by that I mean the way the apps behave, the way they get launched and activated and the memory management and the suspend and resume kind of stuff, that's all the same. Live tiles and the notification system, all the same. The distribution format, the way you package up your apps is now the same and we've got the converged controls and performance. So the Windows XAML actually is much more performant than the old Windows phone SilverLines XAML. And accompanying that, not only the dev platform bits but the app services as well, all the other bits and pieces that you need to make a successful mobile app today. First of all, starting with the developer store registration. You sign up now to be a Windows phone developer. You are a Windows store app developer as well. You don't have to pay or register twice over. There's still two portals. We've still got some work to do to really bring it all to one location on the web. But that's the developer registration is the same. WNS is the push notifications infrastructure. That's unified now and is used for all Windows phone 8.1 and Windows 8.1 devices. And we've got cute stuff like data roaming and backup. I'll leave that and talk about that. I've got to slide a bit more on that further on because that's a really nice feature that helps you to create nice unified experiences that flow across devices. We've also got the shared app identities and entitlement. What that means is that as a user developer could ship a Windows phone version of your app and a Windows store version of your app. And if you choose to allow the user to have the shared entitlement, it means they buy the app on one platform. They automatically get usage rights on the other as well. So they pay for it once and they can install it across all their devices. And that's enabled by this thing called shared app identities, which is a fancy name for basically means they have the same name when you reserve the name in the store. And this convergence is not something we just kind of thought up yesterday. It's actually been going on for quite a while. It started back with Windows phone 7.5. Actually, those of us with longer memories than that would argue it actually started with Windows mobile 6 because go back to Windows mobile 6 and we actually had Internet Explorer browser on Windows mobile and on Windows 7 or whatever it was at that time was the same code set code base. So they were already the Internet Explorer team were already working from one code base and producing browsers for the different platforms. But that was revisited again. And that's certainly with what we code named mango at the time, Windows phone 7.5. That was the key thing around IE 9 was the same on both platforms. When we got to Windows phone 8, it wasn't so much shift from a developer point of view. But really what we did was we sorted out the foundations and we fixed the underlying structure that if the whole phone and the tablets all run on top of what you've got, you get with Windows phone 8 is the Windows NT kernel. Now what we should we threw out the old operating system winds phone 7 we brought in the Windows NT kernel, the same OS kernel at a low level, not top to bottom OS is a complicated thing with loads of bits in it. But the kernel and a lot of the modules like networking and file system all that sort of thing, it's all the same. So we were kind of already unifying the operating systems with Windows phone 8. And we started the work of converging the developer APIs and that was most obvious for gamers. So DirectX, Direct3D gamers, it was pretty easy to port an app from Windows to Windows phone and vice versa. For XAML based developers, there were some bits and pieces that we brought in that were converged a few little bits in that purchase was the same sensors were the same there was a subset of the Windows dot storage for working with files and folders was the same. But not really very much across the board. So then we get to Windows phone 8.1 which is the first phones are now starting to be sold out into the marketplace which have got 8.1 on them. And we released it at we released the dev platform at build which was six weeks, eight weeks ago. Seems like an age but time. These things move so fast. And you can get a phone 8.1 on your phone now. Has anybody put 8.1 onto their phone? Good number of you. Yeah. So if you haven't you can get it today if you want it on if you've got a Windows phone 8 device because all Windows phone 8 devices can run phone 8.1 OS. But there's a special app called the preview for developers. If you install that app and then you need to have a developer account. So you can either register on dev.windowsphone.com for $19 or if you've got an MSDN subscription for free or you can sign up at appstudio.microsoft.com which is a web based thing for creating apps and that's for completely for free. So that qualifies you as a developer because when you run this preview for developers app, it will prompt you for your live ID of your Microsoft account credentials. And if it matches up that you are what we consider a developer then what we always do is we shift the we change the address that the phone is looking at the service is looking at for updates. And instead of being your mobile operator, it shifts it over to our service. So you'll get the 8.1 update then. And there's already been three kind of updates to the update already. So it's been refining it and fixing bugs in it and it's now getting it's now ready for going out into to be sold out onto real phones out to the marketplace. So this 8.1 brings us this common core platform loads of stuff. It really is a total alignment from top to bottom. It now is very, very, very close. How close is it? Well, this is the Windows runtime API's. The big blue one there represents Windows. The Windows runtime on Windows and the small red one there is Windows Phone 8. I said that we had a few APIs that were already converged. So that's the in-app purchase Windows, the sensors, the Windows.storage subset. And that's what it was in 8.0. That's what it is now, 8.1. Over 90, 95% of the APIs in the Windows runtime are exactly the same. There's a few edge cases where they had to be some properties aren't observed or in a few cases there's different ways of calling them to account for working on low memory devices like the 512 meg phones. But yeah, for the most case, you're working on a completely converged platform which is fantastic. This is another way of looking at it. This is all the block diagram of the kind of dev platform. The big boxes at the top there, these are the your options for writing apps for Windows Phone 8.1. So going across from the left, we support WinJS. So if you work with HTML and JavaScript, you prefer to work with those, you can create native apps using WinJS. That's now supported on Windows and Windows Phone and of course is coming to Xbox. And then in the middle we've got Windows XAML. So Windows XAML is the Windows runtime XAML. This is the flavor of XAML that we've been using on Windows up till now and that is now the one that's come down to the phone or up to the phone or across to the phone, however you want to look at it. And you can write your code for those apps in C-Sharp or Visual Basic or C++. So those three options and C++ is brand new for the phone. We had C-Sharp and VB before. DirectX, C++, Gamers. Like I said, that was already pretty well converged in Phone 8 but that's, we've had new enhancements and new features come in. So a lot of stuff to help you create even better games but that's another option for gamers. And then we've got this thing called Silverlight XAML on the right there which is the kind of traditional XAML programming model for Phone. So there's been a few eyebrows raised when we say this thing's Silverlight. They said, didn't you kill Silverlight? No, we never killed this flavor of Silverlight. So this is not the web browser plug-in. Okay? This is, I mean, this is the technology effectively when we had Silverlight in the browser you could install a Silverlight app from the browser onto your desktop and run it out of browser. This was the technology that we used in Windows Phone 7 for creating apps. It runs out of browser. Actually on Windows Phone 7 it never runs in the browser. It's just purely for creating native apps on Phone 7. Then we got to Phone 8. Well, we stopped calling it Silverlight XAML. We just want to call it Windows XAML. Just as a marketing move, you know, it's just kind of, it's XAML across the board. But now of course we kind of shot ourselves in the foot a little bit there because now we get to Windows Phone 8.1 and actually we've got two flavors of XAML. We've got the Silverlight XAML that you might have been doing using up till now and we've got Windows Runtime XAML which is the same one we've got on the tablet. So in order to stop any confusion, we are calling these two Silverlight XAML and Windows Runtime XAML. So just so you know when we're talking about it, which one we're talking about because there are subtle differences between the two. This is another way of looking at the same thing. So you can create games with DirectX, Direct 3D, although most people use one of the games middleware platforms like Unity, Havoc, Marmalade, something like that. And then we got WinJS if you like HTML and JavaScript. Great way of creating native apps as well and then we've got our two flavors of XAML. Windows Runtime XAML and Windows Phone Silverlight XAML. Alright, that's enough words. I'm going to now build you an app using the Windows Phone 8.1 SDK. I'm going to build a simple universal app. Like I said, I'm going to dig much deeper into this afternoon. So here we are in Visual Studio 2013. The tools by the way are free for download. You can download a new Visual Studio 2013 Express edition for Windows and that brings you all the tools you need for developing for Windows Phone 8.1 and for Windows Store 8.1. Or if you've got a ultimate or professional edition of Visual Studio already installed, this just comes with Update 2. So Update 2 has all this stuff in it. So the question is if you develop for 8.1, can your app be backwards compatible to run on 8 for example? No, that's not. If you go for 8.1, I mean the store will allow you to ship to distribute an 8.0 version of your app and an 8.1 and the end user will get the appropriate version installed onto their device. But in Visual Studio 2013, you can create 8.0 apps and later upgrade them to 8.1 or you can create 8.1 apps right from the get go. Okay, I'm going to create a new project. We've got this now, I prefer working C-sharp. We've got this category called Store Apps which is divided up into Phone Apps, Windows Apps and Universal Apps. So there's new project templates that allow you to easily create one that runs on both. So let's create ourselves. Let's go off to C-shows, NDC 2014 and I'm going to call this. It's a little app that's going to go off to Flickr and pull down some, do a search and it's going to pull down some pictures. So it's called Unsurprisingly Flickr Search and this is going to create a solution that has got, well, it's got, we've got over here, we've got the solution has got a Windows project in it which has got assets and main page and it's also got a Windows Phone project, Windows Phone 8.1 project in it which has also got assets and main page in it and then it's got this thing called Shared Folder. It's a shared project. It's not really a shared, it's not really a project actually. What this is, everything that ends up in this shared project actually gets distributed, is duplicated to both of the heads. So you've got a Windows head and a Windows Phone head and then we've got all the common stuff which is actually most of it at the moment because we've not added any functionality. There's not a huge amount in shared but particularly by the time we get to this afternoon's example, just loads of stuff can go into shared. So that's the kind of project structure. Now I'm going to just add a couple of files I've got, got ready already. So I've got a couple of you, a couple of class files, classes here. I'm going to drop them into the shared and while we're at it, I'm going to drag and drop assets and drop that into shared. So assets has just got some, I think it's just, yeah, it's just got some standard images which you can just use for design time to make it look nice when we're in design time. So that's some images. You can have images, you can have code, you can have data files, whatever can go into this shared folder. And then while we're at it, let's just get everything else as well. So I've got loads of tile stuff to replace the stock ones. So let's just drag and drop them into there. We're going to replace the standard ones. So that gives us lots of nice, you know, nice artwork and that sort of stuff. We'll do the same for the Windows one. And then we're pretty much ready to go. Drop that into there as well. Yeah, so this, like I said, is all the, you know, all the artwork. So we can go into our manifest and we can see the visual assets. You know, so this one, we can go off and pick the appropriate image. What was the wide? There we go. And you know, there's a splash screen image as well, which is just a, you just get the square. So let's just make the background of that all white as well. So we should have a nice splash screen. And that's the artwork. Now, what about these, what is in here? This is just a utility class which goes off to Flickr. What it does is here we got a method called a static method called search async. And it uses HTTP client to make a call off to Flickr. And we will parse the XML that Flickr sends back. And we will spit out, project that out to a collection of Flickr photo result objects, which we will then use to show the results in our UI. And I've got, so I've got the, this is the Flickr photo result which represents a single image coming back from the data for an image coming back from Flickr. And I've also got one called Flickr photo results, which is a collection of those things. So that's kind of the guts of this thing. Now I'm going to start building out the UI for this now. I'll start with the Windows one. And just blown up the designer, there we go. I want to put a couple of, this is my main grid. Let's put a couple of rows on our grid. That'll be about, that's the first one and a little bit of a spacer one. Let's change that to pixel sized and 100 pixels high. And this one, I also want to be pixel sized and we'll make that about 40 pixels high. So there's a basic layout. I'm now going to pull in a little bit of Zaml that I have ready, which is this guy. So now all that I've done now is put a text block, which is my title Flickr. And we've got a grid view here in this area, which is going to show all of the results. With a grid view, you need to give it a data template, which says, okay, for each item that you display in this grid, what, come on, what, how will it look? It's not behaving. Come on. Try that again. Okay, so there's my data template. So this defines the layout for each item. We're going to have a grid with a border inside the board. We've got an image and then I've got a stack panel, which overlies it, which has just got some text over it. Which, I mean, I can tell you that, but actually that's all very well. But let's actually put in some design time data so we can actually see the, see this in at design time what it might look like. Oh, what's happened there? That's not good. Oh, how did I get across there? All right, let's try that again. Okay, that's succeeded now. So I'm going to go and just go and switch over to blend because that's the easiest way of working with design time data. Here's blend. So it'll load up my page and then what I'm going to do is design, I'm going to get it to auto generate me some design time data from a class that I've already got in, in fact, from that Flickr photo results class. So I'm going to get it to spit out some XML. I need to edit the values because it just comes up with loads of Latin, which is, you know, all right, apart from this image URL, because what I want that to be is assets slash light gray dot PNG. I think that's right. Yeah. So, and then it's spat out loads of this. So I just need to just bear with me while I do this. It's a bit tedious for you guys just a minute. There's about 10 of these items it's spat out. So nearly there. Couple more. Cool. And now save those changes. I can set my design time data context to that XAML that's just spat out and who great. Now we've got we can actually see a design time what it looks like. So this is the Windows app. Let's close this save all those changes reloading Visual Studio and now we should be able to see this app actually working. If everything is good, there's splash screen comes up and we have, oh, hang on, I forgot to put some logic in this. That's not going to help. That's a nice UI, but no logic as yet. So go off to my main page dot XAML dot CS and we need to add some, some logic into here, which is in a nice snippet. This is going off to, we're seeing on navigated to we actually go off and search Flickr for flowers. This is the method to search it. It's going to set the data context back to the results when we get it back. And then I've got some other stuff that I'm going to go on to in a minute, which is all about tiles and setting a tile template, which is XAML. And then we should be good. And then we, and also some toasts and that sort of stuff. So, yeah, now, we should hopefully get something back. This is always a slightly nervous moment for me. There we go. Now, flowers was a carefully selected thing. You know what it's like with live demos, you know, if you choose the wrong search term, you could get undesirable results back. I did get one a few weeks ago where the interpretation of a flower was, well, yeah, disappointing. There we go. So that's the, that's the windows one. So we're in good shape now. Okay, let's, let's, let's build ourselves a Windows phone version of this, sharing as much as possible. So I've got my assets. That's all good. Now, what about my, this main page? So here's my, here's my phone UI. And the moment's an empty grid. Now, I said the XAML is exactly the same. So you can share XAML, but in this case, I'm just going to copy it. I don't know why it's complaining about the designers gone crazy that what's going on? It was just running. Why are you complaining now? All right. Okay. Strange. All right. So here's my, this is my grid. Actually, I'm just going to copy the entire contents from the Windows one. And let's paste it into here. Okay. And I also want to visualize this. I mean, okay, that's kind of worked. I haven't got any, any things. I'm going to copy the sample data. Sample data, unfortunately, can't go into the shared folder. It has to be, it's something the design time experience likes it to be actually in the head. Let's build. And then I also want to go and do kind of what I did before and fix up the layout a bit. So let's go off to build for, go off to blend for the phone one as well. I've already got the design time data that I generated before and I just copied it. So all I need to do is, is wire it up, which I can do like that. And now we're seeing what it's going to look like in the phone as well. Now, this is all very well, but let's make this a bit smaller. Let's make this, I don't know, 80. And this one we can make to be 10. So we're getting a better sort of layout. The grid, what have we got? We've got a couple, we've got, I want to set that left margin and set that left margin of that to 10 and the right margin to 10. So we're doing a bit of layout stuff here. I didn't mean that. Yeah, and the grid view. So I'm going to edit the layout template. And we've got our, we've got our grid. I'm just going to make that auto width, auto and height and and set a bottom margin of 10. This isn't quite working out how I expected. What's going on here? I must have messed up. Oh yeah, I still got 120 on that, on this grid view. Set that to zero. Okay, now we're getting sort of like a layout that's a bit more appropriate for the phone. Let's just drag that over there and stick that over there as well. So now that's looking better for a phone layout. Can save that. Reloading Visual Studio. That will catch up in a minute. And then we can change the target that we're going to actually go and run. So this Windows phone and we'll run it on the emulator. So it's going to boot up my phone emulator. And we should get the same sort of app basically working on both devices. Ah, I haven't put any logic in. I did the same mistake over and over again. So I've done the UI. Yeah, brilliant. And then you're not going to see anything. So there's no logic on the back of this page at the moment. It's, here it is. It's completely, there's an on navigated to which we can get rid of actually. So I could just simply put my snippet in again the same logic I had in the phone up, but I don't like that because that's duplicating code. I really don't like that at all. So actually what I'm going to do is go and go and copy that class. I'm going to go down to my shared folder, add a new class, new item. And it's going to be a class and it's going to be called main page dot CS. And I'm going to just paste all of the code behind into there. Now, this is kind of interesting. Apart from I'm going to leave the constructor out because this is the key thing here. This is a partial class, which means it allows you to distribute the definition of a class across multiple different physical files. So I'm going to have all the common stuff in this partial class that's in the shared in the, and that will all get merged into this one in the phone. And this one now, I need to remove all this because otherwise it will end up being all duplicated. So now that's my Windows one. That's my main page, but it will get, when it's compiled, it will add in all of this stuff as well. Same for the phone one. We'll add in all of that shared stuff as well. So now the phone one should work. Now, I'm also going to do one other thing as well, which is to, before I run it, go into the app manifest and I'm going to make it toast capable because the other thing that code does in the main page is when it gets some results back, it updates the tile with the first five pictures and it also sends a toast. So what I'm going to do is, not that, is go off and find my Flickr searcher and pin it to the start screen. So we've got a tile. There we go. Let's just make it a big tile. Right. That's a nice tile. And then we will run the app. And we should, we've got all that shared logic and there's our pictures. So we've got a nice little pictures. So that's all working great. And in a minute, with the gods of this, we should have a toast pop up. Yay. And that's just the first text, the first message for that first one. And this tile at the bottom has been updated with the first five images. So we've got a nice tile updates as well. The point is, of course, that it's exactly the same code as up in the Windows once. I'm just going to turn my notifications back on in here and run this guy as well. Debug, start new instance. And this would do the same thing. We've got our images up and we should get a toast pop up in a minute for that guy as well. We don't even have to wait for it to close it and the toast should pop up. Should do. Did I turn notifications back on? Yeah, I did. Oh, I know I did. I forgot to say toast capable in here. There we go. Yes. Okay. Set a startup. Run it. And this one would update the tile as well. I've not bothered pinning the tile, but there's our image. And in just a few seconds, we should also get the toast pop up as well. And it's exactly the same code, same template, same everything. We will get a toast in a minute. Oh, well, whatever. It should do. Maybe I have to stop it and restart it. I'm not going to waste any more time on that. So I hope that gave you a flavor for the commonality between the two. Let's dig a bit more deeper into what we've actually got with phone 8.1. So first of all, this app model convergence. So, you know, I've already talked about this. The key investments were about making apps work really well across devices. And we wanted also to make it much better to run really well on low memory devices. So Windows Phone has been, you know, it's been a struggle. We're starting to gain a bit of market share. But actually, all the phones that are selling, frankly, are the cheaper ones. It's the low end devices, 512 megs. Now, fortunately, our OS works very well on 512 meg devices. It works even better on one gig and then two gig devices, but it works pretty well on 512 megs. But we've done a lot of efforts in this release to make that even better. So your apps, I mean, for you as developers, that's good because you're not going to get any of those crazy comments from people saying how slow your app is. Because quite often that's not your fault. It may be that the phone is just rubbish, you know? But now on low end devices, you're going to get a good performance. We really enhanced the multitasking, the packaging deployment is the same, backup and roaming, and the application data sharing are all good things that are going to come to us developers. And there's also, from the end user's point of view, we've got this action center. So you can now swipe down from the top and user can get notifications and get to quick settings. That's programmable. So you can actually put stuff into that and update notifications. And we've got shared push notifications, resource packages. So there's a packaging way to make sure that the stuff that gets downloaded to the phone is smaller. And then we're roaming data across phone and tablet. I'm going to talk about each of these in a bit more detail. So yeah, we went to Sphone 8. We ran pretty well on 512 meg devices. But we really ran great on 1 gig and above. And these 15, 20s, these massive super phones, they've got 2 gigs of memory in them. But, you know, we did a lot of work to make sure that the user experience was consistent across them. And the stuff worked, albeit a bit slower on the cheaper devices. So it was okay. But we did a lot of effort in phone 8.1 to actually make the experience much better for owners who had the low memory devices. So one of the key things we did here was that in Windows Phone 8, we had this idea of a memory cap. So you had that amount, certain amount of memory your app was allowed to use. And that was fixed at 150 megs for a 512 meg device. And if your app used more of that, went over that, the OS would just kill it. No questions asked. You're dead. You're out. So, and that all worked okay. But actually we found that it could be overly conservative. Because when we looked at all the analytics, the data that comes back about what apps actually are that are running on our devices, we actually found that 94% of apps run in less than 150 megs. So that small 6% wouldn't run on the 512s at all, but would only run on the bigger devices. But the real interesting stats is when you go down is that actually 70% of apps only need 60 megs of RAM to run in. Now, the problem here is that because we were having a fixed slot, a memory slot for you to run in of 150 megs, if you only use 60 megs, that's fine. You would run and you'd have all this lovely space, but all the rest of that memory was essentially wasted. And when a user switches from one app, an active app on a phone to another one, what happens is the current, the one that they're switching from gets suspended and the OS will try and take a memory snapshot of that and keep it in memory so that then the user can start up their next app and start running with that. And then if they finish with that app and then go back to the one they were on before, you get a fast resume and it just gets loaded back in from cache and you know, it really fast and quick and get off, we get going again. Now, the problem with 512 meg devices is if you've got 150 meg memory slot, there isn't room left to cache 150 megs. So it effectively meant that whenever an app got suspended, it actually got tombstone, which is this kind of, you know, deep sleep state we put them into. It's still resumable, but the work to resume it is much more and you see this resuming dot, dot, dot across the screen and there's a noticeable pause and then finally the app comes up. It's not a terrible user experience, but we can do better. So it effectively meant that all these apps were getting tombstone when in actual fact, if we were just able to take a memory snapshot of the 60 megs they actually were using rather than this kind of over cons, the conservative 150 megs, then we could give a user experience and that's exactly what we've done. So now the system, the phone OS monitors how much your memory your app is using over time. So very first time a user runs the app, they'll get given the 150, but actually when you run it, the system will say, okay, last couple of times this user has run this, it's actually only used 60 megs. So the next time it runs, they get given 60 megs with a little bit of a buffer to account for something that unique that hadn't happened before. And then, of course, when they get suspended, you just suspend whatever memory has been used rather than the whole 150 meg fixed slot. So this means that with the low end phones, the chances of your app being resumed rather than coming back from tombstone are much greater, much improved. So you'll get a much better user experience and the users will see apps resumed faster and will love the phone more and love your app more. So the result of this on one gig and above, just about every app will be resumed from suspended state rather than from tombstone. 512 megs, this will still be for heavy users, there will still be some tombstone, but the most recent ones more likely will be resumed from in memory suspension, which is going to give a much better user experience. What about the way we can run code on the device? So I'm going to talk about multitasking. And the goals here was, first of all, if you've written a Windows Phone 8 application and used the background tasks options that we have on there, which is we have two flavors, we have the periodic tasks that the OS will run your app for like 25 seconds every 30 minutes or so. And then we had resource intensive tasks where if you're plugged in on charge, then the OS will allow your app to run for, I think it's 10 minutes or 20 minutes, a long time anyway, and do some real heavy duty stuff. So that's compatibility has been retained. So those kind of flavors of background tasks still work. But what we've done is we've brought the Windows runtime background tasks system down to the phone, which means that you've got the same rich ways of running code in the background that you've got on Windows, and it massively expands the interesting stuff you can do on phone. So before we get on to the background tasking, first of all, I'd already talked about the memory cap and about the way that we're enabling apps to be resumed more quickly. But the other thing we've done is that we were under the impression in Microsoft that users kind of understood this idea that they launched an app, and then they go through some pages, and then when they come back to the home screen, if they hit back on the home screen of the app, it would close the app. And the next time they ran the app, it would launch a whole new copy up from scratch. And we also thought that if you go to the programs menu, people were always expecting somebody to launch a new copy of the app, and it wouldn't take them back to where they were necessary. You'd always start at the launch page, and we'd kind of say, well, you know, it's a consistent user experience. People understand it. It's the phone way of doing things. Anyway, it turns out people didn't understand that at all. That was kind of a convenient trick we were playing on ourselves because that's the way it worked. So anyway, it's changed. So now, when you exit an app, however you exit an app on Windows Phone 8.1, so you hit the back button on the home screen of an app, the app doesn't close. It will be suspended. So it will be suspended. And the next time you run the app, the user runs the app, whether it's by going to the task switcher or whether it's by going to the programs menu, the suspended one will be resumed, which gives a much better user experience, gives you a tiny little bit more work to do as a developer because you have to kind of think, OK, do I want to put this user back in exactly the same page they were on before, or do I want to give them a starter fresh from new kind of experience? And that's kind of basically, that's up to you. That's domain specific as to what kind of experience you want to give to your user. It depends on what the app does. Facebook, for example, will always resume back where you were because it's a kind of a continuing rich experience. Other apps, it wouldn't make sense to launch into page XYZ. Instead, you want to always start at the home screen. So that's something that's for you to make a decision on. We have this app switcher. Yes. Thank you. So the question was, if you have way too many suspended apps, can it slow the device down or do you have to actually switch them off? That's absolutely perfect because this picture I've just put up on the slide here is our task switcher, which actually came out in GDR3, update three of Windows Phone 8.0. Because we have, I have this kind of conversations all the time. And particularly in the Android world, people love to be able to kill apps. Now, me as Microsoft, and I know how the phone works, I say, actually, no, do you know what? It doesn't matter how many suspended apps you have because when they're suspended, they're not using any resources. But people say, particularly Android users, but I want to kill the app. I know, I don't, basically, I don't believe you. I don't believe you. I want to kill apps because I think there's stuff going on. I think, you know, you can say all that stuff, but there's stuff going on. No, there isn't. But if you want to kill apps, cool, you can kill apps. They'll give you the opportunity. So now we've got this nice in the task switcher. You've got this X. You can tap on it and it will close the app. But to answer your question, no, you could have loads of suspended apps. Because once it fills up the bit of memory that it's put aside for caching, keeping an in-memory snapshot for fast resume, then we're back into our old fashioned, if you like, tombstone, which is just we store a signature of where the app was and it gets stored into persistent storage. And we can still resume from that and get back to where they were. It's a little bit more work that needs to be done. But yeah, so we've got the task switcher and you can kill apps if that's what you want to do. It doesn't make any difference. So we've got all these background triggers now. So like I said, we had periodic background tasks and resource intensive background tasks. And they're fine, good enough up to a point, but not flexible enough. So now we've got the Windows 8.1 background task execution system on the phone, which means there's a whole load of different triggers. So there's one, there's triggers that fire when the lock screen, you know, when the image comes up on the lock screen and when the phone gets booted, there's one that there's a trigger which is interesting called a servicing trigger. So one thing that with apps now is that they silently update. So the user doesn't have to go to the store tile and actually say, yeah, you see, oh, you know, we've got three apps needing updating and they have to actually go and say, yes, update them. That happens in the background. But the servicing trigger, when an app has been updated, your code could register for a servicing trigger and it allows you to run a bit of code in the background after the update has been installed, which would allow you to upgrade data that's been stored on the device or something like that or make some changes that you might need in order to support the updated version. So that's one of them. Push notification trigger, I'm going to talk is really cool. So I'll talk about that in just a moment. Geofencing. So we got all these nice geofencing triggers. So when the app moves through a particular geographic location, you can fire up a background task and do some stuff to notify the user that something of interest to them is nearby. BLE. That's Bluetooth LE, Bluetooth low energy. So this is Internet of Things stuff, smart devices. You can actually run a background task when a device gets connected or disconnected or when the device itself has changed its status and wants to send a message to whoever is interested. So you can actually have apps that are interacting with heart rate monitors or luggage tags or access control things or plant pot humidity detectors or whatever. This is a massively expanding area. You can also do boring stuff like simply run background task on a schedule and you can do stuff with sensors. Question there? Good question. So is the Bluetooth LE stuff working in old hardware? It will. It doesn't right now. So actually it does. If you've got an HTC Atex, it works. Are those things like Goldus now? Because they're actually pretty much the only ones it's working on right now. The problem is, or the thing is that with the Nokia Black updates that they shipped at the end of last year, they did enable Bluetooth LE at the low level and they had their own APIs and they enabled things like the Adidas MyCoach thing to work with a monitor. But it was kind of almost a proprietary solution. It only worked on Nokia. So now we've got the capability built into the OS. But until the Nokia AMBA update comes out, the Bluetooth LE stuff is blocked from working on Nokia phones. So the Bluetooth AMBA, it will be out very soon. It will be the one that comes with the 8.1 update. So all Nokia phones that get the regular update will remove this proprietary if you Bluetooth LE stuff and it will be enabled across all of the Bluetooth LE devices. Actually on a related kind of note as well, the OS 8.1 does work on all existing hardware. Whether it's available for you is up to your network operator. So we can't promise and say everybody's going to get it. So unfortunately that does depend on your mobile network operator as to when they ship it to you. But like I said, if you join the preview for your developers, you can bypass them anyway. The other thing about hardware, everything will work. There are some new APIs around NFC. So we've got some new stuff for doing real low level stuff with NFC. So we'll be able to use it for doing transit passes and all this kind of good stuff. That will require a new chipset which is going to come in new phones. So that is pretty much the only feature that I know of that is going to be not usable on the existing hardware. So some stuff around that. Yes, this push channel notification trigger is really cool. So here's the thing. So we've always had these push notifications. You can send from the cloud to a device and you can put a toast up. You could update a tile and a lot of developers have used this for reaching out to users and it's cool. It's this live tile's idea and it's really great. And there was a third kind of notification which was this raw notification. And a raw notification is basically app specific. It's just you send a block of bytes, some XML usually, to the phone. And in Windows Phone 8 and earlier, if the app was actually running at the time the notification arrived, they would get it in an event and they could process it. But that's it. So from a back end service point of view, like, well, what's the use of that? So frankly, I've never found a use for it. But now we do because push notification trigger is fantastic. So now if you send a raw trigger from your back end and you've registered for a push notification trigger, when the notification comes to the phone, the background task fires up and you can process the data that's in the raw notification trigger. Now, why is this exciting? Well, here's the scenario, you see. Maybe you've got a sports app and you want to have, you know, notifications to the user. They're particularly interested in goals that are scored at the World Cup. Yeah? So now, the old way of doing this was, yes, you could send a toast and say England are losing 4-0 or something. Never happened. And then the toast will come up and then the user's really interested and they tap on the toast. The sports app opens up. But then they've got this thing where they have to sit and look at the stale old news while it just says, wait, updating and it goes off to the cloud and then it gets the information and finally gives you the information you're interested in. But now what you can do with the raw notification, you don't, the user doesn't get any visible anything. There's no toast associated with this with the raw notification. But your background task could go off to the server, update the stored data for the app because it's a part of the app, you know, can already go and get the news, the pictures, the information about this event, then pop up a toast to notify the user. The user taps on the toast, the app opens and it's already up to date. Much better user experience. So that's really exciting. Geofence is cool as well. So this is brand new as well. Your app can register. It says they're up to 1000 geofences. Actually 1000 geofences is the kind of practical limit. The actual real true limit is something like 20,000. But we wouldn't recommend that because it will start to run a bit slow. But yeah, we got, so you create these circular geofences and your app can register up to 1000 of these. And it's just a geocordinate, a latitude and longitude and a radius. And you can register for different kinds of triggers. So when the user enters the geofence or when they leave the geofence, you can have some background code can run. And these work also not only with background tasks, but also with your foreground app. If you've got a foreground app, it can get events when the user travels through a particular geofence. And I've got a nice little demo I can show you with this. Okay. So this was actually built by a Dutch MVP, Jost van Schijk. And he's built this little app, which it's simple enough. It's actually a portable app. It's a universal app. So it works on Windows and Windows Phone. I'm just going to show you the Windows Phone one. So there is, so you have this geofence monitor and you can clear all your geofences. You can set the center of your map in your zoom level. And then what we're going to do is we're going to call this map location finder API to basically get locations. That's a kind of a geo conversion API. And then there's this map route finder. You can get a driving route from one point to another. And then what you can do is we actually draw the route onto the map with map polylines. There's a really nice little sample. And we can draw map icons on and geofences as well. We're actually going to in this app show you where the geofences are. Normally they wouldn't be visible on app. And then we get, when the position changes, we will move along the apps along this map. So let's show you what that looks like. So here's the basic app. The location is set to be somewhere in the Netherlands. And we've got in the emulator, got these tools. So we can do cool stuff with the tools and load in a list of lat longs representing a route, which is here. And that's now going off to Amersvoort in the Netherlands. And you can see the route that we're going to go to. So I'm going to show the route on the map. Here's the route that we're going to do. Let's just zoom out. And I'm going to start the location simulator in the tools. So I'm going to play all these points using, you can change the speed to speed limit, walking, biking, or super fast. I'm going to just go as if we're driving around streets using, observing the speed limit. And you can change the accuracy profile. Say, are we going to have exactly pinpoint accuracy, or are we going to pretend to be urban? So it simulates how, as you were connecting through different towers, it knows where towers are on Wi-Fi points. So very clever stuff. They've invested a huge amount into this. Let's start it playing and we're going to track the location. So as we move along, the map is going to track along and we'll show us, we will track along where we're going. I'm also going to show the geofences. So what happens is when we travel in, you should be a car up. Why is my car not showing? Then when we get to a geofence, the task, the event fire says, you are entered a geofence. So then it will give you turn-by-turn directions as well. There should be a nice little red car which always comes up. It hasn't come up for some reason on this. I bet that's because I zoomed in. Yeah. Anyway, you can see how it's tracking along, tracking along, matching the position that we've got in this simulator. So this is real nice. You can do a geocaching map search from the comfort of your workstation, not have to sit around in the car and drive around with a laptop and a phone and all this kind of stuff. Yeah. So really rich stuff. This is a foreground app, but like I said, works great in the background. So you can have things where the user gets off a plane. You've got geofences set up. You can set up all the different airports in your area. So as soon as you get off a plane, the geofence, you'll get a trigger that you've passed through a geofence for an airport. Your background task could then load in loads of geofences that are appropriate to that particular airport location, and then you can give real good directions to facilities that are nearby. Oh, the car's turned up at last. There you go. There's my car. So it's all cool stuff. Okay. Yeah, we've got one nice of push service. One Windows notification services is unified across the both. WNS is much faster than the old MPNS and much more reliable. And MPNS used to work all right in the United States and frankly sucked everywhere else. So now WNS is good and it's worldwide and it's really cool. And even your Windows Phone 8.0 apps running on a Windows Phone 8.1 device under the covers, the notifications are happening over WNS without you having to upgrade or do anything. So you've coded up an app using the old push notifications, and it will just work and it actually will get all the benefits of the improved performance of WNS. It's more battery efficient. Toast updates, I kind of showed you a demo of this. Common format over both, but what you have on the phone is you won't have the same rich visualization of it. So it kind of adapts what it shows that is appropriate for the platform where it's working. This action center, we've got this list of stuff that you can, you know, the list of notifications. The key thing here is that apps can also update or remove notifications from this list if they're related to your app. And you can also do this thing called a silent toast. So you can put stuff into that list but not actually interrupt them with a toast pop-up. So it's good for putting important information into the list that they can look at when they drag down the action center. The live tiles is common as well. Same mechanism, same templates across Windows and Windows Phone. And this app packaging and deployment, now we've got the same Apex format. But what's cute about this is if you have multi-lingual apps, so you've created resources with different translations, or you've shipped in resources for different resolutions of phones, so you've got high def resources and lower def, the scale to 40 scale 100 stuff. When the user installs the app, the packaging system gives you this for free. So when the user installs your app, they get just the resources that are appropriate for the language of their phone and for the resolution of their phone. So they don't have to ship the whole shooting match, they get just the bit that's important to them. And updates are just, you only get the bit that's updated as well. So huge improvements to the user, faster installs and very data efficient. Users can install apps onto an SD card now and they can move apps between the main memory and the SD card. Any apps that's stored on the SD card, the local folder is all encrypted, so it's a safe, you don't have to worry about security. Apps are enabled for storing on there by default, but if you really have a strong objection to that, you as the developer can check something in the app manifest to say, no, I don't want this app to be installed on an SD card. But we expect most people would want that to happen. This is really cute, so the app data roaming, so there's a couple of things from the user perspective that's in 8.1. First of all, the start screen layout is backed up for the user, which means that if you get a new phone and you choose to install the backup from your previous phone, in the past you get all your apps, but you wouldn't get the same start screen. So you lovingly created this beautiful start screen and you don't quite get the same thing back. So now you do. So we're backing up the start screen, but the other thing is that the local folder stuff gets backed up to OneDrive every night as well. So all the local files in the local folder will be backed up to OneDrive. So again, your users have got that kind of backup, automatically built into the system. But the most exciting one is the one at the top there, app data roaming. So if you've got an app that you've registered in the store for a particular app name and it's a Windows Store app, and then you register at the Windows phone version of the app and use the same stored name, they are tied together. They have this thing called a shared PFM, which stands for package family name, but it basically means they've got the same reserved name. Once that happens, if you store stuff into the roaming folder, it will automatically be roamed through to the other devices. So this is great because it allows your user to do something on the phone and then later pick up the tablet. And most recently, the most recently used searches or the most recently used data or whatever is there. So they can pick up a task on a different device that they started on an alternative one. So this is really, really nice feature and it's very, very easy to take advantage of. Enterprise deployment, no real changes here. So enterprises can distribute their own apps without going through the Windows Store. You can do that using device management packages, in-tune from Microsoft or mobile iron or any of these other ones, or just through a SharePoint site or even by email or an SD card. So there's a security system behind all this because when you sign up as an enterprise publisher, you get your own signing certificate. So you sign your stuff with that and that guarantees that it can't be tampered with. And then you register your phones to accept that token. So that's obviously still there. Oh yeah, I already talked about the application data sharing. Oh no, this is actually application data sharing, which is the user driven data sharing between apps. This is the Share contract. And actually I'm going to show you a demo for this because I'm running out of time, which will tell the tale better. So the Share contract. So first of all, I'm going to open a Silverlight app, which is our old friend the Contoso cookbook. I'm sure a few of you have come across this before. And this application, I'm going to run it on the phone 8.1.1, is a simple little recipe thing. And what it does is it allows you to select a recipe. You can go off and find a recipe. You can get the ingredients and you can actually take a picture of it. And that's all great. Now, I want to, you can upgrade this. This is a phone 8.1 project. I can really easily upgrade it to 8.1 by going to this. This is Silverlight 8.1. And we've got an 8.1. Now, I'm going to just, that's the upgrade. How's that? But I'm going to open the completed solution because we haven't got time. I would normally take you through this. But once you've upgraded to 8.1, you've got access to the complete Windows runtime API and all the new cool stuff, including the Share contract and everything else. So now what I can do is in my recipe detail page, I can add a new button to the... Just build it. Add a new button to the... Oh, God. Hang on. I just need to get the packages. Phone toolkit got lost. Install. There we go. Now we should be good. So this now is... Here we go. I've added a new app bar button to this. Right. There we go. Which is a new one which is... Which is to Share. This is not working, sorry. Right. Apologize. That's something that's going to arrive here. So the point why I was trying to show there is that it's very easy to create a Windows runtime API, to call Windows runtime APIs, including the Share one. And I'll try one... I'll just give one more shot on this as if I got the version that from the jump start, which should be good. Try this. Yeah. Okay. So this one should be all right. Once I fix that again. And this is an example of how you can add real rich contents to an application. So now I go to German. I can go and pick a recipe. I can say leg of lamb. And I've created this beautiful leg of lamb so I can take a picture of it. And you have to use your imagination. This is a leg of lamb. Isn't that fantastic? Yeah. There we go. Accept our picture. And then I can share it. This is now calling out to the Share contract. So now we're in the UI of the phone. And it's giving you all the apps and locations where you can share to. I could share that to OneNote, for example. You couldn't do that in a phone application. Actually, the code to do that is very, very simple. So there's my picture and a little bit of stuff that's come from the Contoso cookbook app. And this was the code to do this is basically this in order to do that sharing thing. So it's very rich and very easy to add really exciting new functionality to your application. Right. So that was a quick run through of the phone 8.1 platform. Give you an idea of all the great new stuff that's in it. Loads of emphasis on running really well on 512 make devices. Rate new ways of running code in the background. Good stuff about app data roaming and about the deployment and the app data sharing and the convergence around WNS and Action Center. So thanks very much for watching this. I'd be very happy to have as many of you as possible back again after lunch. But thanks very much and enjoy your lunch.
 Alright, good. Right, welcome. Thanks very much for coming along to this talk. I'm Andy  Wigley. I work out of the UK. I'm a technical evangelist. I do a lot of work with the Windows  Phone team. I'm most well known for the Jumpstart videos. We've got a whole new set out that  we recorded last month. So the building out to Windows Phone 8.1 Jumpstart out on that  short URIs out on Channel 9. There's also a Microsoft Virtual Academy course version  of it if you prefer to do your learning in a more structured way. In case you're interested,  that's what the studio looks like. That's in Redmond Town Centre. So there's me and  Matthias Shapiro behind the desks there. And then you've got all this kind of high-tech  stuff at the background, a guy on the right answering questions and a guy at the back  doing all the mixing and then cutting between. We've got three cameras, one on the centre  and both of us and then one for each of the speakers. It's a lot of fun, but well, intense  session, as it says in the comments there, it certainly were intense. It's like two and  a half days live to camera. So I'm still kind of recovering after all that. It's good fun.  Load to content. Now, what this session is about is about the new Windows Phone 8.1 platform.  It's about the underlying principles of how it works, why it does, and what it is we've  given you. So it's pretty high level. After lunch, I hope some of you will be able to  come back and do a real deep dive into building universal apps with kind of real techniques  and these are the problems, this works and this is how you should organise your code  and make the most of it. So I'm going to do a quick demo of that in this. So those of  you who don't want to come back after lunch, you'll get a flavour for universal apps. Because  the big goal of Windows Phone 8.1 was this, well, enabling great apps. We want to kind  of catch up with the opposition and also and exceed them in good many places as well. So  there's a whole pack of new APIs to help you build great apps for Windows Phone 8.1. But  yeah, the big deal is this platform convergence. This is about bringing Windows 8.1 and Windows  Phone 8.1 together so we can now very easily create apps that will run on both platforms.  And improving all the capabilities. So we're fixing the little missing bits from the previous  release and hopefully give you all that you need to create great apps. So yeah, it was  this one Windows, this is this one Microsoft thing in action, delivering the shared developer  platform which she shared from top to bottom. So we've now got Windows XAML, same XAML  on both. So in Windows Phone 8, we had XAML and obviously Windows 8.1 store, we've got  XAML. They're actually kind of different XAML. They're very close. The tags are all  the same and the elements do the same and this kind of thing and you work on data templates.  So the techniques are the same. But there were different namespaces, slightly different  capabilities. It did mean that if you were trying to do, has anybody tried to build a  sort of what we'd now call a universal app for Windows Phone 8 and Windows 8.1? Anybody  here tried that? Nobody has. Okay, well, it's good because it's kind of painful. You can  do it, but you kind of have to have everything very well organized and the XAML flavors,  like I said, were kind of the same but different enough just to be annoying. So if you're copying  XAML from one to the other, it was kind of hard. But we've now got unified XAML. We've  got the Windows runtime runs right across both of these platforms now. It's all the  same thing. The app model, by that I mean the way the apps behave, the way they get  launched and activated and the memory management and the suspend and resume kind of stuff,  that's all the same. Live tiles and the notification system, all the same. The distribution format,  the way you package up your apps is now the same and we've got the converged controls  and performance. So the Windows XAML actually is much more performant than the old Windows  phone SilverLines XAML. And accompanying that, not only the dev platform bits but the app  services as well, all the other bits and pieces that you need to make a successful mobile  app today. First of all, starting with the developer store registration. You sign up  now to be a Windows phone developer. You are a Windows store app developer as well. You  don't have to pay or register twice over. There's still two portals. We've still got  some work to do to really bring it all to one location on the web. But that's the developer  registration is the same. WNS is the push notifications infrastructure. That's unified  now and is used for all Windows phone 8.1 and Windows 8.1 devices. And we've got cute  stuff like data roaming and backup. I'll leave that and talk about that. I've got to slide  a bit more on that further on because that's a really nice feature that helps you to create  nice unified experiences that flow across devices. We've also got the shared app identities  and entitlement. What that means is that as a user developer could ship a Windows phone  version of your app and a Windows store version of your app. And if you choose to allow the  user to have the shared entitlement, it means they buy the app on one platform. They automatically  get usage rights on the other as well. So they pay for it once and they can install it across  all their devices. And that's enabled by this thing called shared app identities, which  is a fancy name for basically means they have the same name when you reserve the name in  the store. And this convergence is not something we just kind of thought up yesterday. It's  actually been going on for quite a while. It started back with Windows phone 7.5. Actually,  those of us with longer memories than that would argue it actually started with Windows  mobile 6 because go back to Windows mobile 6 and we actually had Internet Explorer browser  on Windows mobile and on Windows 7 or whatever it was at that time was the same code set  code base. So they were already the Internet Explorer team were already working from one  code base and producing browsers for the different platforms. But that was revisited again. And  that's certainly with what we code named mango at the time, Windows phone 7.5. That was the  key thing around IE 9 was the same on both platforms. When we got to Windows phone 8,  it wasn't so much shift from a developer point of view. But really what we did was we sorted  out the foundations and we fixed the underlying structure that if the whole phone and the  tablets all run on top of what you've got, you get with Windows phone 8 is the Windows  NT kernel. Now what we should we threw out the old operating system winds phone 7 we  brought in the Windows NT kernel, the same OS kernel at a low level, not top to bottom  OS is a complicated thing with loads of bits in it. But the kernel and a lot of the modules  like networking and file system all that sort of thing, it's all the same. So we were kind  of already unifying the operating systems with Windows phone 8. And we started the work  of converging the developer APIs and that was most obvious for gamers. So DirectX, Direct3D  gamers, it was pretty easy to port an app from Windows to Windows phone and vice versa.  For XAML based developers, there were some bits and pieces that we brought in that were  converged a few little bits in that purchase was the same sensors were the same there was  a subset of the Windows dot storage for working with files and folders was the same. But not  really very much across the board. So then we get to Windows phone 8.1 which is the first  phones are now starting to be sold out into the marketplace which have got 8.1 on them.  And we released it at we released the dev platform at build which was six weeks, eight  weeks ago. Seems like an age but time. These things move so fast. And you can get a phone  8.1 on your phone now. Has anybody put 8.1 onto their phone? Good number of you. Yeah.  So if you haven't you can get it today if you want it on if you've got a Windows phone  8 device because all Windows phone 8 devices can run phone 8.1 OS. But there's a special  app called the preview for developers. If you install that app and then you need to have  a developer account. So you can either register on dev.windowsphone.com for $19 or if you've  got an MSDN subscription for free or you can sign up at appstudio.microsoft.com which is  a web based thing for creating apps and that's for completely for free. So that qualifies  you as a developer because when you run this preview for developers app, it will prompt  you for your live ID of your Microsoft account credentials. And if it matches up that you  are what we consider a developer then what we always do is we shift the we change the  address that the phone is looking at the service is looking at for updates. And instead of being  your mobile operator, it shifts it over to our service. So you'll get the 8.1 update  then. And there's already been three kind of updates to the update already. So it's  been refining it and fixing bugs in it and it's now getting it's now ready for going  out into to be sold out onto real phones out to the marketplace.  So this 8.1 brings us this common core platform loads of stuff. It really is a total alignment  from top to bottom. It now is very, very, very close. How close is it? Well, this is  the Windows runtime API's. The big blue one there represents Windows. The Windows runtime  on Windows and the small red one there is Windows Phone 8. I said that we had a few  APIs that were already converged. So that's the in-app purchase Windows, the sensors,  the Windows.storage subset. And that's what it was in 8.0. That's what it is now, 8.1.  Over 90, 95% of the APIs in the Windows runtime are exactly the same. There's a few edge cases  where they had to be some properties aren't observed or in a few cases there's different  ways of calling them to account for working on low memory devices like the 512 meg phones.  But yeah, for the most case, you're working on a completely converged platform which is  fantastic. This is another way of looking at it. This is all the block diagram of the  kind of dev platform. The big boxes at the top there, these are the your options for  writing apps for Windows Phone 8.1. So going across from the left, we support WinJS. So  if you work with HTML and JavaScript, you prefer to work with those, you can create  native apps using WinJS. That's now supported on Windows and Windows Phone and of course  is coming to Xbox. And then in the middle we've got Windows XAML. So Windows XAML is  the Windows runtime XAML. This is the flavor of XAML that we've been using on Windows up  till now and that is now the one that's come down to the phone or up to the phone or across  to the phone, however you want to look at it. And you can write your code for those apps  in C-Sharp or Visual Basic or C++. So those three options and C++ is brand new for the  phone. We had C-Sharp and VB before. DirectX, C++, Gamers. Like I said, that was already  pretty well converged in Phone 8 but that's, we've had new enhancements and new features  come in. So a lot of stuff to help you create even better games but that's another option  for gamers. And then we've got this thing called Silverlight XAML on the right there  which is the kind of traditional XAML programming model for Phone. So there's been a few eyebrows  raised when we say this thing's Silverlight. They said, didn't you kill Silverlight? No,  we never killed this flavor of Silverlight. So this is not the web browser plug-in. Okay?  This is, I mean, this is the technology effectively when we had Silverlight in the browser you  could install a Silverlight app from the browser onto your desktop and run it out of browser.  This was the technology that we used in Windows Phone 7 for creating apps. It runs out of  browser. Actually on Windows Phone 7 it never runs in the browser. It's just purely for  creating native apps on Phone 7. Then we got to Phone 8. Well, we stopped calling it Silverlight  XAML. We just want to call it Windows XAML. Just as a marketing move, you know, it's just  kind of, it's XAML across the board. But now of course we kind of shot ourselves in the  foot a little bit there because now we get to Windows Phone 8.1 and actually we've got  two flavors of XAML. We've got the Silverlight XAML that you might have been doing using  up till now and we've got Windows Runtime XAML which is the same one we've got on the  tablet. So in order to stop any confusion, we are calling these two Silverlight XAML  and Windows Runtime XAML. So just so you know when we're talking about it, which one we're  talking about because there are subtle differences between the two. This is another way of looking  at the same thing. So you can create games with DirectX, Direct 3D, although most people  use one of the games middleware platforms like Unity, Havoc, Marmalade, something like  that. And then we got WinJS if you like HTML and JavaScript. Great way of creating native  apps as well and then we've got our two flavors of XAML. Windows Runtime XAML and Windows  Phone Silverlight XAML. Alright, that's enough words. I'm going to now build you an app using  the Windows Phone 8.1 SDK. I'm going to build a simple universal app. Like I said, I'm going  to dig much deeper into this afternoon. So here we are in Visual Studio 2013. The tools  by the way are free for download. You can download a new Visual Studio 2013 Express edition  for Windows and that brings you all the tools you need for developing for Windows Phone 8.1  and for Windows Store 8.1. Or if you've got a ultimate or professional edition of Visual  Studio already installed, this just comes with Update 2. So Update 2 has all this stuff  in it. So the question is if you develop for 8.1, can your app be backwards compatible  to run on 8 for example? No, that's not. If you go for 8.1, I mean the store will allow  you to ship to distribute an 8.0 version of your app and an 8.1 and the end user will  get the appropriate version installed onto their device. But in Visual Studio 2013, you  can create 8.0 apps and later upgrade them to 8.1 or you can create 8.1 apps right from  the get go. Okay, I'm going to create a new project. We've got this now, I prefer working  C-sharp. We've got this category called Store Apps which is divided up into Phone Apps,  Windows Apps and Universal Apps. So there's new project templates that allow you to easily  create one that runs on both. So let's create ourselves. Let's go off to C-shows, NDC 2014  and I'm going to call this. It's a little app that's going to go off to Flickr and pull  down some, do a search and it's going to pull down some pictures. So it's called Unsurprisingly  Flickr Search and this is going to create a solution that has got, well, it's got, we've  got over here, we've got the solution has got a Windows project in it which has got  assets and main page and it's also got a Windows Phone project, Windows Phone 8.1 project  in it which has also got assets and main page in it and then it's got this thing called  Shared Folder. It's a shared project. It's not really a shared, it's not really a project  actually. What this is, everything that ends up in this shared project actually gets distributed,  is duplicated to both of the heads. So you've got a Windows head and a Windows Phone head  and then we've got all the common stuff which is actually most of it at the moment because  we've not added any functionality. There's not a huge amount in shared but particularly  by the time we get to this afternoon's example, just loads of stuff can go into shared. So  that's the kind of project structure. Now I'm going to just add a couple of files I've  got, got ready already. So I've got a couple of you, a couple of class files, classes here.  I'm going to drop them into the shared and while we're at it, I'm going to drag and drop  assets and drop that into shared. So assets has just got some, I think it's just, yeah,  it's just got some standard images which you can just use for design time to make it look  nice when we're in design time. So that's some images. You can have images, you can  have code, you can have data files, whatever can go into this shared folder. And then while  we're at it, let's just get everything else as well. So I've got loads of tile stuff to  replace the stock ones. So let's just drag and drop them into there. We're going to replace  the standard ones. So that gives us lots of nice, you know, nice artwork and that sort  of stuff. We'll do the same for the Windows one. And then we're pretty much ready to go.  Drop that into there as well. Yeah, so this, like I said, is all the, you know, all the  artwork. So we can go into our manifest and we can see the visual assets. You know, so  this one, we can go off and pick the appropriate image. What was the wide? There we go. And  you know, there's a splash screen image as well, which is just a, you just get the square.  So let's just make the background of that all white as well. So we should have a nice splash  screen. And that's the artwork. Now, what about these, what is in here? This is just a utility  class which goes off to Flickr. What it does is here we got a method called a static method  called search async. And it uses HTTP client to make a call off to Flickr. And we will  parse the XML that Flickr sends back. And we will spit out, project that out to a collection  of Flickr photo result objects, which we will then use to show the results in our UI.  And I've got, so I've got the, this is the Flickr photo result which represents a single  image coming back from the data for an image coming back from Flickr. And I've also got  one called Flickr photo results, which is a collection of those things. So that's kind  of the guts of this thing. Now I'm going to start building out the UI for this now. I'll  start with the Windows one. And just blown up the designer, there we go. I want to put  a couple of, this is my main grid. Let's put a couple of rows on our grid. That'll be about,  that's the first one and a little bit of a spacer one. Let's change that to pixel sized  and 100 pixels high. And this one, I also want to be pixel sized and we'll make that  about 40 pixels high. So there's a basic layout. I'm now going to pull in a little bit of Zaml  that I have ready, which is this guy. So now all that I've done now is put a text block,  which is my title Flickr. And we've got a grid view here in this area, which is going  to show all of the results. With a grid view, you need to give it a data template, which  says, okay, for each item that you display in this grid, what, come on, what, how will  it look? It's not behaving. Come on. Try that again. Okay, so there's my data template.  So this defines the layout for each item. We're going to have a grid with a border inside  the board. We've got an image and then I've got a stack panel, which overlies it, which  has just got some text over it. Which, I mean, I can tell you that, but actually that's  all very well. But let's actually put in some design time data so we can actually see the,  see this in at design time what it might look like. Oh, what's happened there? That's not  good. Oh, how did I get across there? All right, let's try that again. Okay, that's  succeeded now. So I'm going to go and just go and switch over to blend because that's  the easiest way of working with design time data. Here's blend. So it'll load up my page  and then what I'm going to do is design, I'm going to get it to auto generate me some design  time data from a class that I've already got in, in fact, from that Flickr photo results  class. So I'm going to get it to spit out some XML. I need to edit the values because  it just comes up with loads of Latin, which is, you know, all right, apart from this image  URL, because what I want that to be is assets slash light gray dot PNG. I think that's right.  Yeah. So, and then it's spat out loads of this. So I just need to just bear with me  while I do this. It's a bit tedious for you guys just a minute. There's about 10 of these  items it's spat out. So nearly there. Couple more. Cool. And now save those changes. I  can set my design time data context to that XAML that's just spat out and who great. Now  we've got we can actually see a design time what it looks like. So this is the Windows  app. Let's close this save all those changes reloading Visual Studio and now we should  be able to see this app actually working. If everything is good, there's splash screen  comes up and we have, oh, hang on, I forgot to put some logic in this. That's not going  to help. That's a nice UI, but no logic as yet. So go off to my main page dot XAML dot  CS and we need to add some, some logic into here, which is in a nice snippet. This is  going off to, we're seeing on navigated to we actually go off and search Flickr for flowers.  This is the method to search it. It's going to set the data context back to the results  when we get it back. And then I've got some other stuff that I'm going to go on to in  a minute, which is all about tiles and setting a tile template, which is XAML. And then we  should be good. And then we, and also some toasts and that sort of stuff. So, yeah, now,  we should hopefully get something back. This is always a slightly nervous moment for me.  There we go. Now, flowers was a carefully selected thing. You know what it's like with  live demos, you know, if you choose the wrong search term, you could get undesirable results  back. I did get one a few weeks ago where the interpretation of a flower was, well,  yeah, disappointing. There we go. So that's the, that's the windows one. So we're in good  shape now. Okay, let's, let's, let's build ourselves a Windows phone version of this,  sharing as much as possible. So I've got my assets. That's all good. Now, what about  my, this main page? So here's my, here's my phone UI. And the moment's an empty grid.  Now, I said the XAML is exactly the same. So you can share XAML, but in this case, I'm  just going to copy it. I don't know why it's complaining about the designers gone crazy  that what's going on? It was just running. Why are you complaining now? All right. Okay.  Strange. All right. So here's my, this is my grid. Actually, I'm just going to copy  the entire contents from the Windows one. And let's paste it into here. Okay. And I  also want to visualize this. I mean, okay, that's kind of worked. I haven't got any,  any things. I'm going to copy the sample data. Sample data, unfortunately, can't go into  the shared folder. It has to be, it's something the design time experience likes it to be  actually in the head. Let's build. And then I also want to go and do kind of what I did  before and fix up the layout a bit. So let's go off to build for, go off to blend for the  phone one as well. I've already got the design time data that I generated before and I just  copied it. So all I need to do is, is wire it up, which I can do like that. And now we're  seeing what it's going to look like in the phone as well. Now, this is all very well,  but let's make this a bit smaller. Let's make this, I don't know, 80. And this one we can  make to be 10. So we're getting a better sort of layout. The grid, what have we got? We've  got a couple, we've got, I want to set that left margin and set that left margin of that  to 10 and the right margin to 10. So we're doing a bit of layout stuff here. I didn't  mean that. Yeah, and the grid view. So I'm going to edit the layout template. And we've  got our, we've got our grid. I'm just going to make that auto width, auto and height and  and set a bottom margin of 10. This isn't quite working out how I expected. What's going  on here? I must have messed up. Oh yeah, I still got 120 on that, on this grid view.  Set that to zero. Okay, now we're getting sort of like a layout that's a bit more appropriate  for the phone. Let's just drag that over there and stick that over there as well. So now  that's looking better for a phone layout. Can save that. Reloading Visual Studio. That  will catch up in a minute. And then we can change the target that we're going to actually  go and run. So this Windows phone and we'll run it on the emulator. So it's going to boot  up my phone emulator. And we should get the same sort of app basically working on both  devices. Ah, I haven't put any logic in. I did the same mistake over and over again.  So I've done the UI. Yeah, brilliant. And then you're not going to see anything. So  there's no logic on the back of this page at the moment. It's, here it is. It's completely,  there's an on navigated to which we can get rid of actually. So I could just simply put  my snippet in again the same logic I had in the phone up, but I don't like that because  that's duplicating code. I really don't like that at all. So actually what I'm going to  do is go and go and copy that class. I'm going to go down to my shared folder, add a new  class, new item. And it's going to be a class and it's going to be called main page dot  CS. And I'm going to just paste all of the code behind into there. Now, this is kind  of interesting. Apart from I'm going to leave the constructor out because this is the key  thing here. This is a partial class, which means it allows you to distribute the definition  of a class across multiple different physical files. So I'm going to have all the common  stuff in this partial class that's in the shared in the, and that will all get merged  into this one in the phone. And this one now, I need to remove all this because otherwise  it will end up being all duplicated. So now that's my Windows one. That's my main page,  but it will get, when it's compiled, it will add in all of this stuff as well. Same for  the phone one. We'll add in all of that shared stuff as well. So now the phone one should  work. Now, I'm also going to do one other thing as well, which is to, before I run it,  go into the app manifest and I'm going to make it toast capable because the other thing  that code does in the main page is when it gets some results back, it updates the tile  with the first five pictures and it also sends a toast. So what I'm going to do is, not that,  is go off and find my Flickr searcher and pin it to the start screen. So we've got a  tile. There we go. Let's just make it a big tile. Right. That's a nice tile. And then  we will run the app. And we should, we've got all that shared logic and there's our  pictures. So we've got a nice little pictures. So that's all working great. And in a minute,  with the gods of this, we should have a toast pop up. Yay. And that's just the first text,  the first message for that first one. And this tile at the bottom has been updated with  the first five images. So we've got a nice tile updates as well. The point is, of course,  that it's exactly the same code as up in the Windows once. I'm just going to turn my notifications  back on in here and run this guy as well. Debug, start new instance. And this would  do the same thing. We've got our images up and we should get a toast pop up in a minute  for that guy as well. We don't even have to wait for it to close it and the toast should  pop up. Should do. Did I turn notifications back on? Yeah, I did. Oh, I know I did. I  forgot to say toast capable in here. There we go. Yes. Okay. Set a startup. Run it. And  this one would update the tile as well. I've not bothered pinning the tile, but there's  our image. And in just a few seconds, we should also get the toast pop up as well. And it's  exactly the same code, same template, same everything. We will get a toast in a minute.  Oh, well, whatever. It should do. Maybe I have to stop it and restart it. I'm not going  to waste any more time on that. So I hope that gave you a flavor for the commonality  between the two. Let's dig a bit more deeper into what we've actually got with phone 8.1.  So first of all, this app model convergence. So, you know, I've already talked about this.  The key investments were about making apps work really well across devices. And we wanted  also to make it much better to run really well on low memory devices. So Windows Phone  has been, you know, it's been a struggle. We're starting to gain a bit of market share.  But actually, all the phones that are selling, frankly, are the cheaper ones. It's the low  end devices, 512 megs. Now, fortunately, our OS works very well on 512 meg devices.  It works even better on one gig and then two gig devices, but it works pretty well on  512 megs. But we've done a lot of efforts in this release to make that even better.  So your apps, I mean, for you as developers, that's good because you're not going to get  any of those crazy comments from people saying how slow your app is. Because quite often  that's not your fault. It may be that the phone is just rubbish, you know? But now on  low end devices, you're going to get a good performance. We really enhanced the multitasking,  the packaging deployment is the same, backup and roaming, and the application data sharing  are all good things that are going to come to us developers. And there's also, from the  end user's point of view, we've got this action center. So you can now swipe down from the  top and user can get notifications and get to quick settings. That's programmable. So  you can actually put stuff into that and update notifications. And we've got shared push notifications,  resource packages. So there's a packaging way to make sure that the stuff that gets downloaded  to the phone is smaller. And then we're roaming data across phone and tablet. I'm going to  talk about each of these in a bit more detail. So yeah, we went to Sphone 8. We ran pretty  well on 512 meg devices. But we really ran great on 1 gig and above. And these 15, 20s,  these massive super phones, they've got 2 gigs of memory in them. But, you know, we  did a lot of work to make sure that the user experience was consistent across them. And  the stuff worked, albeit a bit slower on the cheaper devices. So it was okay. But we did  a lot of effort in phone 8.1 to actually make the experience much better for owners who  had the low memory devices. So one of the key things we did here was that in Windows  Phone 8, we had this idea of a memory cap. So you had that amount, certain amount of  memory your app was allowed to use. And that was fixed at 150 megs for a 512 meg device.  And if your app used more of that, went over that, the OS would just kill it. No questions  asked. You're dead. You're out. So, and that all worked okay. But actually we found that  it could be overly conservative. Because when we looked at all the analytics, the data that  comes back about what apps actually are that are running on our devices, we actually found  that 94% of apps run in less than 150 megs. So that small 6% wouldn't run on the 512s  at all, but would only run on the bigger devices. But the real interesting stats is when you  go down is that actually 70% of apps only need 60 megs of RAM to run in. Now, the problem  here is that because we were having a fixed slot, a memory slot for you to run in of 150  megs, if you only use 60 megs, that's fine. You would run and you'd have all this lovely  space, but all the rest of that memory was essentially wasted. And when a user switches  from one app, an active app on a phone to another one, what happens is the current,  the one that they're switching from gets suspended and the OS will try and take a memory snapshot  of that and keep it in memory so that then the user can start up their next app and start  running with that. And then if they finish with that app and then go back to the one  they were on before, you get a fast resume and it just gets loaded back in from cache  and you know, it really fast and quick and get off, we get going again. Now, the problem  with 512 meg devices is if you've got 150 meg memory slot, there isn't room left to  cache 150 megs. So it effectively meant that whenever an app got suspended, it actually  got tombstone, which is this kind of, you know, deep sleep state we put them into. It's  still resumable, but the work to resume it is much more and you see this resuming dot,  dot, dot across the screen and there's a noticeable pause and then finally the app comes up.  It's not a terrible user experience, but we can do better. So it effectively meant that  all these apps were getting tombstone when in actual fact, if we were just able to take  a memory snapshot of the 60 megs they actually were using rather than this kind of over cons,  the conservative 150 megs, then we could give a user experience and that's exactly what  we've done. So now the system, the phone OS monitors how much your memory your app is  using over time. So very first time a user runs the app, they'll get given the 150, but  actually when you run it, the system will say, okay, last couple of times this user  has run this, it's actually only used 60 megs. So the next time it runs, they get given  60 megs with a little bit of a buffer to account for something that unique that hadn't happened  before. And then, of course, when they get suspended, you just suspend whatever memory  has been used rather than the whole 150 meg fixed slot. So this means that with the low  end phones, the chances of your app being resumed rather than coming back from tombstone  are much greater, much improved. So you'll get a much better user experience and the  users will see apps resumed faster and will love the phone more and love your app more.  So the result of this on one gig and above, just about every app will be resumed from  suspended state rather than from tombstone. 512 megs, this will still be for heavy users,  there will still be some tombstone, but the most recent ones more likely will be resumed  from in memory suspension, which is going to give a much better user experience.  What about the way we can run code on the device? So I'm going to talk about multitasking.  And the goals here was, first of all, if you've written a Windows Phone 8 application and  used the background tasks options that we have on there, which is we have two flavors,  we have the periodic tasks that the OS will run your app for like 25 seconds every 30  minutes or so. And then we had resource intensive tasks where if you're plugged in on charge,  then the OS will allow your app to run for, I think it's 10 minutes or 20 minutes, a long  time anyway, and do some real heavy duty stuff. So that's compatibility has been retained.  So those kind of flavors of background tasks still work. But what we've done is we've brought  the Windows runtime background tasks system down to the phone, which means that you've  got the same rich ways of running code in the background that you've got on Windows,  and it massively expands the interesting stuff you can do on phone.  So before we get on to the background tasking, first of all, I'd already talked about the  memory cap and about the way that we're enabling apps to be resumed more quickly. But the other  thing we've done is that we were under the impression in Microsoft that users kind of  understood this idea that they launched an app, and then they go through some pages,  and then when they come back to the home screen, if they hit back on the home screen of the  app, it would close the app. And the next time they ran the app, it would launch a whole  new copy up from scratch. And we also thought that if you go to the programs menu, people  were always expecting somebody to launch a new copy of the app, and it wouldn't take  them back to where they were necessary. You'd always start at the launch page, and we'd  kind of say, well, you know, it's a consistent user experience. People understand it. It's  the phone way of doing things. Anyway, it turns out people didn't understand that at  all. That was kind of a convenient trick we were playing on ourselves because that's the  way it worked. So anyway, it's changed. So now, when you exit an app, however you exit  an app on Windows Phone 8.1, so you hit the back button on the home screen of an app,  the app doesn't close. It will be suspended. So it will be suspended. And the next time  you run the app, the user runs the app, whether it's by going to the task switcher or whether  it's by going to the programs menu, the suspended one will be resumed, which gives a much better  user experience, gives you a tiny little bit more work to do as a developer because you  have to kind of think, OK, do I want to put this user back in exactly the same page they  were on before, or do I want to give them a starter fresh from new kind of experience?  And that's kind of basically, that's up to you. That's domain specific as to what kind  of experience you want to give to your user. It depends on what the app does. Facebook,  for example, will always resume back where you were because it's a kind of a continuing  rich experience. Other apps, it wouldn't make sense to launch into page XYZ. Instead, you  want to always start at the home screen. So that's something that's for you to make a  decision on. We have this app switcher. Yes.  Thank you. So the question was, if you have way too many suspended apps, can it slow the  device down or do you have to actually switch them off? That's absolutely perfect because  this picture I've just put up on the slide here is our task switcher, which actually  came out in GDR3, update three of Windows Phone 8.0. Because we have, I have this kind  of conversations all the time. And particularly in the Android world, people love to be able  to kill apps. Now, me as Microsoft, and I know how the phone works, I say, actually,  no, do you know what? It doesn't matter how many suspended apps you have because when  they're suspended, they're not using any resources. But people say, particularly Android users,  but I want to kill the app. I know, I don't, basically, I don't believe you. I don't believe  you. I want to kill apps because I think there's stuff going on. I think, you know, you can  say all that stuff, but there's stuff going on. No, there isn't. But if you want to kill  apps, cool, you can kill apps. They'll give you the opportunity. So now we've got this  nice in the task switcher. You've got this X. You can tap on it and it will close the  app. But to answer your question, no, you could have loads of suspended apps. Because  once it fills up the bit of memory that it's put aside for caching, keeping an in-memory  snapshot for fast resume, then we're back into our old fashioned, if you like, tombstone,  which is just we store a signature of where the app was and it gets stored into persistent  storage. And we can still resume from that and get back to where they were. It's a little  bit more work that needs to be done. But yeah, so we've got the task switcher and you can  kill apps if that's what you want to do. It doesn't make any difference.  So we've got all these background triggers now. So like I said, we had periodic background  tasks and resource intensive background tasks. And they're fine, good enough up to a point,  but not flexible enough. So now we've got the Windows 8.1 background task execution  system on the phone, which means there's a whole load of different triggers. So there's  one, there's triggers that fire when the lock screen, you know, when the image comes up  on the lock screen and when the phone gets booted, there's one that there's a trigger  which is interesting called a servicing trigger. So one thing that with apps now is that they  silently update. So the user doesn't have to go to the store tile and actually say,  yeah, you see, oh, you know, we've got three apps needing updating and they have to actually  go and say, yes, update them. That happens in the background. But the servicing trigger,  when an app has been updated, your code could register for a servicing trigger and it allows  you to run a bit of code in the background after the update has been installed, which  would allow you to upgrade data that's been stored on the device or something like that  or make some changes that you might need in order to support the updated version. So that's  one of them. Push notification trigger, I'm going to talk is really cool. So I'll talk  about that in just a moment. Geofencing. So we got all these nice geofencing triggers.  So when the app moves through a particular geographic location, you can fire up a background  task and do some stuff to notify the user that something of interest to them is nearby.  BLE. That's Bluetooth LE, Bluetooth low energy. So this is Internet of Things stuff, smart  devices. You can actually run a background task when a device gets connected or disconnected  or when the device itself has changed its status and wants to send a message to whoever  is interested. So you can actually have apps that are interacting with heart rate monitors  or luggage tags or access control things or plant pot humidity detectors or whatever.  This is a massively expanding area. You can also do boring stuff like simply run background  task on a schedule and you can do stuff with sensors. Question there?  Good question. So is the Bluetooth LE stuff working in old hardware? It will. It doesn't  right now. So actually it does. If you've got an HTC Atex, it works. Are those things  like Goldus now? Because they're actually pretty much the only ones it's working on  right now. The problem is, or the thing is that with the Nokia Black updates that they  shipped at the end of last year, they did enable Bluetooth LE at the low level and they  had their own APIs and they enabled things like the Adidas MyCoach thing to work with  a monitor. But it was kind of almost a proprietary solution. It only worked on Nokia. So now  we've got the capability built into the OS. But until the Nokia AMBA update comes out,  the Bluetooth LE stuff is blocked from working on Nokia phones. So the Bluetooth AMBA, it  will be out very soon. It will be the one that comes with the 8.1 update. So all Nokia  phones that get the regular update will remove this proprietary if you Bluetooth LE stuff  and it will be enabled across all of the Bluetooth LE devices.  Actually on a related kind of note as well, the OS 8.1 does work on all existing hardware.  Whether it's available for you is up to your network operator. So we can't promise and  say everybody's going to get it. So unfortunately that does depend on your mobile network operator  as to when they ship it to you. But like I said, if you join the preview for your developers,  you can bypass them anyway.  The other thing about hardware, everything will work. There are some new APIs around  NFC. So we've got some new stuff for doing real low level stuff with NFC. So we'll be  able to use it for doing transit passes and all this kind of good stuff. That will require  a new chipset which is going to come in new phones. So that is pretty much the only feature  that I know of that is going to be not usable on the existing hardware. So some stuff around  that.  Yes, this push channel notification trigger is really cool. So here's the thing. So we've  always had these push notifications. You can send from the cloud to a device and you can  put a toast up. You could update a tile and a lot of developers have used this for reaching  out to users and it's cool. It's this live tile's idea and it's really great. And there  was a third kind of notification which was this raw notification. And a raw notification  is basically app specific. It's just you send a block of bytes, some XML usually, to the  phone. And in Windows Phone 8 and earlier, if the app was actually running at the time  the notification arrived, they would get it in an event and they could process it. But  that's it.  So from a back end service point of view, like, well, what's the use of that? So frankly,  I've never found a use for it. But now we do because push notification trigger is fantastic.  So now if you send a raw trigger from your back end and you've registered for a push  notification trigger, when the notification comes to the phone, the background task fires  up and you can process the data that's in the raw notification trigger. Now, why is  this exciting? Well, here's the scenario, you see. Maybe you've got a sports app and  you want to have, you know, notifications to the user. They're particularly interested  in goals that are scored at the World Cup. Yeah? So now, the old way of doing this was,  yes, you could send a toast and say England are losing 4-0 or something. Never happened.  And then the toast will come up and then the user's really interested and they tap on  the toast. The sports app opens up. But then they've got this thing where they have to  sit and look at the stale old news while it just says, wait, updating and it goes off  to the cloud and then it gets the information and finally gives you the information you're  interested in.  But now what you can do with the raw notification, you don't, the user doesn't get any visible  anything. There's no toast associated with this with the raw notification. But your background  task could go off to the server, update the stored data for the app because it's a part  of the app, you know, can already go and get the news, the pictures, the information about  this event, then pop up a toast to notify the user. The user taps on the toast, the  app opens and it's already up to date. Much better user experience. So that's really  exciting.  Geofence is cool as well. So this is brand new as well. Your app can register. It says  they're up to 1000 geofences. Actually 1000 geofences is the kind of practical limit.  The actual real true limit is something like 20,000. But we wouldn't recommend that because  it will start to run a bit slow. But yeah, we got, so you create these circular geofences  and your app can register up to 1000 of these. And it's just a geocordinate, a latitude and  longitude and a radius. And you can register for different kinds of triggers. So when the  user enters the geofence or when they leave the geofence, you can have some background  code can run. And these work also not only with background tasks, but also with your  foreground app. If you've got a foreground app, it can get events when the user travels  through a particular geofence. And I've got a nice little demo I can show you with this.  Okay. So this was actually built by a Dutch MVP, Jost van Schijk. And he's built this  little app, which it's simple enough. It's actually a portable app. It's a universal  app. So it works on Windows and Windows Phone. I'm just going to show you the Windows Phone  one. So there is, so you have this geofence monitor and you can clear all your geofences.  You can set the center of your map in your zoom level. And then what we're going to do  is we're going to call this map location finder API to basically get locations. That's a kind  of a geo conversion API. And then there's this map route finder. You can get a driving  route from one point to another. And then what you can do is we actually draw the route  onto the map with map polylines. There's a really nice little sample. And we can draw  map icons on and geofences as well. We're actually going to in this app show you where  the geofences are. Normally they wouldn't be visible on app. And then we get, when the  position changes, we will move along the apps along this map. So let's show you what that  looks like. So here's the basic app. The location is set to be somewhere in the Netherlands.  And we've got in the emulator, got these tools. So we can do cool stuff with the tools and  load in a list of lat longs representing a route, which is here. And that's now going  off to Amersvoort in the Netherlands. And you can see the route that we're going to go  to. So I'm going to show the route on the map. Here's the route that we're going to  do. Let's just zoom out. And I'm going to start the location simulator in the tools.  So I'm going to play all these points using, you can change the speed to speed limit, walking,  biking, or super fast. I'm going to just go as if we're driving around streets using,  observing the speed limit. And you can change the accuracy profile. Say, are we going to  have exactly pinpoint accuracy, or are we going to pretend to be urban? So it simulates  how, as you were connecting through different towers, it knows where towers are on Wi-Fi  points. So very clever stuff. They've invested a huge amount into this. Let's start it playing  and we're going to track the location. So as we move along, the map is going to track  along and we'll show us, we will track along where we're going. I'm also going to show  the geofences. So what happens is when we travel in, you should be a car up. Why is  my car not showing? Then when we get to a geofence, the task, the event fire says, you  are entered a geofence. So then it will give you turn-by-turn directions as well. There  should be a nice little red car which always comes up. It hasn't come up for some reason  on this. I bet that's because I zoomed in. Yeah. Anyway, you can see how it's tracking  along, tracking along, matching the position that we've got in this simulator. So this  is real nice. You can do a geocaching map search from the comfort of your workstation,  not have to sit around in the car and drive around with a laptop and a phone and all this  kind of stuff. Yeah. So really rich stuff. This is a foreground app, but like I said,  works great in the background. So you can have things where the user gets off a plane.  You've got geofences set up. You can set up all the different airports in your area.  So as soon as you get off a plane, the geofence, you'll get a trigger that you've passed through  a geofence for an airport. Your background task could then load in loads of geofences  that are appropriate to that particular airport location, and then you can give real good  directions to facilities that are nearby. Oh, the car's turned up at last. There you  go. There's my car. So it's all cool stuff. Okay. Yeah, we've got one nice of push service.  One Windows notification services is unified across the both. WNS is much faster than  the old MPNS and much more reliable. And MPNS used to work all right in the United States  and frankly sucked everywhere else. So now WNS is good and it's worldwide and it's really  cool. And even your Windows Phone 8.0 apps running on a Windows Phone 8.1 device under  the covers, the notifications are happening over WNS without you having to upgrade or do  anything. So you've coded up an app using the old push notifications, and it will just  work and it actually will get all the benefits of the improved performance of WNS. It's more  battery efficient. Toast updates, I kind of showed you a demo of this. Common format over  both, but what you have on the phone is you won't have the same rich visualization of  it. So it kind of adapts what it shows that is appropriate for the platform where it's  working. This action center, we've got this list of stuff that you can, you know, the  list of notifications. The key thing here is that apps can also update or remove notifications  from this list if they're related to your app. And you can also do this thing called a silent  toast. So you can put stuff into that list but not actually interrupt them with a toast  pop-up. So it's good for putting important information into the list that they can look  at when they drag down the action center. The live tiles is common as well. Same mechanism,  same templates across Windows and Windows Phone. And this app packaging and deployment,  now we've got the same Apex format. But what's cute about this is if you have multi-lingual  apps, so you've created resources with different translations, or you've shipped in resources  for different resolutions of phones, so you've got high def resources and lower def, the  scale to 40 scale 100 stuff. When the user installs the app, the packaging system gives  you this for free. So when the user installs your app, they get just the resources that  are appropriate for the language of their phone and for the resolution of their phone.  So they don't have to ship the whole shooting match, they get just the bit that's important  to them. And updates are just, you only get the bit that's updated as well. So huge improvements  to the user, faster installs and very data efficient. Users can install apps onto an  SD card now and they can move apps between the main memory and the SD card. Any apps  that's stored on the SD card, the local folder is all encrypted, so it's a safe, you don't  have to worry about security. Apps are enabled for storing on there by default, but if you  really have a strong objection to that, you as the developer can check something in the  app manifest to say, no, I don't want this app to be installed on an SD card. But we  expect most people would want that to happen. This is really cute, so the app data roaming,  so there's a couple of things from the user perspective that's in 8.1. First of all, the  start screen layout is backed up for the user, which means that if you get a new phone and  you choose to install the backup from your previous phone, in the past you get all your  apps, but you wouldn't get the same start screen. So you lovingly created this beautiful  start screen and you don't quite get the same thing back. So now you do. So we're backing  up the start screen, but the other thing is that the local folder stuff gets backed up  to OneDrive every night as well. So all the local files in the local folder will be backed  up to OneDrive. So again, your users have got that kind of backup, automatically built  into the system. But the most exciting one is the one at the top there, app data roaming.  So if you've got an app that you've registered in the store for a particular app name and  it's a Windows Store app, and then you register at the Windows phone version of the app and  use the same stored name, they are tied together. They have this thing called a shared PFM,  which stands for package family name, but it basically means they've got the same reserved  name. Once that happens, if you store stuff into the roaming folder, it will automatically  be roamed through to the other devices. So this is great because it allows your user to  do something on the phone and then later pick up the tablet. And most recently, the  most recently used searches or the most recently used data or whatever is there. So they can  pick up a task on a different device that they started on an alternative one. So this  is really, really nice feature and it's very, very easy to take advantage of.  Enterprise deployment, no real changes here. So enterprises can distribute their own apps  without going through the Windows Store. You can do that using device management packages,  in-tune from Microsoft or mobile iron or any of these other ones, or just through a SharePoint  site or even by email or an SD card. So there's a security system behind all this because  when you sign up as an enterprise publisher, you get your own signing certificate. So you  sign your stuff with that and that guarantees that it can't be tampered with. And then you  register your phones to accept that token. So that's obviously still there. Oh yeah,  I already talked about the application data sharing. Oh no, this is actually application  data sharing, which is the user driven data sharing between apps. This is the Share contract.  And actually I'm going to show you a demo for this because I'm running out of time,  which will tell the tale better. So the Share contract. So first of all, I'm going to open  a Silverlight app, which is our old friend the Contoso cookbook. I'm sure a few of you  have come across this before. And this application, I'm going to run it on the phone 8.1.1, is  a simple little recipe thing. And what it does is it allows you to select a recipe. You  can go off and find a recipe. You can get the ingredients and you can actually take  a picture of it. And that's all great. Now, I want to, you can upgrade this. This is a  phone 8.1 project. I can really easily upgrade it to 8.1 by going to this. This is Silverlight  8.1. And we've got an 8.1. Now, I'm going to just, that's the upgrade. How's that? But  I'm going to open the completed solution because we haven't got time. I would normally take  you through this. But once you've upgraded to 8.1, you've got access to the complete  Windows runtime API and all the new cool stuff, including the Share contract and everything  else. So now what I can do is in my recipe detail page, I can add a new button to the ... Just build it. Add a new button to the... Oh, God. Hang on. I just need to get  the packages. Phone toolkit got lost. Install. There we go. Now we should be good. So this  now is... Here we go. I've added a new app bar button to this. Right. There we go. Which  is a new one which is... Which is to Share. This is not working, sorry. Right. Apologize.  That's something that's going to arrive here. So the point why I was trying to show there  is that it's very easy to create a Windows runtime API, to call Windows runtime APIs,  including the Share one. And I'll try one... I'll just give one more shot on this as  if I got the version that from the jump start, which should be good. Try this. Yeah. Okay.  So this one should be all right. Once I fix that again. And this is an example of how  you can add real rich contents to an application. So now I go to German. I can go and pick a  recipe. I can say leg of lamb. And I've created this beautiful leg of lamb so I can take a  picture of it. And you have to use your imagination. This is a leg of lamb. Isn't that fantastic?  Yeah. There we go. Accept our picture. And then I can share it. This is now calling out  to the Share contract. So now we're in the UI of the phone. And it's giving you all the  apps and locations where you can share to. I could share that to OneNote, for example.  You couldn't do that in a phone application. Actually, the code to do that is very, very  simple. So there's my picture and a little bit of stuff that's come from the Contoso  cookbook app. And this was the code to do this is basically this in order to do that  sharing thing. So it's very rich and very easy to add really exciting new functionality  to your application. Right. So that was a quick run through of the phone 8.1 platform.  Give you an idea of all the great new stuff that's in it. Loads of emphasis on running  really well on 512 make devices. Rate new ways of running code in the background. Good  stuff about app data roaming and about the deployment and the app data sharing and the  convergence around WNS and Action Center. So thanks very much for watching this. I'd  be very happy to have as many of you as possible back again after lunch. But thanks very much  and enjoy your lunch.
Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_0_455.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_456_1823.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_1824_3551.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_3552_8231.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_8232_13943.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_13944_15263.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_15264_19139.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_19140_19775.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_19776_20063.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_20064_23171.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_23172_23243.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_23244_23423.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_23424_24275.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_24276_28199.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_28200_30779.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_30780_31259.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_31260_31535.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_31536_31739.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_31740_33167.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_33168_33491.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_33492_33647.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_33648_33791.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_33792_34847.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_34848_34895.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_34896_35315.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_35316_36527.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_36528_36863.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_36864_37619.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_37620_39191.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_39192_39263.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_39264_40307.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_40308_41075.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_41076_45455.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_45456_45515.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_45516_45731.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_45732_45779.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_45780_46067.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_46068_46211.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_46212_46319.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_46320_46415.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_46416_46751.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_46752_46799.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_46800_47099.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_47100_47207.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_47208_47507.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_47508_47855.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_47856_50255.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_50256_51143.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_51144_54899.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_54900_56627.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_56628_61343.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_61344_63863.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_63864_73955.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_73956_75215.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_75216_75335.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_75336_77267.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_77268_77687.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_77688_78227.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_78228_78455.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_78456_78599.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_78600_78695.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_78696_82019.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_82020_82211.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_82212_83159.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_83160_83543.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_83544_84191.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_84192_84335.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_84336_85463.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_85464_86255.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_86256_88859.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_88860_89831.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_89832_90299.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_90300_90371.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_90372_91091.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_91092_91139.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_91140_91451.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_91452_92291.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_92292_92615.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_92616_93935.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_93936_95867.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_95868_96827.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_96828_97127.png Andy_Wigley_-_A_lap_around_the_Windows_Phone_8_97128_98474.png