networking - Windows Phone access NetworkUsage -


I'm wondering if it is possible to obtain network access from a Windows Phone app. I know that it is possible in Android and iOS

For WP, I searched the documents to find this category: Windows.Networking.Connectivity () From there I < Code> NetworkUsage class has been retrieved:

  • byte reassid : read-only - bytes received by connection of specific period Indicates the number of.
  • Bytext : read-only - indicates the number of bytes sent by the connection during a specific period.
  • Duration of connection : read-only - indicates the duration of connectivity.

But as I am not a WP developer, I do not understand whether this is a public API or not ... any suggestions?

This is public:

C # examples working here:

  // set and time now var currTime = date time.Now; // Set the start time from the start time of the current time time starttime = currTime - timepan. Frosthur (1); // Get the Connection Profile that is currently used to connect to the Internet diverse connection. Profile = Network Information GetInternetConnectionProfile (); Var localUsage = Wait for connectionProfile.Net NetworkUsagesSync (Starttime, Curtimes, DataUJjourity, New NetworkExposition ()); Foreach (different uses in localUsage) {Debug.WriteLine ("Local data usage: \ n \ r" + "Byte is sent:" + use.BytesSent + "\ n \ r" + "Received Bytes:" + use. BytesReceived + "\ n \ r"); }  

gives me:

Local data usage:
Bytes Sent: 757658 < / Code>
received bytes: 917693


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -