Search code examples
qtnokiamessageqt-mobility

Using Nokia Qt to send message in S60 (Nokia E72)


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.


Solution

  • 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.