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. QML PositionSource: PositionSource requires the Symbian Location capability

QML PositionSource: PositionSource requires the Symbian Location capability

Scheduled Pinned Locked Moved Mobile and Embedded
10 Posts 3 Posters 5.9k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    ronak.rks
    wrote on last edited by
    #1

    Hi,

    I have the following code in QML to extract the user location:

    @
    PositionSource{
    id: positionSource
    updateInterval: 1000
    active: true
    onActiveChanged: {
    console.log("Active Changed called")
    }

        onPositionChanged: {
            console.log(position.coordinate.latitude)
        }
    }
    

    @

    The code works absolutely fine on the QT Simulator. But when i deploy it on my Nokia C7 i get the following error:
    [Qt Message] QGeoPositionInfoSource::createDefaultSource() requires the Symbian Location capability to succeed on the Symbian platform.
    [Qt Message] <Unknown File>: QML PositionSource: PositionSource requires the Symbian Location capability to succeed on the Symbian platform.

    Please help me out and do let me know what does this error mean (because the Maps application on my phone is working fine) and how to resolve it.

    Thanks in advance
    Ronak

    [EDIT: code formatting, please wrap in @-tags, Volker]

    1 Reply Last reply
    0
    • A Offline
      A Offline
      axjensen
      wrote on last edited by
      #2

      Try adding Location capability to your .pro file and remember to run qmake again (or clean all).

      1 Reply Last reply
      0
      • A Offline
        A Offline
        axjensen
        wrote on last edited by
        #3

        Maybe you have something similar to this in your .pro file:

        @

        Allow network access on Symbian

        symbian:TARGET.CAPABILITY += NetworkServices
        @

        Try modifying it to:

        @
        symbian:TARGET.CAPABILITY += NetworkServices Location
        @

        1 Reply Last reply
        0
        • R Offline
          R Offline
          ronak.rks
          wrote on last edited by
          #4

          Hi,

          I modified the value to the following:
          @symbian:TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location@

          Now i do not get that error :)

          But onPositionChanged event (of PositionSource) never gets called on my device (Nokia C7). The code works like charm on the Simulator though.

          Please advice..

          Thanks
          Ronak

          1 Reply Last reply
          0
          • A Offline
            A Offline
            axjensen
            wrote on last edited by
            #5

            I have no experience in QML code, so can you explain me how you listen to "events" in your code? Do you have to somehow register to the events like you do with the connect method i Qt /C++ ?

            I have noticed, that listening to events might somehow timeout if getting a lock on gps position takes too long. You can test for this in the following manner:

            Open an app on your device, that sets up gps. This could be Nokia maps or in my case a standard gps tracker. When this app shows you, that you are receiving gps updates (or even shows you the status of the satellites in use) then launch your own application. This way you avoid waiting a long time for getting a lock on gps.

            If this works, I might be able to help further. If not, there might be a problem elsewhere in your code and it would help to see more code.

            1 Reply Last reply
            0
            • A Offline
              A Offline
              axjensen
              wrote on last edited by
              #6

              [quote author="ronak.rks" date="1325755333"]

              @symbian:TARGET.CAPABILITY += LocalServices ReadUserData WriteUserData NetworkServices UserEnvironment Location@

              [/quote]

              I would stick to only NetworkServices and Location, until the others are needed.

              1 Reply Last reply
              0
              • H Offline
                H Offline
                hoanghua
                wrote on last edited by
                #7

                @ronak.rks: hi, have you had any progress on fixing this? I'm facing the same problem. PositionSource QML element seems never to be able to get the current location.

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  axjensen
                  wrote on last edited by
                  #8

                  Have you tried to have another GPS application acquire an lock on GPS position and then letting your application run there after (not shutting the other application down)?

                  1 Reply Last reply
                  0
                  • H Offline
                    H Offline
                    hoanghua
                    wrote on last edited by
                    #9

                    hi axjensen, i've tried to have Map application running until it can locate my location properly, then open my app w/o closing Map application. But still no luck so far. Thanks

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      axjensen
                      wrote on last edited by
                      #10

                      There's an example in the documentation, 'Declarative Location Flickr'. Have you tried running that? Does it work?

                      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