Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    GPS on Windows Phone 8.1 ? (solved)

    Mobile and Embedded
    3
    5
    1654
    Loading More Posts
    • 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.
    • J
      jea1768 last edited by

      I cannot make the GPS working on WindowsPhone 8.1 (Sensors are working)
      My code works well under Android but not under WP8.1.
      I'm using the latest Qt 5.4.0 - not clear if GPS is supported or not with WP8.1 ?

      Any idea how to access GPS with WP8.1 ?

      @
      QStringList services = QGeoPositionInfoSource::availableSources();
      source = QGeoPositionInfoSource::createDefaultSource(this);
      //source = QGeoPositionInfoSource::createSource(services.at(0), this); // services.at(0) = "winrt"

      if(source)
      {
          source->setPreferredPositioningMethods(QGeoPositionInfoSource::AllPositioningMethods);
          source->setUpdateInterval(2000);
          connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdated(QGeoPositionInfo)));
          source->startUpdates();
      }
      

      @

      [edit: added missing coding tags @ SGaist]

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        AFAIK the plugin is there so it should be working. You should take a look at the "bug report system":http://bugreports.qt-project.org to see if there's something there about that

        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 Reply Quote 0
        • J
          jea1768 last edited by

          No need of any plugin.

          just add
          <Capabilities>
          <DeviceCapability Name="location"/>
          </Capabilities>
          right after </Applications> tag in AppxManifest.xml.
          and it works.

          So, like Android, WP81 needs permissions to access devices.

          1 Reply Last reply Reply Quote 0
          • SGaist
            SGaist Lifetime Qt Champion last edited by

            The plugin is still needed (and present) otherwise you wouldn't get any data ;)

            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 Reply Quote 0
            • M
              mkalinow last edited by

              Youc an also specify the capabilities to be used inside the pro file, so that you do not need to manually update the Manifest each time. Check http://doc.qt.io/qt-5/qmake-variable-reference.html#winrt-manifest for more documentation.

              In that specific case add the following to your .pro file:

              WINRT_MANIFEST.capabilities_device = location

              1 Reply Last reply Reply Quote 0
              • First post
                Last post