Skip to content

Instantly share code, notes, and snippets.

Avatar

Idris Bohra idrisbohra

  • Dubai, United Arab Emirates
View GitHub Profile
@idrisbohra
idrisbohra / Device.java
Last active Oct 13, 2020 — forked from flawyte/Device.java
How to get an Android device's serial number, visible to the user in "Settings > About phone/tablet/device > Status > Serial number".
View Device.java
import android.os.Build;
import java.lang.reflect.Method;
public class Device {
/**
* @return The device's serial number, visible to the user in {@code Settings > About phone/tablet/device > Status
* > Serial number}, or {@code null} if the serial number couldn't be found
*/
public static String getSerialNumber() {