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. Getting android device name

Getting android device name

Scheduled Pinned Locked Moved Mobile and Embedded
9 Posts 3 Posters 4.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.
  • C Offline
    C Offline
    carlinski
    wrote on last edited by
    #1

    I currently use this to get the local machine name:

    @QHostInfo::localHostName();@

    Works fine on a desktop computer but on an Android device it just returns "localhost"

    I am after the Device name listed under "About device" in Settings. Which on mine is set as SamsungTab3.

    Ideally would like a solution that will work for both Android and iOS.

    Thanks, Carl

    1 Reply Last reply
    0
    • S Offline
      S Offline
      StephaneC
      wrote on last edited by
      #2

      Did you find any solution for this?
      I'm also interested in the answer.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        StephaneC
        wrote on last edited by
        #3

        Did you find any solution for this?
        I'm also interested in the answer.

        1 Reply Last reply
        0
        • C Offline
          C Offline
          carlinski
          wrote on last edited by
          #4

          No, I never did get a solution, sorry. Could still use it if you do find anything.

          1 Reply Last reply
          0
          • C Offline
            C Offline
            carlinski
            wrote on last edited by
            #5

            No, I never did get a solution, sorry. Could still use it if you do find anything.

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

              Hi,

              You would need to use "this":http://developer.android.com/reference/android/os/Build.html through QtAndroidExtras JNI classes

              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
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Hi,

                You would need to use "this":http://developer.android.com/reference/android/os/Build.html through QtAndroidExtras JNI classes

                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
                • C Offline
                  C Offline
                  carlinski
                  wrote on last edited by
                  #8

                  OK, will give that a go when I need it. Thanks.

                  1 Reply Last reply
                  0
                  • C Offline
                    C Offline
                    carlinski
                    wrote on last edited by
                    #9

                    OK, will give that a go when I need it. Thanks.

                    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