Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

123
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda