×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Nov 2010
    Location
    Phnom Penh
    Posts
    33

    Cannot get GPS info from real Device(Nokia C7) using Qt Mobility

    Hi,

    I have create a Qt Mobility Project for getting Latitude and Longitude from Nokia Phone. In the Simulator, It can get info from GPS but when I deploy it onto the real Phone, it wait for it for a very long time and the GPS Info is still can't get from real phone.

    Please look at my project file(.pro)
    Code:
    #-------------------------------------------------
    #
    # Project created by QtCreator 2011-01-19T16:22:57
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    TARGET = LPALocation
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp
    
    HEADERS  += mainwindow.h
    
    FORMS    += mainwindow.ui
    
    CONFIG += mobility
    MOBILITY = location
    
    symbian {
        TARGET.UID3 = 0xe993305a
        TARGET.CAPABILITY += Location
        TARGET.EPOCSTACKSIZE = 0x14000
        TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }
    + header file(.h)

    Code:
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    #include "QGeoPositionInfoSource"
    #include <QMainWindow>
    
    QTM_USE_NAMESPACE
    
    namespace Ui {
        class MainWindow;
    }
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
    
    private:
        QGeoPositionInfoSource *m_location;
        QGeoCoordinate m_coordinate;
    
    private slots:
        void on_pushButton_clicked();
        void positionUpdated(QGeoPositionInfo gpsPos);
        void getLocation();
    
    private:
        Ui::MainWindow *ui;
    };
    
    #endif // MAINWINDOW_H
    + my Sources
    Code:
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include "QGeoPositionInfoSource"
    #include "QMessageBox"
    
        #include <qmobilityglobal.h>
        #include <qgeopositioninfosource.h>
        #include <qgeosatelliteinfosource.h>
        #include <qnmeapositioninfosource.h>
        #include <qgeopositioninfo.h>
    
    QTM_USE_NAMESPACE
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    void MainWindow::positionUpdated(QGeoPositionInfo gpsPos){
         m_coordinate = gpsPos.coordinate();
         if (m_coordinate.isValid()) {
                m_location->stopUpdates();
                QString longitude;
                QString latitude;
                longitude.setNum(m_coordinate.longitude());
                latitude.setNum(m_coordinate.latitude());
                QMessageBox::information(this,"Sending",longitude);
    
    
             }
         else {
                QMessageBox::information(this, "GPS Info", "Coordinator is not valid...");
              }
        }
    void MainWindow::getLocation(){
        m_location = QGeoPositionInfoSource::createDefaultSource(this);
    
                // Listen gps position changes
        QObject::connect(m_location, SIGNAL(positionUpdated(QGeoPositionInfo)), this,SLOT(positionUpdated(QGeoPositionInfo)));
    
                // Start listening GPS position updates
        m_location->startUpdates();
    
    }
    
    void MainWindow::on_pushButton_clicked()
    {
        getLocation();
    }
    Note:

    Environment that I use:
    Device : Nokia C7-00
    PC OS : Microsoft Windows XP SP3
    SDK : NokiaQtSDK v1.02

    Please help me.

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2009
    Posts
    4,326

    Re: Cannot get GPS info from real Device(Nokia C7) using Qt Mobility

    What is the version of Qt Mobility on the phone? There was a problem on Symbian with Location API in earlier versions. The latest released version is 1.0.2.

  3. #3
    Registered User
    Join Date
    Nov 2010
    Location
    Phnom Penh
    Posts
    33

    Re: Cannot get GPS info from real Device(Nokia C7) using Qt Mobility

    Quote Originally Posted by divanov View Post
    What is the version of Qt Mobility on the phone? There was a problem on Symbian with Location API in earlier versions. The latest released version is 1.0.2.
    I install Qt Mobility version 1.00(2) from the C:\NokiaQtSDK\Symbian\sis\qtmobility_1.0.2_for_n8.sis.
    ---
    Note : I don't install qt_installer.sis on that phone.

Similar Threads

  1. Nokia Qt SDK 1.0.2 and Mobility Location - can't get GPS lock
    By igor.sos in forum [Archived] Qt Mobility Project
    Replies: 2
    Last Post: 2010-12-27, 04:57
  2. Qt Mobility and GPS data
    By Miksa__ in forum [Archived] Qt Mobility Project
    Replies: 4
    Last Post: 2010-12-11, 10:49
  3. Not able to open Qt Mobility applications on Nokia N97 Device!
    By RajeevSahu in forum [Archived] Qt Mobility Project
    Replies: 12
    Last Post: 2010-07-23, 00:57
  4. Run mobility examples on real wm device
    By EraSER in forum [Archived] Qt Mobility Project
    Replies: 7
    Last Post: 2010-06-03, 04:58
  5. Unable to get the location info in real device
    By manojkumar.m in forum Mobile Java General
    Replies: 3
    Last Post: 2009-05-19, 08:36

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •