Hi, I'm trying to use the location APIs on a N8 (using Symbian Belle). The app works great on the emulator, but it never resolves positions on the device. As far as I can see, the device can locate, since the Maps App can easily find my position when I use it.
My .pro file contains:
And I'm using the following QML to get the position:Code:symbian { TARGET.UID3 = *redacted* TARGET.CAPABILITY = Location LocalServices ReadUserData NetworkServices UserEnvironment WriteUserData } QT += network mobility CONFIG += mobility qt-components MOBILITY = systeminfo location
I also tried to get the position using C++. I created a class that I call on main to handle this, and I always get exactly one timeout message on the output. The relevant code is:Code:PositionSource { id: positionSource active: true updateInterval: 5000 onPositionChanged: { console.log(positionSource.position.coordinate.latitude, positionSource.position.coordinate.longitude); } }
Does anyone have any idea why this isnt working?Code:void QMLGeoServiceProvider::init() { source = QGeoPositionInfoSource::createDefaultSource(this); if (source == NULL) { qDebug() << "Cant get a position source. RUN!"; } else { qDebug() << "connecting stuff"; connect(source, SIGNAL(positionUpdated(QGeoPositionInfo)), this, SLOT(positionUpdate(QGeoPositionInfo))); connect(source, SIGNAL(updateTimeout()), this, SLOT(updateTimeout())); source->setPreferredPositioningMethods(QGeoPositionInfoSource::AllPositioningMethods); source->setUpdateInterval(1000); source->startUpdates(); source->requestUpdate(); } } void QMLGeoServiceProvider::updateTimeout() { qDebug() << "Failed to update the position"; } void QMLGeoServiceProvider::positionUpdate(QGeoPositionInfo info) { qDebug() << "Yay!"; }
Thanks,
Juan





