Tuesday, March 29, 2011 01:24 am
David Laing writes:
> On 03/28/2011 07:45 PM, ext Harri Pasanen wrote:
> > I went for a walk with a real device, E7, in offline mode, not even a SIM
> > card is installed.
> >
> > After Nokia Maps picked my location via GPS, it took a while before
> > lastKnownPosition() started returning the new locations, like tens of
> > seconds.
> >
> > I have a button in UI that calls this snippet of code:
> >
> > if (_posSource) {
> >
> > _posSource->requestUpdate(0);
> > QGeoPositionInfo pos = _posSource->lastKnownPosition();
> > if (pos.coordinate().isValid()) {
> >
> > // came here all the time, but position timestamp and coordinates where
> >
> > // for
> >
> > ....
> >
> > Qt 4.6.3, Mobility 1.0.2
> >
> > So any idea why there is this delay in updating lastKnownPosition, even
> > after the hardware obviously has a GPS fix?
> >
> > Thanks,
> >
> >
> > Harri
> > http://mpaja.com/
>
> Hi,
>
> The pause is probably because you're calling lastKnownPosition before
> the Location API has a first position.
>
> It's the last known position reported to the current application which
> means it will have to get a fix and what for a position to come in if
> the app hasn't done that already.
>
> That's not really how it's meant to be used so it might not be the most
> efficient.
>
> Do things improve if you connect the positionUpdated signal of
> QGeoPositionInfoSource to a slot? I.e. if your button would just call
> _posSource->requestUpdate(0);
> and the slot handles the position info when it comes in.
>
> Cheers,
>
> Dave
I'm continuing testing, but results are a bit inconclusive as yet.
Are you sure it is the last known position reported to the current
application, or globally on the device? Why would it be application specific,
and where would that be stored in that case?
Also it would seem to me that mobility has sometimes trouble waking up the
GPS, in that I get no position updates at all, unless I "prime" it by running
Nokia Maps first. Would that be possible, or does it sound hogwash?
A bit unrelated question: On Symbian, if I've installed qt 4.7 and qt
mobility 1.1.1 from QtSDK 1.1beta, but my application is compile with 4.6.3,
mobility 1.0.2, which version gets used? Are they side-by-side or does 4.7
replace 4.6 on phone?
Thanks,
Harri
_______________________________________________
Qt-mobility-feedback mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-mobility-feedback