Skip to content

Instantly share code, notes, and snippets.

View JichunMa's full-sized avatar
🎯
Focusing

TwoDogSon JichunMa

🎯
Focusing
  • BeiJing,China
View GitHub Profile
@flawyte
flawyte / Device.java
Last active April 7, 2024 15:28
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() {