Skip to content

Instantly share code, notes, and snippets.

View idrisbohra's full-sized avatar

Idris Bohra idrisbohra

  • Dubai, United Arab Emirates
View GitHub Profile
@idrisbohra
idrisbohra / Device.java
Last active October 13, 2020 08:51 — 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".
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() {