23.01.2018 Views

MICROSOFT_PRESS_EBOOK_PROGRAMMING_WINDOWS_8_APPS_WITH_HTML_CSS_AND_JAVASCRIPT_PDF

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Although this option will not set up DataUsage properties and all that a real metered network<br />

might provide, it will return a networkCostType of fixed, which allows you to see how your app<br />

responds. You can also use the Show Estimated Data Usage menu item to watch how much traffic<br />

your app generates during its normal operation, and you can reset the counter so that you can<br />

take some accurate readings:<br />

Running Offline<br />

The other user experience that is sure to earn your app a better reputation is how it behaves when there<br />

is no connectivity or when there’s a change in connectivity. Ask yourself the following questions:<br />

• What happens if your app starts without connectivity, both from tiles (primary and secondary)<br />

and through contracts such as search, share, and the file picker?<br />

• What happens if your app runs the first time without connectivity?<br />

• What happens if connectivity is lost while the app is running?<br />

• What happens when connectivity comes back?<br />

As described above in the “Connectivity Awareness” section, you can use the<br />

networkstatus-changed event to handle these situations while running and your resuming handler to<br />

check if connection status changed while the app was suspended. If you have a background task tied to<br />

the networkStateChange trigger, it would primarily save state that your resuming handler would<br />

then check.<br />

639

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!