Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Need help: Can not get SMS messages when using Qt Mobility SDK on Qt Creator
QtWS25 Last Chance

Need help: Can not get SMS messages when using Qt Mobility SDK on Qt Creator

Scheduled Pinned Locked Moved Mobile and Embedded
5 Posts 2 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    biyu
    wrote on last edited by
    #1

    Hi,

    I met a problem when using mobility SDK to get SMS information on N900. I found that many ppl have same problem like me, and there hasn't been any correct answer for this problem on Internet.

    My problem is: I try the QMessage modules of mobility sdk on N900. I used qt creator the build the packet and run the application on N900. I want to get some information about the SMS messages on my phone, and I'm sure that I have many messages in SMS inbox. But when trying to fetch SMS messages from the inbox, nothing can be gotten. I'm pretty sure that my code is correct. Because the E-Mail message can be fetched when I change the QMessage::Sms to QMessage::Email!

    One key point is that I'm using the latest firmware 1.2 version on N900, and the Qt 4.6.2 as well. All necessary packages are well installed on my phone as well. I can not see any problem with the phone :(.

    I hope I can find the final solution of this problem with you guys help, either from Qt aspect or N900 aspect. Then I can continue building my application.

    The code I used:

    @#include <QtGui>
    #include <QMessage>
    #include <QMessageManager>
    using namespace QtMobility;

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);

    QMessageManager manager;
    QMessageIdList list = manager.queryMessages(QMessageFilter::byType(QMessage::Sms));
    
    qDebug() << list.count();
    
    
    for (int i = 0; i < list.size(); ++i) {
         QMessageId id = list.at(i);
         QMessage message = manager.message(id);
         qDebug() << message.from().addressee() << message.textContent();
    }
    
    a.exec(&#41;;
    

    }@

    The same problem threads can be found here:

    "http://discussion.forum.nokia.com/forum/showthread.php?205340-QMessageManager-gt-queryMessages-works-in-simulator-but-not-in-N900":http://discussion.forum.nokia.com/forum/showthread.php?205340-QMessageManager-gt-queryMessages-works-in-simulator-but-not-in-N900

    "http://discussion.forum.nokia.com/forum/showthread.php?205423-QMessageManager-message(id)-conn-t-get-the-message-object":http://discussion.forum.nokia.com/forum/showthread.php?205423-QMessageManager-message(id)-conn-t-get-the-message-object

    Looking forward to your reply!

    thx.

    [edit: fixed link / chetankjain]

    1 Reply Last reply
    0
    • T Offline
      T Offline
      trotor
      wrote on last edited by
      #2

      I was fighting with the same problem and decided to ask around on maemo.org. Thanks to those people there I found out that most likely it is permission issue! QTCreator uses developer user to run the software on the device and that user is not able to do that querymessages for users SMS messages correctly.

      I don't yet know how to circumvent this directly from QTCreator but you can confirm this by going to xconsole in your n900 and typing "su user <enter> appname<enter>" and it works.

      Please contact me if you find out how to make qtcreator work correctly with this.

      Thx, Tero

      1 Reply Last reply
      0
      • B Offline
        B Offline
        biyu
        wrote on last edited by
        #3

        Please see this thread. We have solved this problem in QtCreator!

        http://discussion.forum.nokia.com/forum/showthread.php?208705-Need-help-Can-not-get-SMS-messages-when-using-Qt-Mobility-SDK-on-Qt-Creator&p=774416#post774416

        1 Reply Last reply
        0
        • T Offline
          T Offline
          trotor
          wrote on last edited by
          #4

          Did you find any problems with "unlocking" user account?

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #5

            @biyu, pls convert the text to link, easier to click :)

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved