Discussion Board

Results 1 to 12 of 12

Threaded View

  1. #1
    Registered User saqibatiq's Avatar
    Join Date
    Nov 2012
    Location
    Lahore, Pakista
    Posts
    58
    I want some Nokia Champ or Pro Developer to answer my Question as I have already been given so many suggestions and solutions but none of them worked. I have designed a j2me application which reads contacts from SIM and Phone memory after selecting options (From Sim, From Phone) individually. I have problems in here which I think are from the Nokia Devices as I tried that over almost 30 to 50 mobile sets.

    Problem is defined here
    1- When reading contacts either from SIM or Phone for the very first time of the application is installed/Downloaded/Put into the phone, when I try to read contacts the application hangs there no matter how long I wait it doesn't work, and when I restart the application, it works fine. Now I want to ask whether this issue is genuinely in Nokia devices? because I tried to put even simplest lines of code to read contacts but on the very first time it always hang. Point to note that my application is signed from VeriSign and if run without certificate it works fine as it doesn't ask me for "Always" permission. So what I concluded is that when I select always permissions, it either unable to set those permissions at the first time or what else? I am posting the simplest code I used as I was suggested by some Nokia Developer to put code in Thread so did I but the same issue persists, and it actually messing up my development of the application. I need to resolve this issue at any cost. Here is the code

    Code:
    public void ReadContacts extends Thread{
                public void run(){
           try {
                boolean doWrite = true;
                contacts.removeAllElements();
                pim = PIM.getInstance();
                String lists[] = pim.listPIMLists(PIM.CONTACT_LIST);
                for (int i = 0; i < lists.length; i++) {
                    //code for custom backup operation
                    if (customCode == 1 && i == 0) {
                        continue;
                    } else if (customCode == 0 && i > 0) {
                        continue;
                    }
                    clist = (ContactList) pim.openPIMList(PIM.CONTACT_LIST, PIM.READ_ONLY, lists[i]);
                    Enumeration cenum = clist.items();
                    while (cenum.hasMoreElements()) {
                        Contact c = (Contact) cenum.nextElement();
                        ContactDTO contact = new ContactDTO();
                        parseContactInfo(c, contact);
                        if (customCode == 2 && i > 0) {
                            Enumeration cenum1 = contacts.elements();
                            ContactDTO contact1;
                            while (cenum1.hasMoreElements()) {
                                contact1 = (ContactDTO) cenum1.nextElement();
                                if (contact1.getName().equals(contact.getName())) {
                                    if (contact1.getCodedString().equals(contact.getCodedString())) {
                                        doWrite = false;
                                        break;
                                    } else {
                                        doWrite = true;
                                    }
                                }
                            }
                        }
                        if (doWrite) {
                            contacts.addElement(contact);
                        }
                    }
                    clist.close();
                }
            } catch (Exception e) {
          }
       }
    }
    ---of course I have this code modified according to my needs, but even if I use it's simplest form(just reading part) it still behaves like that, so don't ask me to put that code as you can understand what I mean, thanks---

    [Edit: Removed second part to put as new thread thinking that people may get interest to that too being individual and prominent]
    Last edited by saqibatiq; 2013-03-13 at 06:47.

Similar Threads

  1. problem in read contacts
    By sh3at in forum Symbian C++
    Replies: 1
    Last Post: 2011-07-14, 08:34
  2. How to read contacts
    By sreehari434 in forum Mobile Java General
    Replies: 8
    Last Post: 2009-11-28, 05:51
  3. AT command issue to read contacts
    By mukeshkb4u in forum General Messaging
    Replies: 0
    Last Post: 2009-03-30, 08:10
  4. Replies: 13
    Last Post: 2008-07-23, 17:06
  5. read contacts in S40
    By oscarm in forum Mobile Java General
    Replies: 6
    Last Post: 2008-02-27, 17:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved