Skip to content

Instantly share code, notes, and snippets.

View cassioseffrin's full-sized avatar

Cássio Seffrin cassioseffrin

View GitHub Profile
@cassioseffrin
cassioseffrin / Device.java
Created August 22, 2023 14:42 — forked from hormesiel/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() {