×

Discussion Board

Results 1 to 10 of 10
  1. #1
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    QSystemNetworkInfo doesen't run on E51

    Hello!

    I try to instanciate an QSystemNetworkInfo object to get some singal strength information.
    Everything works fine on the simulator, but as soon as I deploy my application to a Nokia E51 (latest firmware) the program starts and hangs up. The crash happens when I call

    Code:
    QSystemNetworkInfo *nwInfo = new QSystemNetworkInfo(this);
    I've installed the latest version of QT Creator including the Nokia Symbian SDK and installed the QT and QTMobility APIs from the installation on my phone.

    Does anybody know what I do wrong? Is there another QTMobility API available for the the E51? And if so, where can I get it?
    The information website of QTMobility says, that it should work on the E51. QSystemDeviceInfo - for example - makes no trouble at all.

    Thanks for help.

  2. #2
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QSystemNetworkInfo doesen't run on E51

    It should not crash. Would be nice to see a backtrace of a crash.
    As a workaround you can use static member
    http://doc.qt.nokia.com/qtmobility-1...SignalStrength

  3. #3
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    Re: QSystemNetworkInfo doesen't run on E51

    Quote Originally Posted by divanov View Post
    It should not crash. Would be nice to see a backtrace of a crash.
    As a workaround you can use static member
    http://doc.qt.nokia.com/qtmobility-1...SignalStrength
    Indeed. But I made the mistake to install the newest firmware on my E51, which doesn't allow me to install TRK . So I can't do any on-device debugging any more

    The workaround also crashes. It seems that I have generally a problem when accessing QSystemNetworkInfo API. I gurantee to have the QTMobility API installed on my device. At least the one that comes with the QT Creator + SDK bundle. I just figured out, that I have the exact same problem on a E71.

    I aprreciate any help or suggestions. Thx a lot.
    There's no other place than 127.0.0.1

  4. #4
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    Re: QSystemNetworkInfo doesen't run on E51

    Here's my test code. Maybe I'm doing something wrong. But as I said earlier, it runs flawless on the simulator.
    The program has some progress bars, which should show the current stats of the device signal strengthes.

    Project File
    Code:
    #-------------------------------------------------
    #
    # Project created by QtCreator 2010-07-22T15:55:00
    #
    #-------------------------------------------------
    
    QT       += core gui
    
    TARGET = SignalStats3
    TEMPLATE = app
    
    
    SOURCES += main.cpp\
            mainwindow.cpp
    
    HEADERS  += mainwindow.h
    
    FORMS    += mainwindow.ui
    
    CONFIG += mobility
    MOBILITY = systeminfo
    
    symbian {
        TARGET.UID3 = 0xe44d27ad
        # TARGET.CAPABILITY += 
        TARGET.EPOCSTACKSIZE = 0x14000
        TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }
    mainwindow.h
    Code:
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H
    
    #include <QtGui/QMainWindow>
    #include <qsysteminfo.h>
    
    namespace Ui {
        class MainWindow;
    }
    
    using namespace QtMobility;
    
    class MainWindow : public QMainWindow
    {
        Q_OBJECT
    
    public:
        explicit MainWindow(QWidget *parent = 0);
        ~MainWindow();
    
    private:
        Ui::MainWindow *ui;
        QSystemNetworkInfo *nwInfo;
    
        void mySetUp();
    
    private slots:
        void setSignalStrength(QSystemNetworkInfo::NetworkMode mode, int signalStrength);
    
    };
    
    
    #endif // MAINWINDOW_H
    mainwindow.cpp
    Code:
    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    #include <QSystemNetworkInfo>
    
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
        mySetUp();
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
        delete nwInfo;
    }
    
    void MainWindow::mySetUp()
    {
        nwInfo = new QSystemNetworkInfo();
    
      
        //Progress Bar inits
        ui->gsmProgressBar->setValue(nwInfo->networkSignalStrength(QSystemNetworkInfo::GsmMode));
        ui->cdmaProgressBar->setValue(nwInfo->networkSignalStrength(QSystemNetworkInfo::GsmMode));
        ui->wcdmaProgressBar->setValue(nwInfo->networkSignalStrength(QSystemNetworkInfo::GsmMode));
        ui->wlanProgressBar->setValue(nwInfo->networkSignalStrength(QSystemNetworkInfo::GsmMode));
        ui->btProgressBar->setValue(nwInfo->networkSignalStrength(QSystemNetworkInfo::GsmMode));*/
    
    
        //Triggers if ANY singal strength changes
        connect(nwInfo, SIGNAL(networkSignalStrengthChanged(QSystemNetworkInfo::NetworkMode,int)),
                this, SLOT(setSignalStrength(QSystemNetworkInfo::NetworkMode, int)));
    
    }
    
    
    /**************************    Slots    ***************************/
    
    void MainWindow::setSignalStrength(QSystemNetworkInfo::NetworkMode mode, int signalStrength)
    {
        switch(mode)
        {
        case QSystemNetworkInfo::GsmMode:
                this->ui->gsmProgressBar->setValue(signalStrength);
                break;
    
        case QSystemNetworkInfo::CdmaMode:
                this->ui->cdmaProgressBar->setValue(signalStrength);
                break;
    
        case QSystemNetworkInfo::WcdmaMode:
                this->ui->wcdmaProgressBar->setValue(signalStrength);
                break;
    
        case QSystemNetworkInfo::WlanMode:
                this->ui->wlanProgressBar->setValue(signalStrength);
                break;
    
        case QSystemNetworkInfo::BluetoothMode:
                this->ui->btProgressBar->setValue(signalStrength);
                break;
        }
    }
    There's no other place than 127.0.0.1

  5. #5
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QSystemNetworkInfo doesen't run on E51

    You forget .ui file.

  6. #6
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    Re: QSystemNetworkInfo doesen't run on E51

    here it is:

    mainwindow.ui
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <ui version="4.0">
     <class>MainWindow</class>
     <widget class="QMainWindow" name="MainWindow">
      <property name="geometry">
       <rect>
        <x>0</x>
        <y>0</y>
        <width>161</width>
        <height>147</height>
       </rect>
      </property>
      <property name="windowTitle">
       <string>MainWindow</string>
      </property>
      <widget class="QWidget" name="centralWidget">
       <layout class="QGridLayout" name="gridLayout">
        <item row="0" column="0">
         <widget class="QLabel" name="label">
          <property name="text">
           <string>GSM:</string>
          </property>
         </widget>
        </item>
        <item row="0" column="1">
         <widget class="QProgressBar" name="gsmProgressBar">
          <property name="value">
           <number>24</number>
          </property>
         </widget>
        </item>
        <item row="1" column="0">
         <widget class="QLabel" name="label_2">
          <property name="text">
           <string>CDMA:</string>
          </property>
         </widget>
        </item>
        <item row="1" column="1">
         <widget class="QProgressBar" name="cdmaProgressBar">
          <property name="value">
           <number>24</number>
          </property>
         </widget>
        </item>
        <item row="2" column="0">
         <widget class="QLabel" name="label_3">
          <property name="text">
           <string>WCDMA:</string>
          </property>
         </widget>
        </item>
        <item row="2" column="1">
         <widget class="QProgressBar" name="wcdmaProgressBar">
          <property name="value">
           <number>24</number>
          </property>
         </widget>
        </item>
        <item row="3" column="0">
         <widget class="QLabel" name="label_4">
          <property name="text">
           <string>WLAN:</string>
          </property>
         </widget>
        </item>
        <item row="3" column="1">
         <widget class="QProgressBar" name="wlanProgressBar">
          <property name="value">
           <number>24</number>
          </property>
         </widget>
        </item>
        <item row="4" column="0">
         <widget class="QLabel" name="label_5">
          <property name="text">
           <string>BT:</string>
          </property>
         </widget>
        </item>
        <item row="4" column="1">
         <widget class="QProgressBar" name="btProgressBar">
          <property name="value">
           <number>24</number>
          </property>
         </widget>
        </item>
       </layout>
      </widget>
     </widget>
     <layoutdefault spacing="6" margin="11"/>
     <resources/>
     <connections/>
    </ui>
    There's no other place than 127.0.0.1

  7. #7
    Super Contributor
    Join Date
    Oct 2009
    Posts
    4,326

    Re: QSystemNetworkInfo doesen't run on E51

    I've changed a bit your application. It's running fine on N900.
    http://www.mediafire.com/file/lca5g4...teminfo.tar.gz

  8. #8
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    Re: QSystemNetworkInfo doesen't run on E51

    First of all: Thank you for your efforts! I really appreciate that.

    I've changed the program to your solution, but it's still freezing as soon as it calls QSystemNetworkInfo the first time.
    I did not change my build configuration and I'm using the standard installation of the Qt for Symbian IDE.

    I post some more details... maybe you'll find the problem with your experience. However: Thanks a lot!

    Build output when compiling for the E51 device: (it differs from simulator output)
    http://cyphorious.net/work/compiler-output.txt

    Installed APIs on my Nokia E51
    Code:
    Open C LIBSSL
    Standard C++ library
    Symbian OS Pipes
    Symbian OS PIPS
    Standard C++ library Common
    Open C CLIBSSL Common
    PIPS Installer
    App TRK
    OpenC LIBZ Support Files
    Qt
    Qt Installer
    Signal Server
    QtWebKit
    QtMobility
    sqlite3
    Maybe it's interesting to know that the Qt Designer "underlines" all code lines with QSystemNetworkInfo (like it does with unkown libraries and errors) as soon as I change the build configuration from simulator to device.

    Again: Thanks a lot.
    There's no other place than 127.0.0.1

  9. #9
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    Re: QSystemNetworkInfo doesen't run on E51

    I just found this thread: http://discussion.forum.nokia.com/fo...246#post762246

    Could it be that I need to sign my .sis so that it the app doesn't hangs up everytime I access QSystemNetworkInfo::whatever() ?
    I can't really beliefe it, cause I just want to test the app on my phone... and signing before each test run sounds like a little security overkill?
    There's no other place than 127.0.0.1

  10. #10
    Registered User
    Join Date
    Jul 2010
    Location
    Vienna
    Posts
    22

    Re: QSystemNetworkInfo doesen't run on E51

    If anybody rans into the same problem: here's the answer: http://wiki.forum.nokia.com/index.php/ReadDeviceData
    There's no other place than 127.0.0.1

Similar Threads

  1. QSystemNetworkInfo hangs application
    By ceptad in forum [Archived] Qt Mobility Project
    Replies: 4
    Last Post: 2010-07-29, 15:03
  2. Replies: 7
    Last Post: 2010-07-06, 14:03
  3. how to run open c/c++ on nokia e51
    By ismithx in forum Open C/C++
    Replies: 10
    Last Post: 2009-07-10, 18:04
  4. My application run perfectly on Emulator but can't run on mobile device (Socket)
    By x1054 in forum Mobile Java Networking & Messaging & Security
    Replies: 5
    Last Post: 2005-11-07, 21:12

Posting Permissions

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