Xamarin Android Device Serial Number

-->

I need to get the Serial Number from the Android Device. In Java i was supposed to get it with: android.os.build.serial But in Xamarin, i could not find it in: Android.OS.Build. Does this depend on a minimum android version or is there any other way to find this serial number? Thanks in regards.

The DeviceInfo class provides information about the device the application is running on.

Get started

To start using this API, read the getting started guide for Xamarin.Essentials to ensure the library is properly installed and set up in your projects.

Xamarin Android Device Serial NumberXamarin Android Device Serial Number

Using DeviceInfo

Add a reference to Xamarin.Essentials in your class:

The following information is exposed through the API:

C# Xamarin Android

Android

Platforms

DeviceInfo.Platform correlates to a constant string that maps to the operating system. The values can be checked with the DevicePlatform struct:

  • DevicePlatform.iOS – iOS
  • DevicePlatform.Android – Android
  • DevicePlatform.UWP – UWP
  • DevicePlatform.Unknown – Unknown

Idioms

DeviceInfo.Idiom correlates a constant string that maps to the type of device the application is running on. The values can be checked with the DeviceIdiom struct:

  • DeviceIdiom.Phone – Phone
  • DeviceIdiom.Tablet – Tablet
  • DeviceIdiom.Desktop – Desktop
  • DeviceIdiom.TV – TV
  • DeviceIdiom.Watch – Watch
  • DeviceIdiom.Unknown – Unknown

Device Type

DeviceInfo.DeviceType correlates an enumeration to determine if the application is running on a physical or virtual device. A virtual device is a simulator or emulator.

Is Kindle Fire An Android Device

Platform Implementation Specifics

iOS does not expose an API for developers to get the name of the specific iOS device. Instead a hardware identifier is returned such as iPhone10,6 which refers to the iPhone X. A mapping of these identifers are not provided by Apple, but can be found on The iPhone Wiki (a non-official source).

Xamarin Android Get Device Serial Number

API