Connecting to networks and web services (XAML)
[ This article is for Windows 8.x and Windows Phone 8.x developers writing Windows Runtime apps. If you’re developing for Windows 10, see the latest documentation ]
In this section, you can learn how to create connected apps. A connected, or network-aware app, can use the network for a variety of purposes including RSS feeds, games, and to interact with nearby devices.
Roadmap: How does this topic relate to others? See:
Topic | Description |
---|---|
Adding support for networking | Every Windows Store app is expected to define resource requirements before access is provided. Networked apps should also accommodate the Windows 8 device lifecycle, which includes frequent transitions between different networks and power states. This section supports the following scenarios:
Code samples: Background task sample, ControlChannelTrigger HttpClient sample, ControlChannelTrigger HttpClient sample, ControlChannelTrigger with IXMLHTTPRequest2 sample, ControlChannelTrigger TCP socket sample, ControlChannelTrigger StreamWebSocket sample, Lock screen apps sample, Push and periodic notifications client-side sample, Raw notifications sample |
Connecting to web services | Connect to HTTP and Representational State Transfer (REST) web services to access, store, or modify content. A web service represents the point at which a user is able to interact with an entity or service that has been made available on the Internet. A few of the many examples of web services include:
Code samples: HttpClient Sample, Web authentication sample |
Connecting with sockets | Establish socket-based network connections using your Windows Store app. Support is provided for basic TCP and UDP socket connections, as well as UDP multicast, which enables the implementation of other higher-layer networking protocols. This networking feature enables the following network connectivity scenarios:
Code samples: StreamSocket sample, DatagramSocket sample |
Connecting with WebSockets | Use WebSockets for fast, secure bi-directional communication between a client and a server over the web. Data is transferred immediately over a full-duplex single socket connection, allowing messages to be sent and received from both endpoints in real time with low latency. WebSocket connections are great for Windows Store apps that include features such as:
Code samples: Connecting with WebSockets sample |
Working with Live services | Enable your Windows Store app to securely sign-in to Live services and exchange data with the popular cloud-based services. Providing Live service functionality in your app allows your user to continue using the services they know, connect with the friends in a manner that’s already familiar, and ensure that these experiences are consistent within your app. Supported Live service functionality includes:
Code samples: PhotoSky - OneDrive sample |
Connecting to Microsoft Azure Mobile Services | Add a cloud-based backend service to your Windows Store app using Azure Mobile Services. Leveraging these cloud services allows your app development to focus on the front end that your users value, while Mobile Services lets you more easily handle these cloud-based tasks using Microsoft Azure:
Code samples: Microsoft Azure Mobile Services samples for Windows Store apps |
Connecting with proximity and tapping | Create localized connection and sharing opportunities for Windows 8 on mobile devices. A Windows Store app can use the Proximity APIs to enable two devices that are within close proximity of each other, or physically tapped together, to be aware of one another. Your app can use this awareness to establish a connection between the two devices to:
Code samples: Proximity sample |
Connection state and cost management | Create a Windows Store app that efficiently uses network resources and is capable in mobile scenarios that involve a device moving between multiple networks or utilizing networks with associated usage costs. Using these APIs allows a developer to add behavior that demonstrates network awareness in scenarios that have direct impact on the end-user experience:
Code samples: Network Information sample, Mobile Broadband Account Provisioning sample |
Accessing and managing syndicated content | Create Windows Store apps that consume and syndicate web content using feeds. Protocols supported include the Really Simple Syndication (RSS), Atom Syndication, and the Atom Publishing Protocol. Content syndication activities can include:
Additionally, C++ support is provided for JavaScript Objection Notation (JSON). JSON is a data format returned by many popular web services. It is a compact data format that can result in lower latency over constrained connections. Code samples: Syndication sample, AtomPub sample, Integrating content and controls from web services sample |
Related topics
Roadmap for creating Windows Store apps using C# or Visual Basic