I need to get a serial number of device

  • Good day for all. Sorry any error on my english, but, my natural language is spanish. I have started to program in qt target to android early, then I have a personal project that need to get a serial number of the device, any cell or table. The problem is that I don't have idea about how to do that. Thanks any suggestion or advise.

  • @zealot2 what about this? Please note this is Java code (place it in your Android activity)::

     public static String getDeviceId(Context context) {
        final String deviceId = ((TelephonyManager)
        if (deviceId != null) {
            return deviceId;
        } else {
            return android.os.Build.SERIAL;

    taken from here

  • You can also have a look at V-Play Engine, which offers to access device information such as model identifier or a unique device id.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.