Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to get unique id(like product id, imei,..) from mobiles, tablets, ipad's using qt?
QtWS25 Last Chance

How to get unique id(like product id, imei,..) from mobiles, tablets, ipad's using qt?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Ramkumar RammohanR Offline
    Ramkumar RammohanR Offline
    Ramkumar Rammohan
    wrote on last edited by
    #1

    I'm trying to get the unique key for mobile devices(ios, android). I first tried jni method for android call Telephony Manager from java but it fails, Is there any ways to find the unique that may be of any kind but unique for every devices.
    This the method i used

        private String id()
        {
            System.out.println("device id....");
            TelephonyManager mTelephonyMgr;
            mTelephonyMgr = (TelephonyManager)
                getSystemService(Context.TELEPHONY_SERVICE);
                System.out.println("getting device id...."+mTelephonyMgr.getDeviceId());
                return mTelephonyMgr.getDeviceId();
        }
    

    but it fails to return one the first time i call this function it didn't give ant reply when i call it next time the app crashes with the error: art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: JNI NewString called with pending exception 'java.lang.RuntimeException' thrown in unknown throw location.

    Help me to found some methods that to get the unique id's.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      The QtSystems module might be what you need. However I'm not sure whether the mobile targets are already supported.

      Hope it helps

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • Ramkumar RammohanR Offline
        Ramkumar RammohanR Offline
        Ramkumar Rammohan
        wrote on last edited by
        #3

        @SGaist Thanks for your suggestion.
        I did some minor mistake. The above method i used had some instance creation problem. Now the telephonyManager works fine get IMEI using JNI for android devices. But for ios i'm not able to get IMEI.
        And i also ref QtSystems module but it may seems that only support for Linux, Windows, mac devices not for mobile platforms...
        Suggest some concepts for ios mobiles and ipad that works same like jni used for android.
        Hope to solve this.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kolegs
          wrote on last edited by
          #4

          It is not possible for iOS. You should consider using user authorization.

          http://stackoverflow.com/questions/24753537/unique-identification-of-ios-device-for-ios-7-0-and-above

          1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            This article explains the various options you have.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved