You are developing a Windows Store app for a security monitoring company.
You have been asked to build a module that uploads large video files to a web-based video sharing
service.
You have the following requirements:
The video codex must match the proprietary format developed by the company’s internal labs.
When the app runs on a metered network connection, upload operations must be suspended.
When the app is suspended, upload operations must continue.
You need to ensure that the app meets the requirements.
What should you do? (Each correct answer presents part of the solution. Choose all that apply.)
A.
Create a BackgroundUploader object and call the CreateUploadAsync() method to transfer the
video file.
B.
Enable the Internet (Client) capability in the package.appxmanifest file.
C.
Enable the Internet (Server) capability in the package.appxmanifest file.
D.
Create an HttpClient object and use the PutAsync() method to perform the transfer the video file
asynchronously.
E.
Create a BackgroundTransfer object and call the UploadAsync() method to transfer the video file.
F.
Use the XHR class to initiate and run a web upload of a video file.
Explanation:
C: To ensure your Windows Store app is network ready, you must set the capability in the project
Package.appxmanifest file.
Capability: Internet (Client & Server)
Gives the app inbound and outbound network access from the Internet and networks in public
places like airports and coffee shops.
This is the internetClientServer capability in the app manifest.
A:
* BackgroundUploader class
Background Transfer is primarily designed for long-term transfer operations for resources like video,
music, and large images. For short-term operations involving transfers of smaller resources (i.e. a
couple KB), use the Windows.Web.Http namespace (not D).
* BackgroundUploader.CreateUploadAsync | createUploadAsync methods
Initializes an asynchronous UploadOperation.
* Example:
BackgroundUploader uploader = new BackgroundUploader();
uploader.SetRequestHeader(“Filename”, file.Name);UploadOperation upload = uploader.CreateUpload(uri, file);
// Attach progress and completion handlers.
await HandleUploadAsync(upload, true);
a, b