×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 22
  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    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:
    Code:
    #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();
    }
    The same problem threads can be found here:

    http://discussion.forum.nokia.com/fo...ut-not-in-N900

    http://discussion.forum.nokia.com/fo...message-object

    Looking forward to your reply!

    thx.

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

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

    As I said already in two previous posts, there is no solution because there is no problem.

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    HI,

    I can not get your idea... What do you mean about "there is no problem".... I tried many times on my N900 and my friend's, but the SMS still can not be read out. Maybe there is no problem on your N900, but there exactly is problem on mine . So do you have any idea? for example, you found some problem in my code or the configuration in my phone.

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

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

    Well, "your code" was actually posted by me and there is no problem with it.
    What is an output of
    Code:
    dpkg -l "libqtm*"
    Code:
    ldd ./your_binary | grep libQt
    ? What is your build environment? Did you try other build environment(s)?

  5. #5
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    Quote Originally Posted by divanov View Post
    Well, "your code" was actually posted by me and there is no problem with it.
    What is an output of
    Code:
    dpkg -l "libqtm*"
    Code:
    ldd ./your_binary | grep libQt
    ? What is your build environment? Did you try other build environment(s)?
    The output of "dpkg -l "libqtm*" on N900:
    Code:
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
    ||/ Name           Version        Description
    +++-==============-==============-============================================
    ii  libqtm-contact 1:1.0.2-maemo1 Qt Mobility contacts module
    ii  libqtm-messagi 1:1.0.2-maemo1 Qt Mobility messaging module
    The output of "ldd ./your_binary | grep libQt":

    Code:
    	libQtMobilitySimulator.so.1 => /home/biyu/NokiaQtSDK/Simulator/QtMobility/gcc/lib/libQtMobilitySimulator.so.1 (0x0074a000)
    	libQtMessaging.so.1 => /home/biyu/NokiaQtSDK/Simulator/QtMobility/gcc/lib/libQtMessaging.so.1 (0x00d16000)
    	libQtGui.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtGui.so.4 (0x00d61000)
    	libQtNetwork.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtNetwork.so.4 (0x00110000)
    	libQtCore.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtCore.so.4 (0x003ba000)
    	libQtSql.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtSql.so.4 (0x00753000)
    I know this code is made by you. And thank you for helping me.

    My programming and building environment is Ubuntu 10.04, with Qt Mobility SDK 1.0. I used QtCreator as the IDE, and run the code from QtCreator onto the N900. From your previous answers, I got a idea about this problem. You said that you used scratchbox as the building environment, and everything works fine. But guys who use QtCreator to run the code onto N900 all met this problem more or less. So maybe there is bug on QtCreator? Just guessing.

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

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

    Quote Originally Posted by biyu View Post
    The output of "ldd ./your_binary | grep libQt":
    Code:
    	libQtMobilitySimulator.so.1 => /home/biyu/NokiaQtSDK/Simulator/QtMobility/gcc/lib/libQtMobilitySimulator.so.1 (0x0074a000)
    	libQtMessaging.so.1 => /home/biyu/NokiaQtSDK/Simulator/QtMobility/gcc/lib/libQtMessaging.so.1 (0x00d16000)
    	libQtGui.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtGui.so.4 (0x00d61000)
    	libQtNetwork.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtNetwork.so.4 (0x00110000)
    	libQtCore.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtCore.so.4 (0x003ba000)
    	libQtSql.so.4 => /home/biyu/NokiaQtSDK/Simulator/Qt/gcc/lib/libQtSql.so.4 (0x00753000)
    On N900, please. Qt Creator is just an IDE, it's highly unlikely the problem is related to Qt Creator. You can verify it by compiling your project manually. I would expect that problem is related to Nokia Qt SDK, which is different from my build environment.

  7. #7
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    Ok, Here it is.

    Code:
    	libQtMessaging.so.1 => /usr/lib/libQtMessaging.so.1 (0x40001000)
    	libQtGui.so.4 => /usr/lib/libQtGui.so.4 (0x400c4000)
    	libQtCore.so.4 => /usr/lib/libQtCore.so.4 (0x443c0000)
    	libQtDBus.so.4 => /usr/lib/libQtDBus.so.4 (0x45a00000)
    	libQtXml.so.4 => /usr/lib/libQtXml.so.4 (0x45cc8000)
    	libQtNetwork.so.4 => /usr/lib/libQtNetwork.so.4 (0x40e46000)

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

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

    Well, everything looks fine except I've never heard about Qt Mobility SDK 1.0. Did you try to use Maemo SDK instead?

  9. #9
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    Quote Originally Posted by divanov View Post
    Well, everything looks fine except I've never heard about Qt Mobility SDK 1.0. Did you try to use Maemo SDK instead?
    Hi divanov,

    I finally found something interesting. When I directly run the binary file of that program on N900's local terminal (not using SSH), Everything works correctly!! SMS messages can be gotten correctly. But when I run the binary file using SSH onto N900, or using Qt Creator to run this program on N900 via WLAN as before, the SMS messages can not be gained. Do you know why this happens??? It is pretty strange, because the problem seems to be related with the wireless network connection?? I never met this kind of problem before. Really need your help.

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

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

    Can you execute command
    Code:
    whoami
    trough SSH and "N900's local terminal" (which is probably XTerm).

  11. #11
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    Quote Originally Posted by divanov View Post
    Can you execute command
    Code:
    whoami
    trough SSH and "N900's local terminal" (which is probably XTerm).
    From N900 XTerm, the output is "user". From SSH is "root" .... Ok, I just try to run "su - user" after I ssh:ed to N900 as root. And everything works. So maybe the Qt Creator has the same problem because it runs the program onto N900 with "root" or something else which is not the "user".

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

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

    Quote Originally Posted by biyu View Post
    So maybe the Qt Creator has the same problem because it runs the program onto N900 with "root" or something else which is not the "user".
    Definitely this is root cause for the problems. Executing applications as root is unsafe and lead to problems.

  13. #13
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    Quote Originally Posted by divanov View Post
    Definitely this is root cause for the problems. Executing applications as root is unsafe and lead to problems.
    And the Qt Creator seems to run the program on N900 as "developer", not "user". What should I do if I want the user "developer" can access the SMS messages of user "user"...

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

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

    To me Qt Creator should be using user to execute an applications. As real user will run it as user, not developer. Thus, this is bug in Qt Creator/Nokia Qt SDK. Probably environments of developer and user differs in crucial way.

  15. #15
    Registered User
    Join Date
    Feb 2009
    Posts
    22

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

    Quote Originally Posted by divanov View Post
    To me Qt Creator should be using user to execute an applications. As real user will run it as user, not developer. Thus, this is bug in Qt Creator/Nokia Qt SDK. Probably environments of developer and user differs in crucial way.
    I checked the document of "mad developer" for N900. It seems that mad developer will create a new user named "developer". And All the debian packages that are made by Qt Creator will be stored in the /home/developer folder. From the tests we know that we can get the SMS messages only using "user" to run the program on N900. I really have no idea about how to configure Qt Creator or configure N900 to correct the SMS problem. I hope you could have some idea to solve this problem . But anyway thank you for helping me to locate the key point of this problem. The only thing left is to find a way to temporarily solve it.

Similar Threads

  1. Qt Creator code completion not working with Qt Mobility for Symbian
    By ceefour in forum [Archived] Qt Mobility Project
    Replies: 4
    Last Post: 2011-09-10, 05:02
  2. fail to deploy from Nokia Qt SDK for Mac in Qt Creator
    By ovjo12 in forum [Archived] Qt SDKs and Tools
    Replies: 4
    Last Post: 2010-07-23, 14:38
  3. Nokia Qt SDK for Mac -- build fails in Qt Creator
    By ovjo12 in forum [Archived] Qt SDKs and Tools
    Replies: 4
    Last Post: 2010-07-19, 15:29
  4. Replies: 3
    Last Post: 2010-06-30, 01:17
  5. QT Nokia sdk installation and QT Creator config problem
    By kapiluiet in forum [Archived] Qt SDKs and Tools
    Replies: 1
    Last Post: 2010-06-02, 13:49

Posting Permissions

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