0

I am new to Qt, and trying to use QtMobility to send message. I am using example in this link: http://doc.qt.nokia.com/qtmobility/writemessage.html

I am able to compile the source code, and it can be tested on the simulator. But when I deploy it to E72, the program failed. Because it can't found any available accounts. The problem lies in this code:

 // Find the list of available accounts and add them to combo box
foreach (const QMessageAccountId &id, manager.queryAccounts()) {
    QMessageAccount account(id);
    ...
}

if (accountDetails.isEmpty()) {
    QMessageBox::warning(0, tr("Cannot send"), tr("No accounts are available to send with!"));
    QCoreApplication::instance()->quit();
} else {
    accountCombo->setCurrentIndex(0);
}

The code enter the (accountDetails.isEmpty()) on the device, but it is okay when at simulator. So the manager.queryAccounts() return an empty list.

What exactly is account? in simulator it is SMS and MMS. But why in the device is empty? The code doesn't initialize the manager so I can't trace how it is work. Oh, btw, manager is a QMessageManager instantiation. What should I do so it is work in the device?

I am using Nokia Qt SDK with QtMobility version 1.0.2, if that's helping.

dieend
  • 2,231
  • 1
  • 24
  • 29
  • The path shows Qt Mobility 1.0 beta, which is rather old and ... well, beta. I don't really have time to look into this but a tip would be to try the code in http://doc.qt.nokia.com/qtmobility/writemessage.html , i.e. the latest version. – Lucian May 05 '11 at 12:01
  • Also make sure to specify which version of Qt and Qt Mobility you compile and run against. – Lucian May 05 '11 at 12:02
  • I have Qt Mobility 1.0.2, and I have changed my code with the new one. But still it didn't work :( I am using Nokia Qt SDK. And my device using S60 feature pack 2. Is it a problem? – dieend May 05 '11 at 13:02
  • Your SDK is the correct one for your device. The code must be reviewed then, apparently something is not right ... It's on my list, but it is a long list. – Lucian May 05 '11 at 14:09
  • @Lucian can you help me? I really don't know what to do :( I'm using this ( http://wiki.forum.nokia.com/index.php/Show_the_installed_Qt_and_Qt_Mobility_version_on_Symbian_and_Maemo_/_MeeGo ) application to found out my Qt and QtMobility on my phone. The result is Qt (4.6.3), Mobility (1.0.x, which is I'm sure it is 1.0.2 but I forgot where I found it), OS (3.2), FW (031.023). Is it helping? – dieend May 05 '11 at 14:34

1 Answers1

0

Okay, I got the answer. The problem isn't with the application or the qt. But the certification. The QMessageManager somehow need to access the OS. It is described at the *.pro file, at the symbian:TARGET.CAPABILITY. That's called capabilities. And some capabilities can't be self-signed which is the default at the Project Setting. It is need to be signed.

I used Open Signed here: https://www.symbiansigned.com/app/page/public/openSignedOnline.do to get the file signed. After the file signed, install the signed file to the device, and the program can access the OS, and the QMessageManager's queryAccounts() won't return an empty result.

that's it. And the message can be sent.

I think it is kind of annoying when I need to test it to the device I need to signed it first. And the offline need a license which is not free, while I am just learning. *sigh

EDITED: Somehow I am able to run it with self-signed. But I don't know exactly how it can be. What am I doing:

  1. run the self-signed application with QtCreator. error: can't copy from computer to device
  2. restart device
  3. run the self-signed application with QtCreator. error: general OS related
  4. Install application manually with PC Suite. Many warning.

And I forgot what's next - try run with QtCreator. works fine. - or uninstall with PC Suite first.

dieend
  • 2,231
  • 1
  • 24
  • 29
  • http://www.forum.nokia.com/document/Mobile_Hands-on_Labs/Qt/MobilityMessaging/ That example worked for me in an N8 without signing – Miguel López May 06 '11 at 06:10
  • One lesson to be learned from this: if you can't get a devcert from Symbian Signed, go get one from Ovi Publish. It will removed a lot of issues related to the signing requirements and give you more freedom to experiment. – Lucian May 06 '11 at 07:18