×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Registered User
    Join Date
    Mar 2010
    Posts
    21

    Qt Mobility Simple service example

    Hi to all ,

    I am new to Qt, I need a simple Qt service example
    For example, the service always running in the background and perform some task(in mycase getting gps location perriodically)

    Please any help me how to create a simple qt service example step by step

    Thanks,
    Nandha.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,852

    Re: Qt Mobility Simple service example

    Hello nandhagasc,

    There is nothing like android services in Symbian or Meego, i guess to implement this kind of feature , the simplest approach is to get the GPS location using http://doc.qt.nokia.com/qtmobility/q...nfosource.html and keep it running , you can implement that in a separate thread if your are very conscious about performance.

  3. #3
    Registered User
    Join Date
    Mar 2010
    Posts
    21

    Re: Qt Mobility Simple service example

    Thanks for your reply,

    I saw Qt Service Framework http://qt-project.org/doc/qt-5.0/ser...rameworks.html
    and http://doc.trolltech.com/solutions/q...active.html#x4
    Is it possible to create a service through Qt Service Framework for my requirement ?

    Thanks,
    Nandha.

  4. #4
    Super Contributor
    Join Date
    Jun 2006
    Location
    India
    Posts
    3,037

    Re: Qt Mobility Simple service example

    Yes, You can create a qt service plugin but there should be some one who can load the service to perform operation.
    Use [URL="http://qt.nokia.com/products/qt-quick/"]Qt-Quick[/URL] to make your application UI more attractive.

    [URL="http://store.ovi.com/content/271896"]http://store.ovi.com/content/271896[/URL] | [URL="http://store.ovi.com/content/276199"]http://store.ovi.com/content/276199[/URL] |[URL="http://store.ovi.com/content/276202"] http://store.ovi.com/content/276202[/URL] | [URL="http://store.ovi.com/content/280827"]http://store.ovi.com/content/280827[/URL]

  5. #5
    Registered User
    Join Date
    Mar 2010
    Posts
    21

    Re: Qt Mobility Simple service example

    Ok thanks, Is there any tutorial for creating a simple Qt service (step by step)?


    Thanks,
    Nandha.

  6. #6
    Registered User
    Join Date
    Mar 2010
    Posts
    21

    Re: Qt Mobility Simple service example

    Hi to all,

    How to write a simple service in QT mobility app (step by step)?
    I was searched in Qt code example and other places, but there is no proper quids to create a simple service.

    Please anybody help me !.

    To Nokia Developer Forum :
    1. How to create a simple qt service step by step ? (Service like in Android and Symbian c++, etc..)
    2. Please provide the sample Qt mobility service project.

    It will also helpful to me and others to learn the Qt service easily.

    Thanks,
    Nandha

  7. #7
    Registered User
    Join Date
    Mar 2010
    Posts
    21

    Re: Qt Mobility Simple service example

    Hi to All,

    Finally i created a simple qt service example. (referred from this sample https://projects.developer.nokia.com/wwdaemon)
    but i have facing service file reading problem.

    The Code is:

    const QString filemanagerxml = "c:\\resource\\apps\\xmldata\\NLTService.xml";
    int main(int argc, char *argv[])
    {
    QApplication app(argc, argv);
    Daemon daemon;

    const QString serviceName("SampleService");
    const QString interfaceName("com.nokia.qt.examples.LTService");
    const QString serviceVersion("1.0");
    QtMobility::QServiceManager manager;
    qDebug() << "ServiceManager created";

    // Remove old service
    manager.removeService(serviceName);

    qDebug() << "removeService completed";
    bool addServiceOk;
    // Add service
    if (QFile::exists(filemanagerxml)) {
    qDebug() << "Service file exists";
    addServiceOk= manager.addService(filemanagerxml);
    } else {
    qDebug() << "Service file not exists";
    addServiceOk=manager.removeService(serviceName);
    }
    if(addServiceOk)
    qDebug() << "Service Added Successfully";
    else
    qDebug() << "Service Adding failed";
    Q_ASSERT(addServiceOk);

    // Entry
    QtMobility::QRemoteServiceRegister serviceRegister;
    QtMobility::QRemoteServiceRegister::Entry entry = serviceRegister.createEntry<Daemon>(serviceName, interfaceName, serviceVersion);
    qDebug() << "serviceRegistered";
    // Publish
    serviceRegister.publishEntries("LTService");
    qDebug() << "publishEntries";
    // Keep service running
    serviceRegister.setQuitOnLastInstanceClosed(false);
    qDebug() << "setQuitOnLastInstanceClosed";

    return app.exec();
    }




    The Log was :
    [Qt Message] ServiceManager created
    [Qt Message] removeService completed
    [Qt Message] Service file not exists
    [Qt Message] Unable to open service xml file
    [Qt Message] Service Adding failed

    [Qt Message] serviceRegistered
    [Qt Message] publishEntries
    [Qt Message] setQuitOnLastInstanceClosed


    The Daemon class runs but it shows "Unable to open service xml file".

    NLTService.xml is placed in "Other files" directory of the project.
    sample wwdaemon project works fine.

    Please help to resolve it?

    Thanks
    Nandha
    Last edited by nandhagasc; 2012-04-23 at 06:43.

Similar Threads

  1. Simulator stops when running qt-mobility simple example
    By juancito_wdg in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-08-06, 18:10
  2. [Merged]HELP with a simple web service call
    By busilo2002 in forum Mobile Java Tools & SDKs
    Replies: 6
    Last Post: 2011-01-13, 16:13
  3. Simple game do NOT imply simple solution...
    By etamburini in forum Mobile Java General
    Replies: 3
    Last Post: 2005-04-28, 14:32
  4. Simple game do NOT imply simple solution...
    By etamburini in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2005-04-04, 15:29

Posting Permissions

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