QML PositionSource: PositionSource requires the Symbian Location capability



  • 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]



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



  • 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
    @



  • 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



  • 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.



  • [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.



  • @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.



  • 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)?



  • 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



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.