×

Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    11

    Question Help me.. sendind SMS in Qt

    Hi everyone..

    I want send a SMS via Qt for Symbian, I have a fragment of code that theorly runs...
    and I compile for simulator and all is perfect, but I connect my 5800 XM for run on device and I have some issues that says "No such file or directory" for the QtMessaging includes...

    somebody help me please!!!!!

  2. #2
    Super Contributor
    Join Date
    Oct 2008
    Location
    INDIA
    Posts
    2,326

    Re: Help me.. sendind SMS in Qt

    First of all set the environment for the Qt Mobility API :

    http://wiki.forum.nokia.com/index.ph...t_Mobility_API

    Then Write code of sending SMS in Qt Mobility :

    http://wiki.forum.nokia.com/index.ph...ing_qtmobility

    Then check or debug on the device using :

    http://wiki.forum.nokia.com/index.ph...ng_with_AppTRK

    Best regards,

  3. #3
    Super Contributor
    Join Date
    Oct 2007
    Location
    જુનાગઢ - India
    Posts
    3,034

    Re: Help me.. sendind SMS in Qt

    Does your application compiled successfully for device?? Have you created sis file ? How are you trying to run application on device??

  4. #4
    Registered User
    Join Date
    Jun 2010
    Posts
    11

    Re: Help me.. sendind SMS in Qt

    thanks for respose...

    really I'm beginner on dev for Symbian.. I trying with Qt Creator and i need send a SMS via Qt..
    I found support for coding my app. I compile for simulator and not throw me any error.
    I configured my device for debuging with Qt but when i try compile throw me some issues that say 'undefined reference' for lines with Qt Messaging elements.



    In the image view my function to send a sms and my header file contains the following lines:

    Code:
    ...
    #include <qmessage.h>
    #include <qmessageservice.h>
    #include <qmessageaccount.h>
    
    QTM_USE_NAMESPACE
    
    namespace Ui {
        class firstApp;
    }
    
    class firstApp : public QMainWindow
    {
        Q_OBJECT
    
    public:
        bool sendSms(QString, QString);
        explicit firstApp(QWidget *parent = 0);
        ~firstApp();
    
    private:
        QPointer<QMessageService> m_service;
        Ui::firstApp *ui;
    ...
    sorry my english

  5. #5
    Registered User
    Join Date
    Jun 2010
    Posts
    11

    Re: Help me.. sendind SMS in Qt

    @rahulvala

    check the third link [http://wiki.forum.nokia.com/index.ph...ng_with_AppTRK], but I have a different version of Qt Creator [] and I have some lines that appear on the page, I have for example that of 'Qt version S60 5th edition. "

    however, added a version of Qt for Symbian in the project settings and managed to create the sis file.








    ---------------------

    @savaj
    I have the sis file and I run on device, I modified my code for show a QMessageBox when the msg is sent:
    Code:
    void firstApp::enviarSms()
    {
        if(ui->txtMsg->toPlainText() == ""){
            QMessageBox::warning(0, tr("Ingrese el mensaje"), tr("Debe escribir un mensaje"));
        }else if(ui->txtNum->text() == ""){
            QMessageBox::warning(0, tr("Ingrese un numero"), tr("Debe escribir un destinatario"));
        }else{
            if(sendSms(ui->txtMsg->toPlainText(), ui->txtNum->text())){
                QMessageBox::information(0, tr("Success"), tr("Message sent successfully"));
            }else{
                QMessageBox::warning(0, tr("Failed"), tr("Unable to send message"));
            }
        }
    }
    
    bool firstApp::sendSms(QString bodyMsg, QString phoneNum)
    {
        if(!m_service)
            m_service = new QMessageService(this);
        QMessage smsMsg;
        smsMsg.setType(QMessage::Sms);
        smsMsg.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Sms));
        smsMsg.setTo(QMessageAddress(QMessageAddress::Phone, phoneNum));
        smsMsg.setBody(bodyMsg);
    
        return m_service->send(smsMsg);
    }
    always show me the messagebox but never send the sms

    can u help me???

  6. #6
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Help me.. sendind SMS in Qt

    Hi,
    Which messagebox does it show? I'm asking this because sending an SMS is an async operation and then the QMessageService::send() return true if it operation has been started succesfully but it doesn't say anytihng if the SMS has been sent with success.

    This code looks okay to me... anyhow here some general tips:
    1) Use "const QString&" instead of "QString" as method arguments. Despite QStrings (like many other Qt classes) are implicit shared objects, it's still more efficient and safer pass const references instead of values.
    2) Use QString::isEmpty() instead of ==""

  7. #7
    Registered User
    Join Date
    Jun 2010
    Posts
    11

    Re: Help me.. sendind SMS in Qt

    hey...

    somebody help me...

    the message never is sent but is created on DraftsFolder... why????

    please help me..

    my code to send the SMS:
    Code:
    bool firstApp::sendSms(QString bodyMsg, QString phoneNum)
    {
        if(!m_service)
            m_service = new QMessageService(this);
        QMessage smsMsg;
        smsMsg.setType(QMessage::Sms);
        smsMsg.setParentAccountId(QMessageAccount::defaultAccount(QMessage::Sms));
        smsMsg.setTo(QMessageAddress(QMessageAddress::Phone, phoneNum));
        smsMsg.setBody(bodyMsg);
    
        return m_service->send(smsMsg);
    }

Similar Threads

  1. Security part in SMS Sendind
    By souvik4321 in forum Mobile Java General
    Replies: 2
    Last Post: 2007-05-14, 06:36
  2. Can i compress data before sendind throught network
    By ononokung in forum Mobile Java General
    Replies: 1
    Last Post: 2004-08-24, 20:52
  3. Sendind cell information through sms
    By decin in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2003-11-23, 15:30
  4. Sendind cell information through sms
    By decin in forum General Messaging
    Replies: 0
    Last Post: 2003-11-23, 15:30

Posting Permissions

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