Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

125
Views
NetworkInterface.NetworkInterfaceType Property Always Returns 0 On Android

I'm building an application for personal use and I need to list all network interfaces' IP addresses and types.

I use the following code:

foreach (var networkInterface in NetworkInterface.GetAllNetworkInterfaces())
{
    foreach (var addressInfo in networkInterface.GetIPProperties().UnicastAddresses)
    {
        // Add the following string to a list and then display this list        
        var info = $"{addressInfo.Address}: {networkInterface.NetworkInterfaceType} ({Enum.GetName(typeof(NetworkInterfaceType), networkInterface.NetworkInterfaceType)})";
    }
}

The code above works fine on Windows but when I build and run it on Android networkInterface.NetworkInterfaceType always returns 0 and Enum.GetName(typeof(NetworkInterfaceType), networkInterface.NetworkInterfaceType) returns an empty string.

This behavior can be reproduced in applications built with Unity and Xamarin (even though the application has all the required permissions granted).

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!