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. [QtSystemInfo] [QDeviceInfo] can't use this on Android

[QtSystemInfo] [QDeviceInfo] can't use this on Android

Scheduled Pinned Locked Moved Mobile and Embedded
14 Posts 4 Posters 6.6k 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.
  • F Offline
    F Offline
    FrankiPL
    wrote on last edited by
    #5

    Hi,

    Sorry for late answer.
    I'm running Android 4.1, I'm developing on Linux.
    Getting IMEI is pretty straightforward:
    @
    sysInfo=new QDeviceInfo(this);
    qDebug()<<"NetManager::NetManager imei:"<<sysInfo->imei(0)
    @

    If you know any other way to get unique phone id or sim card id, please tell me.

    best regards
    Marek

    1 Reply Last reply
    0
    • metaDomM Offline
      metaDomM Offline
      metaDom
      wrote on last edited by
      #6

      Could you explain how to build the addon module on windows?

      thanks in advance

      @C:\Qt\5.3\Src\qt-qtsystems>qmake
      Info: creating cache file C:\Qt\5.3\Src\qt-qtsystems.qmake.cache
      Checking for gconf... no
      Checking for bluez... no
      Checking for udev... no
      Checking for x11... no

      C:\Qt\5.3\Src\qt-qtsystems>make
      Makefile:162: *** multiple target patterns. Stop.@

      Line 162:

      @Makefile: qtsystems.pro .qmake.conf .qmake.cache C:/Qt/5.3/mingw482_32/mkspecs/win32-g++/qmake.conf C:/Qt/5.3/mingw482_32/mkspecs/features/spec_pre.prf @

      1 Reply Last reply
      0
      • F Offline
        F Offline
        FrankiPL
        wrote on last edited by
        #7

        On windows, I don't know. I'm developing on Linux and it was easy:

        franki@franki:~/Qt/5.3/Src/qtsystems$ ../../gcc_64/bin/qmake
        franki@franki:~/Qt/5.3/Src/qtsystems$ make
        franki@franki:~/Qt/5.3/Src/qtsystems$ make install

        1 Reply Last reply
        0
        • metaDomM Offline
          metaDomM Offline
          metaDom
          wrote on last edited by
          #8

          hmm too bad, anyone else got a successful compilation on windows?

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mr_wallyit
            wrote on last edited by
            #9

            Hello,

            I tried with Qt 5.3.0 but is doesn't work, I have a lot of error when it compile.

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

              What OS ?

              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
              • M Offline
                M Offline
                mr_wallyit
                wrote on last edited by
                #11

                Hello,

                I use Windows 8.1 (Italian version) with Qt creator 3.1.1 and Qt 5.3.0 (MingW32)

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

                  What error message are you getting ?

                  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
                  • M Offline
                    M Offline
                    mr_wallyit
                    wrote on last edited by
                    #13

                    Hello,
                    this is step by step:

                    I copied qt-qtsystems in C:\Qt\Qt5.3.0\Examples\Qt-5.3

                    run QtCreator and open the “ qtsystems.pro” project file

                    get to “Projects->(Your Kit)->Build->Build Steps”

                    add a new make “Build Step” and write to the “Make arguments” the install target

                    from the menus, select “Rebuild Project qtserialport”

                    Path desn't found
                    Error while parsing file C:/Qt/Qt5.3.0/Examples/Qt-5.3/qt-qtsystems/src/imports/publishsubscribe/publishsubscribe.pro. Giving up.
                    Error while parsing file C:/Qt/Qt5.3.0/Examples/Qt-5.3/qt-qtsystems/src/imports/serviceframework/serviceframework.pro. Giving up.
                    Error while parsing file C:/Qt/Qt5.3.0/Examples/Qt-5.3/qt-qtsystems/src/imports/systeminfo/systeminfo.pro. Giving up.
                    Error while parsing file C:/Qt/Qt5.3.0/Examples/Qt-5.3/qt-qtsystems/src/publishsubscribe/publishsubscribe.pro. Giving up.
                    Error while parsing file C:/Qt/Qt5.3.0/Examples/Qt-5.3/qt-qtsystems/src/serviceframework/serviceframework.pro. Giving up.
                    Error while parsing file C:/Qt/Qt5.3.0/Examples/Qt-5.3/qt-qtsystems/src/systeminfo/systeminfo.pro. Giving up.
                    Project ERROR: Project has no top-level .qmake.conf file.
                    Project ERROR: Project has no top-level .qmake.conf file.
                    Project ERROR: Project has no top-level .qmake.conf file.
                    Project WARNING: You should probably load(qt_build_config) first in publishsubscribe.pro for QtPublishSubscribe, as the latter also load()s qt_module.
                    Project MESSAGE: Not doing so may lead to qt_module.prf overriding compiler/linker options in your .pro file.
                    Project MESSAGE: Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.
                    Project ERROR: Module does not define version.
                    Project WARNING: You should probably load(qt_build_config) first in serviceframework.pro for QtServiceFramework, as the latter also load()s qt_module.
                    Project MESSAGE: Not doing so may lead to qt_module.prf overriding compiler/linker options in your .pro file.
                    Project MESSAGE: Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.
                    Project ERROR: Module does not define version.
                    Project WARNING: You should probably load(qt_build_config) first in systeminfo.pro for QtSystemInfo, as the latter also load()s qt_module.
                    Project MESSAGE: Not doing so may lead to qt_module.prf overriding compiler/linker options in your .pro file.
                    Project MESSAGE: Ignore this warning with CONFIG+=no_qt_module_warning if you know what you are doing.
                    Project ERROR: Module does not define version.
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: publishsubscribe
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework-private serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework-private serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework-private serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework-private serviceframework
                    Project ERROR: Unknown module(s) in QT: serviceframework
                    Project ERROR: Unknown module(s) in QT: systeminfo
                    Project ERROR: Unknown module(s) in QT: systeminfo
                    Project ERROR: Unknown module(s) in QT: systeminfo

                    When i build the project I don't have error, but the In the my project Android
                    I have this Error:

                    C:\Users\pc\qt-project\Booking\main.cpp:50: error: 'QDeviceInfo' was not declared in this scope
                    QDeviceInfo sysInfo=new QDeviceInfo(this);
                    ^
                    I tried with this source code:

                    QDeviceInfo sysInfo=new QDeviceInfo(this);
                    qDebug()<<"NetManager::NetManager imei:"<<sysInfo->imei(0);
                    

                    Thanks

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

                      First thing, it's not an example, it's a Qt module, you should rather place it in the same source path as e.g. qtbase.

                      Like I wrote before, it's not yet implemented for Android

                      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