Windows Dev Center

ConnectionProfile.GetAttributedNetworkUsageAsync | getAttributedNetworkUsageAsync method

Gets network usage data for each individual application. This method is only supported in a Windows Phone Store app.

Syntax


connectionProfile.getAttributedNetworkUsageAsync(startTime, endTime, states).done( /* Your success and error handlers */ );

Parameters

startTime

Type: Date [JavaScript] | System.DateTimeOffset [.NET] | Windows::Foundation::DateTime [C++]

The start time of the usage window.

endTime

Type: Date [JavaScript] | System.DateTimeOffset [.NET] | Windows::Foundation::DateTime [C++]

The end time of the usage window.

states

Type: NetworkUsageStates

The state of the connection profile for which usage data should be returned.

Return value

Type: IAsyncOperation<IVectorView>

When the method completes, it returns a list of AttributedNetworkUsage objects, which indicate the sent and received values, in bytes, and the total amount of time the app was connected during the corresponding time interval.

Remarks

Note  Data usage tracking is not supported when an app is run on the emulator under Microsoft Visual Studio 2013 Update 2 instead of an actual device. As a result, the GetAttributedNetworkUsageAsync method in a Windows Phone Store app will fail when run on the emulator.
 

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Networking.Connectivity
Windows::Networking::Connectivity [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Capabilities

networkDataPlanProvisioning

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

None supported

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.Networking.Connectivity
Windows::Networking::Connectivity [C++]

Metadata

Windows.winmd

Capabilities

networkDataPlanProvisioning

See also

ConnectionProfile

 

 

Show:
© 2015 Microsoft