Making a server request and displaying the response is a common occurrence in most applications. We will look at how to use the WinJS.xhr object to make a request to the Bing API to reverse geo-encode the current position based on coordinates retrieved through geolocation.
- View Offline
- [Voiceover] We're going to do something that's quite…common these days in terms of creating an application,…and that is to go out to the Internet and to hit an API…and get some data back.…And so to do that, we're going to be using an XHR request.…Now XHR stands for XML http request,…and it allows you to send a request…to a web server and load back any of that data…as a response.…And it's very common to work with APIs in this fashion,…you're going out to the server, you're making a request…for something specific, and then you're getting…that data back and you're showing that data in your page.…
When we go to save a room that we stayed in, we can now add…the address to it.…To do this, we're going to be using the Bing API.…Now to use the Bing API, like most APIs,…you're going to need to register as a developer.…Now registering as a developer means that they're going…to issue you, your own API key.…You'll need to go over to the Bing Developer Center…to do this.…Now if you go to the Bing Developer Center,…you'll see that there's a whole bunch of other items…
Watch to gain an understanding of the Universal Windows Platform and the application life cycle. Learn to create adaptive layouts with WinJS controls. Discover how to store and share data, capture a variety of input, and explore the unified Microsoft-specific APIs: Windows Core and Geolocation. Stacey Mulcahy, a Windows evangelist, provides developers with everything they need to start building Universal Windows apps and break into cross-device development.
- Setting up your development environment
- Coding in WinJS
- Creating page objects
- Animating page transitions
- Implementing responsive design principles and UI patterns
- Working with layout controls
- Using APIs: Windows Core and Geolocation
- Saving and reading data