October 6, 2010

hungchuviet hungchuviet
Lab Rat
16 posts

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
2. No such file or directory ….
3. OS-Related Error
4. 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:

  1. //-----------------
  2. untitled.pro
  3. --------------
  4. QT       += core gui
  5. TARGET = untitled
  6. TEMPLATE = app
  7. SOURCES += main.cpp\
  8.         mainwindow.cpp \
  9.      smslib.cpp
  10. HEADERS  += mainwindow.h \
  11.     smslib.h
  12. FORMS    += mainwindow.ui
  13. CONFIG += mobility
  14. MOBILITY = systeminfo messaging
  15. symbian {
  16.     TARGET.UID3 = 0xeac1efb9
  17.     TARGET.CAPABILITY=NetworkServices \
  18.             LocalServices \
  19.             ReadUserData \
  20.             WriteUserData \
  21.             UserEnvironment \
  22.             ReadDeviceData \
  23.             WriteDeviceData
  24.     TARGET.EPOCSTACKSIZE = 0x14000
  25.     TARGET.EPOCHEAPSIZE = 0x020000 0x800000
  26. }
  27. }
  28. //-----------------------------
  29.  mainwindow.h
  30. //-----------------
  31. #ifndef MAINWINDOW_H
  32. #define MAINWINDOW_H
  33.  
  34. #include <QMainWindow>
  35. #include <QString>
  36. namespace Ui {
  37.     class MainWindow;
  38. }
  39.  
  40. class MainWindow : public QMainWindow
  41. {
  42.     Q_OBJECT
  43.  
  44. public:
  45.     explicit MainWindow(QWidget *parent = 0);
  46.     ~MainWindow();
  47.     void setText(QString text);
  48.     void setMsgContent(QString text);
  49. private:
  50.     Ui::MainWindow *ui;
  51. };
  52.  
  53. #endif // MAINWINDOW_H
  54. ---------------------
  55. smslib.h
  56. -------------
  57. #ifndef SMSLIB_H
  58. #define SMSLIB_H
  59. #include <QMessageManager>
  60. #include <QMessage>
  61. #include <QMessageAccount>
  62. #include <QMessageAccountId>
  63. #include <qmessageservice.h>
  64. #include <QMessageFilter>
  65. #include <QMessageSortOrder>
  66. #include <QMessageId>
  67. QTM_USE_NAMESPACE
  68. class smslib
  69. {
  70. public:
  71.     smslib();
  72.     QString readSMS();
  73.     bool sendSMS(QString number,QString textContent);
  74. private:
  75.     ~smslib();
  76. };
  77.  
  78. #endif // SMSLIB_H
  79. --------------------
  80. smslib.cpp
  81. -----------------------
  82. #include "smslib.h"
  83.  
  84. smslib::smslib()
  85. {
  86. }
  87. QString smslib::readSMS()
  88. {
  89.     QString retVal("Msg content:");
  90.     // Match all messages whose status field includes the Incoming flag
  91.     QMessageFilter filter(QMessageFilter::byStandardFolder(QMessage::InboxFolder));
  92.     //QMessageFilter filter(QMessageFilter::byStatus(QMessage::Incoming));
  93.     // Order the matching results by their reception timestamp, in descending order
  94.     QMessageSortOrder sortOrder(QMessageSortOrder::byReceptionTimeStamp(Qt::DescendingOrder));
  95.     // Acquire a handle to the message manager
  96.     QMessageManager manager;
  97.  
  98.     // Find the matching message IDs, limiting our results to a managable number
  99.     const int max = 100;
  100.     const QMessageIdList matchingIds(manager.queryMessages(filter, sortOrder, max));
  101.     // Retrieve each message
  102.     foreach (const QMessageId &id, matchingIds) {
  103.         QMessage message(manager.message(id));
  104.         retVal.append(message.content());
  105.     }
  106.     return retVal;//
  107. }
  108. --------------------
  109. mainwindow.cpp
  110. -------------------
  111. #include "mainwindow.h"
  112. #include "ui_mainwindow.h"
  113.  
  114. MainWindow::MainWindow(QWidget *parent) :
  115.     QMainWindow(parent),
  116.     ui(new Ui::MainWindow)
  117. {
  118.     ui->setupUi(this);
  119. }
  120.  
  121. MainWindow::~MainWindow()
  122. {
  123.     delete ui;
  124. }
  125. void MainWindow::setText(QString text)
  126. {
  127.     ui->lbl_msgSubject->setText(text);
  128. }
  129. void MainWindow::setMsgContent(QString text)
  130. {
  131.     ui->lbl_msgContent->setText(text);
  132. }
  133. -------------------
  134. main.cpp
  135. --------------------
  136. #include <QtGui/QApplication>
  137. #include "mainwindow.h"
  138. #include <QSystemInfo>
  139. #include <QMessage>
  140. #include "smslib.h"
  141. QTM_USE_NAMESPACE
  142. int main(int argc, char *argv[])
  143. {
  144.     QApplication a(argc, argv);
  145.     MainWindow w;
  146.     QMessage *msg  = new QMessage();
  147.     msg->setSubject("From chu viet hung");
  148.     w.setText(msg->subject());
  149.     smslib *lib = new  smslib();
  150.     w.setMsgContent(lib->readSMS());
  151. #if defined(Q_WS_S60)
  152.     w.showMaximized();
  153. #else
  154.     w.show();
  155. #endif
  156.  
  157.     return a.exec();
  158. }
  159.  
  160. -----------------

4 replies

October 6, 2010

Alexandra Alexandra
Hobby Entomologist
559 posts

Have you seen this posting [labs.qt.nokia.com]? Maybe that solves it?

 Signature 

*THE CAKE IS A LIE*
Web Community Manager - Qt Development Frameworks

October 6, 2010

hungchuviet hungchuviet
Lab Rat
16 posts

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

October 8, 2010

johnk johnk
Lab Rat
38 posts

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 [developer.symbian.org]) 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 [developer.symbian.org] for more detail ).

-jk

October 9, 2010

hungchuviet hungchuviet
Lab Rat
16 posts

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

 
  ‹‹ QScriptEngine memory usage      QStaticText support for QWidget and Creator integration request ››

You must log in to post a reply. Not a member yet? Register here!