Platform-specific concepts

There are other concepts and network communication methods on Xamarin platforms that are provided by the native runtime and supported by Xamarin.

Permissions

In order for an Android or Windows Phone application to access Internet, the application manifest should declare that the application will need to use the network to access resources.

The permission on Android system is declared using the uses-permission tag in the manifest node of the XML file:

<uses-permission android:name="android.permission.INTERNET" />

While this declaration will suffice in most use case scenarios, in order to access the current network status or the Wi-Fi status, you must also declare the network state permissions:

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" ...

Get Xamarin: Cross-Platform Mobile Application Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.