×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 34
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    10

    How to access phonebook contacts in Qt application

    I want to access phonebook contacts in to my application,
    I tried the example given on forum,
    But it not returns any contact from phonebook.
    Is the example given need to do some changes??
    Please help me.
    Thanks in advance.

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

    Re: How to access phonebook contacts in Qt application

    What example from which forum you are talking about?

  3. #3
    Registered User
    Join Date
    Feb 2010
    Posts
    10

    Re: How to access phonebook contacts in Qt application

    Hello Sir,
    Thank you for reply,
    I tried it from following link,

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

    In the following function

    void phonebook_manager::readall() {
    manager = NULL;

    QStringList availableManagers = QContactManager::availableManagers();



    for(int contact_manager_count = 0; contact_manager_count < availableManagers.count(); contact_manager_count++) {
    //Here availableManagers.count() returns 2
    //1.Memory 2.Invalid


    if(manager){
    delete manager;
    manager = NULL;
    }
    manager = new QContactManager(availableManagers.at(contact_manager_count));

    if(manager) {
    QList<QContactLocalId> contacts = manager->contacts();
    for(int contacts_count =0; contacts_count < contacts.count(); contacts_count++) {

    //Here contacts.count() returns zero But their are contacts in phonebook

    QContact contact = manager->contact(contacts.at(contacts_count));
    QList<QContactDetail> all_details = contact.details();

    foreach (const QContactDetail& details, all_details) {
    QList<QString> fieldKeys = details.values().keys();
    QString str_show =contact.displayLabel(); // display label of contact
    foreach (const QString& key, fieldKeys) {
    // key : give you the Field name
    // details.value(key) : give you Field value
    }
    }
    }
    }
    }
    }

    I was also modified .pro file as

    INCLUDEPATH += C:/QtMobility/src/contacts \
    INCLUDEPATH += C:/QtMobility/src/contacts/filters \
    INCLUDEPATH += C:/QtMobility/src/contacts/requests \
    INCLUDEPATH += C:/QtMobility/src/contacts/details
    INCLUDEPATH += C:/QtMobility/src/global

    CONFIG += mobility
    MOBILITY = contacts

    symbian::TARGET.CAPABILITY = ReadUserData \
    ReadDeviceData

    Regards,
    Prasad
    Last edited by prasadpop; 2010-05-17 at 06:22.

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

    Re: How to access phonebook contacts in Qt application

    Quote Originally Posted by prasadpop View Post
    for(int contact_manager_count = 0; contact_manager_count < availableManagers.count(); contact_manager_count++) {
    //Here availableManagers.count() returns 2
    //1.Memory 2.Invalid
    This means that Symbian contacts backend is missing (not installed or installed in wrong place).
    I think you can download proper binaries from here:
    http://qt.nokia.com/products/appdev/...-apis/mobility

  5. #5
    Registered User
    Join Date
    Feb 2010
    Posts
    10

    Re: How to access phonebook contacts in Qt application

    Hello sir,

    But the problem is still their,
    it returns the same contactManagers

    sorry but i cant understand about "contacts backend is missing", and where is it.
    i want to know which is the default contact manager.

    Thanks,
    Prasad

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

    Re: How to access phonebook contacts in Qt application

    Quote Originally Posted by prasadpop View Post
    sorry but i cant understand about "contacts backend is missing", and where is it.
    Qt Mobility contacts consists of two parts: contacts library, which provides API and to be used by applications and implementation of API, which is platform specific and is called a backend. I'm Maemo expert so I don't know what is a name of contact backend for Symbian, but AFAIK Symbian contacts backend was almost finalized, so it should not be missing.

  7. #7
    Nokia Developer Expert
    Join Date
    May 2010
    Posts
    65

    Re: How to access phonebook contacts in Qt application

    Hello Prasad,

    As divanov explained, the functionality exposed by the API is provided by platform specific engines (plugins). On Symbian (3.1 and later) the plugin is provided by qtcontacts_symbian.dll and its manager name is "symbian".

    The .sis package should install the plugin to the correct location. If, on the other hand, you are building and installing the library and plugins yourself, make sure you use the .sis file generated, because it should move the plugin to the $$QT_PLUGIN_PATH/contacts directory (also, note http://bugreports.qt.nokia.com/browse/QTBUG-7942).

    Note that the "invalid" and "memory" engines are not plugins, but are provided to allow developers to test their code (the invalid engine provides no functionality, so that developers can test that their error handling works, while the memory engine provides almost all possible functionality, but doesn't save any contact information persistently).

    Once the engine plugin is located in the plugin path, instantiating a QContactManager with the default constructor should produce a manager whose engine is the default for the given platform (on Symbian, that is the "symbian" engine).

    Are you able to provide more information about your environment (what version of Qt you're using, which compiler you used to build Qt, which compiler you used to build your application, which device you're attempting to deploy to, etc)?

    Cheers,
    Chris.

  8. #8
    Registered User
    Join Date
    Feb 2010
    Posts
    10

    Re: How to access phonebook contacts in Qt application

    Hello Chris,

    Thanks for replying,
    I am using Qt version 4.6.2, S60 sdk FP2 3rd edition v1.1, carbide v2.3
    and trying to deploy it on "xpressmusic 5800".
    The qtcontacts_symbian.dll file is over thier.But it unables to find the "symbian" contact manager.

    Thanks,
    Prasad.

  9. #9
    Nokia Developer Expert
    Join Date
    May 2010
    Posts
    65

    Re: How to access phonebook contacts in Qt application

    Hi Prasad,

    Could you please file this as a bug report (under the Contacts component of the Mobility project) at http://bugreports.qt.nokia.com/ so that we can track this issue?

    Thanks,
    Chris.

  10. #10
    Registered User
    Join Date
    Jul 2009
    Posts
    27

    Re: How to access phonebook contacts in Qt application

    Quote Originally Posted by chriadam View Post
    Hi Prasad,

    Could you please file this as a bug report (under the Contacts component of the Mobility project) at http://bugreports.qt.nokia.com/ so that we can track this issue?

    Thanks,
    Chris.
    Hi, I got the same problem, I tested it on device,it returned 4 managers: memeory, invalid, symbian, symbiansim, and when
    QContactManager manager = new QContactManager("symbian");
    QList<QContactLocalId> contacts = manager->contacts();
    the length of contacts is 0, when tried memeory, invalid,symbiansim, got the same result, is there any problem, thanks for your help.

  11. #11
    Nokia Developer Expert
    Join Date
    May 2010
    Posts
    65

    Re: How to access phonebook contacts in Qt application

    Quote Originally Posted by wshiyc View Post
    Hi, I got the same problem, I tested it on device,it returned 4 managers: memeory, invalid, symbian, symbiansim, and when
    QContactManager manager = new QContactManager("symbian");
    QList<QContactLocalId> contacts = manager->contacts();
    the length of contacts is 0, when tried memeory, invalid,symbiansim, got the same result, is there any problem, thanks for your help.
    Hi wshiyc,

    This is a different problem to the one that Prasad encountered, in that it appears that in your case the plugins are being loaded correctly. One thing that I do notice is that you use "QList<QContactLocalId> contacts = manager->contacts();" -- I believe it should be: "QList<QContactLocalId> contacts = manager->contactIds();" or "QList<QContact> contacts = manager->contacts();"

    Also, note that you can simply do: QContactManager manager("symbian"); if you do not want to have to remember to delete the manager instance at the end of your function.

    If the problem still persists, it is possible that all of the contacts on your device are actually SIM contacts (in which case, try the same code with the "symbiansim" manager). If that does not work either, you should submit a bug report so that we can track the issue properly.

    Cheers,
    Chris.

  12. #12
    Registered User
    Join Date
    Jul 2009
    Posts
    27

    Re: How to access phonebook contacts in Qt application

    Quote Originally Posted by chriadam View Post
    Hi wshiyc,

    This is a different problem to the one that Prasad encountered, in that it appears that in your case the plugins are being loaded correctly. One thing that I do notice is that you use "QList<QContactLocalId> contacts = manager->contacts();" -- I believe it should be: "QList<QContactLocalId> contacts = manager->contactIds();" or "QList<QContact> contacts = manager->contacts();"

    Also, note that you can simply do: QContactManager manager("symbian"); if you do not want to have to remember to delete the manager instance at the end of your function.

    If the problem still persists, it is possible that all of the contacts on your device are actually SIM contacts (in which case, try the same code with the "symbiansim" manager). If that does not work either, you should submit a bug report so that we can track the issue properly.

    Cheers,
    Chris.
    it works, I have not thought about it yet, thank you very much.

  13. #13
    Registered User
    Join Date
    Apr 2009
    Posts
    47

    Re: How to access phonebook contacts in Qt application

    @chriadam and divanov, i am also facing the problem which is similar to prasadpop. we have logged bug regarding this issue at Qt bug tracker,

    http://bugreports.qt.nokia.com/browse/QTMOBILITY-338

    is this known issue or we are wrong some where please suggest and help us.

    Thanks

  14. #14
    Nokia Developer Expert
    Join Date
    May 2010
    Posts
    65

    Re: How to access phonebook contacts in Qt application

    Hello ravindra.n,

    We will need some more information, as requested in a comment to that bug report. The memory backend does not persist any information to a database or the system addressbook, so if you're using Symbian you should use the "symbian" engine, probably. If doing something simple like:

    QContactManager cm("symbian");
    QContact test;
    QContactName testName;
    testName.setFirstName("Test");
    testName.setLastName("Contact");
    test.saveDetail(&testName);
    cm.saveContact(&test);

    fails or crashes on device, then the problem is probably one of the following:
    1) the plugin which provides the "symbian" engine isn't being deployed or found correctly
    2) the application doesn't have the required capabilities
    3) the device does not have the correct libraries installed

    etc. In that case, providing a backtrace or other debugging information might be helpful.

    Thanks,
    Chris.

  15. #15
    Registered User
    Join Date
    Apr 2009
    Posts
    47

    Re: How to access phonebook contacts in Qt application

    Hi,
    i just downloaded the New NokiaQT RC SDK and then tried. i am not getting any error to backtrack.
    even i dont have the source code, i just have the libs.

    its just crashing at the constructor if manager as "symbian" if the manager is "simulator" then my system gets hung up and we'r not getting the error code also

    if the device doesnt have the correct lib's or "symbian" engine doesnt deploy properly, then how i am i able to list out all the managr available in phone or simulator. how is the source code is building?.

    do you have any recomended links from which i can download SDK?
    in which operating system the SDK works well?.

    kindly help us.
    Thanks

Similar Threads

  1. Message Access Permission for a Trusted application for Series 40 handsets
    By vishalnigam in forum General Development Questions
    Replies: 1
    Last Post: 2009-05-28, 17:37
  2. Contacts imports memory consumption problem.
    By senthil_epigon in forum Symbian
    Replies: 2
    Last Post: 2009-04-30, 05:57
  3. Need help to access contacts from phonebook
    By amol_benare604 in forum Symbian
    Replies: 2
    Last Post: 2009-04-29, 08:30
  4. How to Access 9210 Dbms file from my desktop application?
    By Nokia_Archive in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2002-06-03, 03:46

Posting Permissions

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