It's very very dificult to develop an Mobile APP for Nokia with QtMobility! Any one help me pls!



  • Thank you!
    I'm a beginer QT, I'm a C#,MS C++, SQL server, Oracle develper for a long time
    I've spend 6 days to install and configure Nokia QT SDT, QTMobility.
    I have 2 computer,I've installed Nokia QT SDK, QtMobility, Active perl, CarbIDE.c++
    on all of them:
    On my mobile phone I've installed:
    1.QT for symbian
    2.QTMobility for symbian
    3.TRK
    4.SQLIte

    My project work on 1 computer, on other Computer my app not work. if i desable QtMobility, my app work fine. (The app have

    some line of codes)

    Alot of error happend:
    1.Requested application not granted

    1. No such file or directory ....
    2. OS-Related Error
    3. Include..... not found

    I think, Nokia may be release install package for different platform (Ex: Windows, Unix, Linux )
    each palatform need only one install package (All in one) and simple guid to install.
    The same project, the same computer, some time it work, another time it not work, I don't know
    what's happend.
    Here is my code:
    @
    //-----------------
    untitled.pro

    QT += core gui
    TARGET = untitled
    TEMPLATE = app
    SOURCES += main.cpp
    mainwindow.cpp
    smslib.cpp
    HEADERS += mainwindow.h
    smslib.h
    FORMS += mainwindow.ui
    CONFIG += mobility
    MOBILITY = systeminfo messaging
    symbian {
    TARGET.UID3 = 0xeac1efb9
    TARGET.CAPABILITY=NetworkServices
    LocalServices
    ReadUserData
    WriteUserData
    UserEnvironment
    ReadDeviceData
    WriteDeviceData
    TARGET.EPOCSTACKSIZE = 0x14000
    TARGET.EPOCHEAPSIZE = 0x020000 0x800000
    }
    }
    //-----------------------------
    mainwindow.h
    //-----------------
    #ifndef MAINWINDOW_H
    #define MAINWINDOW_H

    #include <QMainWindow>
    #include <QString>
    namespace Ui {
    class MainWindow;
    }

    class MainWindow : public QMainWindow
    {
    Q_OBJECT

    public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    void setText(QString text);
    void setMsgContent(QString text);
    private:
    Ui::MainWindow *ui;
    };

    #endif // MAINWINDOW_H

    smslib.h

    #ifndef SMSLIB_H
    #define SMSLIB_H
    #include <QMessageManager>
    #include <QMessage>
    #include <QMessageAccount>
    #include <QMessageAccountId>
    #include <qmessageservice.h>
    #include <QMessageFilter>
    #include <QMessageSortOrder>
    #include <QMessageId>
    QTM_USE_NAMESPACE
    class smslib
    {
    public:
    smslib();
    QString readSMS();
    bool sendSMS(QString number,QString textContent);
    private:
    ~smslib();
    };

    #endif // SMSLIB_H

    smslib.cpp

    #include "smslib.h"

    smslib::smslib()
    {
    }
    QString smslib::readSMS()
    {
    QString retVal("Msg content:");
    // Match all messages whose status field includes the Incoming flag
    QMessageFilter filter(QMessageFilter::byStandardFolder(QMessage::InboxFolder));
    //QMessageFilter filter(QMessageFilter::byStatus(QMessage::Incoming));
    // Order the matching results by their reception timestamp, in descending order
    QMessageSortOrder sortOrder(QMessageSortOrder::byReceptionTimeStamp(Qt::DescendingOrder));
    // Acquire a handle to the message manager
    QMessageManager manager;

    // Find the matching message IDs, limiting our results to a managable number
    const int max = 100;
    const QMessageIdList matchingIds(manager.queryMessages(filter, sortOrder, max));
    // Retrieve each message
    foreach (const QMessageId &id, matchingIds) {
        QMessage message(manager.message(id));
        retVal.append(message.content());
    }
    return retVal;//
    

    }

    mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"

    MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
    {
    ui->setupUi(this);
    }

    MainWindow::~MainWindow()
    {
    delete ui;
    }
    void MainWindow::setText(QString text)
    {
    ui->lbl_msgSubject->setText(text);
    }
    void MainWindow::setMsgContent(QString text)
    {
    ui->lbl_msgContent->setText(text);
    }

    main.cpp

    #include <QtGui/QApplication>
    #include "mainwindow.h"
    #include <QSystemInfo>
    #include <QMessage>
    #include "smslib.h"
    QTM_USE_NAMESPACE
    int main(int argc, char *argv[])
    {
    QApplication a(argc, argv);
    MainWindow w;
    QMessage *msg = new QMessage();
    msg->setSubject("From chu viet hung");
    w.setText(msg->subject());
    smslib *lib = new smslib();
    w.setMsgContent(lib->readSMS());
    #if defined(Q_WS_S60)
    w.showMaximized();
    #else
    w.show();
    #endif

    return a.exec&#40;&#41;;
    

    }

    -----------------@





  • Thank you!
    Yes. I follow this guid "Important Update on Qt Mobility 1.1.0 Beta Package" to fix bug. but my app doesn't work.
    I'm very tired



  • Hello,

    Let's look at how you've handled signing. All mobile phone platforms require apps to be signed. Symbian breaks capabilities into a few categories (click "here ":http://developer.symbian.org/wiki/index.php/Capabilities_(Symbian_Signed) for more detail ). Most of the capabilities you reference are user grantable. ReadDeviceData and WriteDeviceData are not. They are system capabilities which require a different kind of signing ( click "here ":http://developer.symbian.org/wiki/index.php/Category:Symbian_Signed for more detail ).

    -jk



  • Thanks you!
    I did that. It's OK.
    Thanks a lot!


Log in to reply
 

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