×

Discussion Board

Results 1 to 13 of 13
  1. #1
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    how to deploy SMS program on my phone ?

    I want to write a program to handle SMSs , I refered to "http://wiki.forum.nokia.com/index.php/CS001618_-_Requesting_an_SMS_from_the_inbox_folder_in_Qt"
    this example runs greatly on simulator , but when I deploy it on my phone , it told me a sentence like "The necessary procedures are not granted access permissions"

    I am very anxious to accomplish this function , could anyone help me ?

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to deploy SMS program on my phone ?

    Can you check what capabilities are defined for symbian in your pro file ? as well as can you tell us what kind of certificate are you using for signig the sis file ?

  3. #3
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    Honestly , I don't know what certificate I need , I just know I want my program have the ability to read SMSs in inbox .
    Please help me

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to deploy SMS program on my phone ?

    Please read the both questions, and answer them both.

  5. #5
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    I refered to "http://wiki.forum.nokia.com/index.php/CS001618_-_Requesting_an_SMS_from_the_inbox_folder_in_Qt"
    the capabilities are :ReadUserData \ WriteUserData \ ReadDeviceData \ WriteDeviceData
    I use the self-signed of Qt Creator , which doesn't work
    what is more , I wrote "CONFIG += mobility MOBILITY = messaging"
    but I could not include <QMessage> <qmessageservice.h> and <qmessagemanager.h>


    could you help me ?

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to deploy SMS program on my phone ?

    capabilities ReadDeviceData & WriteDeviceData can not be used with self-signed sis files, thus the instalaltion will fail. Thus, if the API really requires these capabilities, then you would need to get a developer certificate for testing purposes, and change the Run settings to use the developer certifiate on your Qt Creator.

  7. #7
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    I have tried to apply for a developer certificate , but I still don't have one , what's more , I have to accomplish the program tomorrow ,
    could you tell me , where could I apply for the developer certificate quickly ? or online signed is also OK .

    The program could run when test it with simulator , but if I use symbian device to test the program , there are always errors , for example , "QMessage is not a type name " .

    the online signed need sis file , I couldn't compile it successfully , could you tell me how could I do this ?

  8. #8
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    Thanks to symbianyucca very much for your help
    now I find something odd that if I test the program with simulator , I could include <QMessage> , but if I test the program on symbian device , I could not include <QMessage>
    could you tell me the reason ?

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

    Re: how to deploy SMS program on my phone ?

    Quote Originally Posted by LaineGates View Post
    if I test the program with simulator , I could include <QMessage> , but if I test the program on symbian device , I could not include <QMessage>
    could you tell me the reason ?
    Could you provide the exact error message you get?

  10. #10
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    for example , when I tried to test my program using "symbian device" , it gives me the errors like
    "undefined reference to 'QtMobility::QMessageManager::message(QtMobility::QMessageId const&) const)' "
    "undefined reference to 'QtMobility::QMessage::~QMessage()' " and so on .

  11. #11
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    All errors are related to undefined "QMessage" "QMessageService" "QMessageManager" "QMessageId" and the classes with word "QMessage"
    So it is so strange , I refered to the example"http://wiki.forum.nokia.com/index.php/CS001618_-_Requesting_an_SMS_from_the_inbox_folder_in_Qt"
    which is a very short and simple example , when I tried to deploy the example , compiler just tell me to the question about "permission" (even the example , when I moved my mouse pointer onto <qmessage.h> , compiler told me no such file or directory,but the example could deploy normally)
    and my program runs well without the part of the example both on "simulator" and "symbian device" . when I add the code of the example , and tried to test it with "symbian device " , it gave me the errors . when on simulator , it runs well.

  12. #12
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    This time , I changed my code , I let the class qtSnippets of the example be a class of my program , and the errors changed into "undefined reference to qtSnippets::qtSnippets(QWidget*)" and "undefined reference to qtSnippets::getList(QListWidget)" .
    the code are as follows:
    widgetcontroller.h
    #include <QListWidgetItem>
    #include <QStackedWidget>
    #include <QVBoxLayout>

    namespace Ui {
    class WidgetController;
    }

    class WidgetController : public QWidget
    {
    Q_OBJECT

    public:
    explicit WidgetController(QWidget *parent = 0);
    ~WidgetController();
    public slots:
    /**
    * setContactsWidgetCurrent
    * Sets the contactsWidget as current widget.
    */
    void setContentWidgetCurrent(QListWidgetItem* item);

    /**
    * setMessageWidgetCurrent
    * Sets the messageWidget as current widget.
    */
    void setMessageWidgetCurrent();

    private:
    Ui::WidgetController *ui;
    QStackedWidget *stackedWidget;

    };

    QT_END_NAMESPACE

    QT_END_HEADER


    #endif // WIDGETCONTROLLER_H
    widgetcontroller.cpp
    #include "widgetcontroller.h"
    #include "ui_widgetcontroller.h"
    #include "messagewidget.h"
    #include "contentwidget.h"

    WidgetController::WidgetController(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::WidgetController)
    {
    ui->setupUi(this);

    MessageWidget* messageWidget = new MessageWidget();
    ContentWidget* contentWidget = new ContentWidget();

    stackedWidget = new QStackedWidget();
    stackedWidget->addWidget(messageWidget);
    stackedWidget->addWidget(contentWidget);

    stackedWidget->setCurrentIndex(0); // messageWidget

    QVBoxLayout *layout = new QVBoxLayout();
    layout->addWidget(stackedWidget);
    setLayout(layout);

    connect(messageWidget, SIGNAL(readSMS(QListWidgetItem*)),
    contentWidget, SLOT(display(QListWidgetItem*)));

    connect(contentWidget, SIGNAL(deleteCurrent()),
    messageWidget, SLOT(deleteSMS()));

    connect(messageWidget, SIGNAL(readSMS(QListWidgetItem*)),
    this, SLOT(setContentWidgetCurrent(QListWidgetItem*)));

    connect(contentWidget, SIGNAL(backToMessageList()),
    this, SLOT(setMessageWidgetCurrent()));

    }

    WidgetController::~WidgetController()
    {
    delete ui;
    }

    void WidgetController::setContentWidgetCurrent(QListWidgetItem* item)
    {
    stackedWidget->setCurrentIndex(1); // ContentWidget
    }

    void WidgetController::setMessageWidgetCurrent()
    {
    stackedWidget->setCurrentIndex(0); // messageWidget
    }
    messagewidget.h
    #ifndef MESSAGEWIDGET_H
    #define MESSAGEWIDGET_H

    class qtSnippets ;
    // INCLUDES
    #include <QWidget>
    #include <QList>
    #include <QListWidget>
    #include <QListWidgetItem>
    #include <QVBoxLayout>
    #include <QString>
    #include <QToolBar>
    #include <QAction>
    #include <QMessageBox>
    #include <QPointer>
    #include <QMessageId>
    //#include

    #include <qmessage.h>
    #include <qmessageservice.h>
    #include <qmessagemanager.h>
    QTM_USE_NAMESPACE


    class MessageWidget : public QWidget
    {
    Q_OBJECT
    public:
    explicit MessageWidget(QWidget *parent = 0);

    // used by the widgetcontroller , dilivery the currentItem
    QListWidgetItem *getCurrentItem();

    // Execute query using filters
    // void queryMessages();

    signals:
    // read current item
    void readSMS(QListWidgetItem* item);


    public slots:
    // delete current item
    void deleteSMS();
    // just use to emit readSMS(QListWidgetItem* item)
    void read();

    // Listens messagesFound() signal of QMessageService
    // void messagesFound(const QMessageIdList&);

    private:
    /**
    * createActions
    * Creates actions and connects them to slots.
    */
    // void createActions();

    /**
    * createMenus
    * Creates a menubar and adds a menu with actions
    * to it.
    */
    // void createMenus();
    // init the SMS list of inbox
    void initSMSList();

    // init listWidget with information
    void initList();

    // init toolbar
    void initToolbar();

    // top init function
    void initAll();

    private:
    /**
    * listWidget list widget for recipients
    * Owned by ContactsWidget object, instantiated in
    * constructor, populated in readContactsFromDbL.
    */
    QListWidget *listWidget;

    QVBoxLayout *layout ;
    QToolBar *bar;

    QAction *act_delete;
    QAction *act_read;

    qtSnippets* manager ;
    // QPointer<QMessageService> m_service;
    // QPointer<QMessageManager> m_manager;

    };


    #endif // MESSAGEWIDGET_H
    messagewidget.cpp
    #include "messagewidget.h"
    #include "qtsnippets.h"

    MessageWidget::MessageWidget(QWidget *parent) :
    QWidget(parent)
    {
    initAll();
    // setLayout(layout);
    // listWidget->setCurrentRow(0);
    }

    void MessageWidget::initSMSList()
    {
    manager = new qtSnippets();
    manager->getList(listWidget);
    }

    /*
    void MessageWidget::initSMSList()
    {
    listWidget = new QListWidget(this);

    // QMessageService class provides the interface
    // for requesting messaging service operations
    m_service = new QMessageService(this);
    QObject::connect(m_service,
    SIGNAL(messagesFound(const QMessageIdList&)),
    this,
    SLOT(messagesFound(const QMessageIdList&)));

    // QMessageManager class represents the main interface for storage and
    // retrieval of messages, folders and accounts in the system message store
    m_manager = new QMessageManager(this);

    // Query messages
    queryMessages();


    // listWidget->setCurrentRow(0);
    }
    */

    void MessageWidget::initList()
    {
    listWidget = new QListWidget(this);
    listWidget->addItem(new QListWidgetItem("Oa\nk"));
    listWidget->addItem(new QListWidgetItem("Ba\nnana"));
    listWidget->addItem(new QListWidgetItem("Appl\ne"));
    listWidget->addItem(new QListWidgetItem("Orange\n"));
    listWidget->addItem(new QListWidgetItem("Grape\ns"));
    listWidget->addItem(new QListWidgetItem("Jaye\nsh"));
    listWidget->addItem(new QListWidgetItem("Pineapple"));
    listWidget->addItem(new QListWidgetItem("GROUNDNUT"));
    listWidget->addItem(new QListWidgetItem("Sugarcane"));
    listWidget->addItem(new QListWidgetItem("Coconut"));
    listWidget->addItem(new QListWidgetItem("Jaye\nsh"));
    listWidget->addItem(new QListWidgetItem("Pineapple"));
    listWidget->addItem(new QListWidgetItem("GROUNDNUT"));
    listWidget->addItem(new QListWidgetItem("Sugarcane"));
    listWidget->addItem(new QListWidgetItem("Coconut"));
    listWidget->addItem(new QListWidgetItem("Jaye\nsh"));
    listWidget->addItem(new QListWidgetItem("Pineapple"));
    listWidget->addItem(new QListWidgetItem("GROUNDNUT"));
    listWidget->addItem(new QListWidgetItem("Sugarcane"));
    listWidget->addItem(new QListWidgetItem("Coconut"));

    listWidget->setCurrentRow(3);

    }

    void MessageWidget::initToolbar()
    {
    bar = new QToolBar();
    act_delete = new QAction("delete" , this );
    act_read = new QAction("read" , this );
    bar->addAction(act_delete);
    bar->addSeparator();
    bar->addAction(act_read);
    }

    void MessageWidget::initAll()
    {
    // initSMSList();
    initList();
    initToolbar();

    layout = new QVBoxLayout();
    layout->addWidget(listWidget);
    layout->addWidget(bar);
    setLayout(layout);

    QObject::connect(listWidget , SIGNAL(itemDoubleClicked(QListWidgetItem*))
    , this , SIGNAL(readSMS(QListWidgetItem*)));
    QObject::connect(act_delete , SIGNAL(triggered())
    , this , SLOT(deleteSMS()));
    QObject::connect(act_read , SIGNAL(triggered())
    , this , SLOT(read()));

    }
    /*
    void MessageWidget::queryMessages()
    {
    // Create filers for query, we query SMS messages
    // that exists in the inbox folder
    QMessageFilter queryFilter(QMessageFilter::byType(QMessage::Sms) &
    QMessageFilter::byStandardFolder(QMessage::InboxFolder));

    m_service->queryMessages(queryFilter);
    // NOTE: qtSnippets::messagesFound() is called if messages found
    }

    void MessageWidget::messagesFound(const QMessageIdList &ids)
    {
    foreach(const QMessageId& id, ids)
    {
    // Get QMessage
    QMessage message = m_manager->message(id);
    // Get message string
    QString messageString = message.textContent();
    // Show to user
    // QMessageBox::information(this,"Incoming SMS",messageString);
    // add the SMS content to listWidget
    listWidget->addItem(new QListWidgetItem(messageString));
    }
    }
    */


    QListWidgetItem* MessageWidget::getCurrentItem()
    {
    return listWidget->currentItem();
    }
    /*
    void MessageWidget::readSMS(QListWidgetItem* item)
    {
    }
    */
    void MessageWidget::read()
    {
    // no SMS
    if( listWidget->count()<=0 )
    return ;
    emit readSMS(listWidget->currentItem());
    }

    void MessageWidget::deleteSMS()
    {
    // no SMSs
    if( listWidget->count()<=0 )
    return ;

    int currentRow = listWidget->currentRow();
    // listWidget->removeItemWidget(listWidget->currentItem());
    listWidget->takeItem(currentRow);
    // listWidget->update();

    currentRow++ ;
    if( currentRow >= listWidget->count() )
    currentRow = 0 ;
    else
    listWidget->setCurrentRow( currentRow );
    }

  13. #13
    Registered User
    Join Date
    Aug 2008
    Posts
    71

    Re: how to deploy SMS program on my phone ?

    contentwidget.h
    #ifndef CONTENTWIDGET_H
    #define CONTENTWIDGET_H

    #include <QWidget>

    class QTextEdit;
    class QLineEdit;
    class QListWidgetItem;
    class QToolBar;
    class QAction;
    class QVBoxLayout;
    class QString;


    class ContentWidget : public QWidget
    {
    Q_OBJECT
    public:
    explicit ContentWidget(QWidget *parent = 0);

    signals:

    // used by deleteSMS() , connect to MessageWidget::deleteSMS()
    void deleteCurrent();

    // tell widgetController to set focus on messageWidget
    void backToMessageList();

    public slots:
    // show the detail information of the SMS
    void display(QListWidgetItem*item);
    // tell widgetcontroller to delete the current SMS
    void deleteSMS();

    private:

    void initToolbar();

    private:
    QTextEdit *textEdit;
    QVBoxLayout *layout ;
    QLineEdit *phone_num;

    QToolBar *bar;
    QAction *act_delete;
    QAction *act_return;
    };

    #endif // CONTENTWIDGET_H
    contentwidget.cpp
    #include "contentwidget.h"
    #include <QTextEdit>
    #include <QLineEdit>
    #include <QListWidgetItem>
    #include <QToolBar>
    #include <QAction>
    #include <QVBoxLayout>
    #include <QString>

    ContentWidget::ContentWidget(QWidget *parent) :
    QWidget(parent)
    {
    initToolbar();


    layout = new QVBoxLayout();
    phone_num = new QLineEdit();
    textEdit = new QTextEdit();
    phone_num->setReadOnly(true);
    textEdit->setReadOnly(true);

    layout->addWidget( phone_num );
    layout->addWidget( textEdit );
    layout->addWidget( bar );

    setLayout(layout);


    QObject::connect(act_delete , SIGNAL(triggered())
    , this , SLOT(deleteSMS()));
    QObject::connect(act_return , SIGNAL(triggered())
    , this , SIGNAL(backToMessageList()));

    }

    void ContentWidget::display(QListWidgetItem *item)
    {
    textEdit->setText(item->text());
    phone_num->setText("15846387916");
    }

    void ContentWidget::deleteSMS()
    {
    // the real deletion steps are in MessageWidget::deleteSMS()
    emit deleteCurrent();
    // and back to MesaageList is needed
    emit backToMessageList();
    }

    /*
    void ContentWidget::backToMessageList()
    {
    }

    */
    void ContentWidget::initToolbar()
    {
    bar = new QToolBar();
    act_delete = new QAction("delete" , this );
    act_return = new QAction("return" , this );
    bar->addAction(act_delete);
    bar->addSeparator();
    bar->addAction(act_return);
    }
    qtsnippets.h
    #ifndef QTSNIPPETS_H
    #define QTSNIPPETS_H

    #include <QMainWindow>
    #include <QPointer>
    #include <QMessageBox>
    #include <QListWidget>
    #include <QListWidgetItem>
    // QtMobility
    #include <qmessage.h>
    #include <qmessageservice.h>
    #include <qmessagemanager.h>
    QTM_USE_NAMESPACE

    class qtSnippets : public QMainWindow
    {
    Q_OBJECT
    public:
    explicit qtSnippets(QWidget *parent = 0);
    void getList(QListWidget* listWidget);

    signals:
    // Execute query using filters
    void queryMessages();

    public slots:
    // Listens messagesFound() signal of QMessageService
    void messagesFound(const QMessageIdList&);


    private:
    QPointer<QMessageService> m_service;
    QPointer<QMessageManager> m_manager;

    QListWidget * listWidget ;

    };

    #endif // QTSNIPPETS_H
    qtsnippets.cpp
    #include "qtsnippets.h"

    qtSnippets::qtSnippets(QWidget *parent) :
    QMainWindow(parent)
    {
    // QMessageService class provides the interface
    // for requesting messaging service operations
    m_service = new QMessageService(this);
    QObject::connect(m_service,
    SIGNAL(messagesFound(const QMessageIdList&)),
    this,
    SLOT(messagesFound(const QMessageIdList&)));

    // QMessageManager class represents the main interface for storage and
    // retrieval of messages, folders and accounts in the system message store
    m_manager = new QMessageManager(this);

    // Query messages
    queryMessages();
    }

    qtSnippets::~qtSnippets()
    {
    }

    void qtSnippets::getList(QListWidget *listWidget)
    {
    this->listWidget = listWidget ;
    }

    void qtSnippets::queryMessages()
    {
    // Create filers for query, we query SMS messages
    // that exists in the inbox folder
    QMessageFilter queryFilter(QMessageFilter::byType(QMessage::Sms) &
    QMessageFilter::byStandardFolder(QMessage::InboxFolder));

    m_service->queryMessages(queryFilter);
    // NOTE: qtSnippets::messagesFound() is called if messages found
    }

    void qtSnippets::messagesFound(const QMessageIdList &ids)
    {
    foreach(const QMessageId& id, ids)
    {
    // Get QMessage
    QMessage message = m_manager->message(id);
    // Get message string
    QString messageString = message.textContent();
    // Show to user
    //QMessageBox::information(this,"Incoming SMS",messageString);
    listWidget->addItem(new QListWidgetItem( messageString));
    }
    }

Similar Threads

  1. [Moved] How run the program on my n E72? I write my program by myself
    By iamroger in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 5
    Last Post: 2010-03-12, 10:52
  2. Replies: 5
    Last Post: 2009-10-23, 06:04
  3. How to deploy my application on a web server?
    By tiex in forum Mobile Java General
    Replies: 3
    Last Post: 2005-01-20, 15:01
  4. Replies: 1
    Last Post: 2004-09-17, 04:52

Posting Permissions

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