×

Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    41

    Decompress then save again as contact to phone book, it is possible?

    Hi,

    I'm develop an application (based on example of WTK22-PDAPDemo). In this application, user can access phone book (read write) in memory device, then can select contact/s (1,5, and all), compress selected contact, and send them to destination number (server).
    in server (in this case, I make simulator only using an application J2mE too, that can receive sms from client (that contain compressed contact in it), decompress it, and then show the originil file (contact) again.

    But, this application can't save that contact to phonebook again (because I didn't know how to do this in emulator and also real device/HP).

    It is possible to save again contact (result fo decompressed) to phonebook again?
    or we must use another way, maybe RMS?

    Need your help please...

    Thanks.

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Decompress then save again as contact to phone book, it is possible?

    Yes, you can save the Contact to phone book again.

    Steps:
    1) Open the Contact Book - PIM LIST in read write mode,
    2) Craete a Contact object -- by filling all decompressed data
    3) Commit the Conatct back to Contact LIST.



    thanks,
    ~Amitabh
    Last edited by im2amit; 2009-08-31 at 13:05.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    41

    Re: Decompress then save again as contact to phone book, it is possible?

    Yup, I'll try it.

    Thanks for your reply

  4. #4
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Decompress then save again as contact to phone book, it is possible?

    Got your pvt. msg:

    You can look at the following wiki link for the code example for the same:
    http://wiki.forum.nokia.com/index.ph...ook_in_Java_ME

    try to fix your code using this example..

    thanks,
    ~Amitabh

  5. #5
    Registered User
    Join Date
    Sep 2008
    Posts
    41

    Re: Decompress then save again as contact to phone book, it is possible?

    Hi,

    I've try that source, but why when after I addedd contact (fill each field of contact), it can't save into contact list in emulator?

    It show message error like this :
    Warning: To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.

    FYI :
    Here my midlet-permission (because of confuse, so that I added most all of them) :
    javax.wireless.messaging.sms.receive
    javax.microedition.io.Connector.file.write
    javax.wireless.messaging.mms.receive
    javax.wireless.messaging.mms.send
    javax.wireless.messaging.sms.send
    javax.microedition.io.Connector.file.read
    javax.microedition.pim.ContactList.read
    javax.microedition.pim.ContactList.write
    javax.microedition.pim.EventList.read
    javax.microedition.pim.EventList.write
    javax.microedition.pim.ToDoList.read
    javax.microedition.pim.ToDoList.write
    javax.microedition.io.Connector.socket
    javax.microedition.io.Connector.http
    javax.microedition.io.Connector.sms
    javax.microedition.io.Connector.mms
    javax.microedition.io.Connector.cbs
    javax.microedition.io.Connector.serversocket
    javax.microedition.io.Connector.datagramreceiver
    javax.microedition.io.PushRegistry
    javax.microedition.io.Connector.bluetooth.client
    javax.microedition.io.Connector.bluetooth.server
    javax.microedition.io.Connector.obex.server.tcp
    javax.microedition.io.Connector.obex.client.tcp


    Need your help please...

  6. #6
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Decompress then save again as contact to phone book, it is possible?

    To avoid potential deadlock, operations that may block, such as
    networking, should be performed in a different thread than the
    commandAction() handler.
    Move your JSR 75, PIM realted operation to a seperate thread pass the contact data to be stored in PIM to this thread and start it, dont call it directly from your commandAction() handler as its blocking operation.

    for interacting with PIM Contacts you only need: the following permissions.
    javax.microedition.pim.ContactList.read
    javax.microedition.pim.ContactList.write

    thanks,
    ~Amitabh

  7. #7
    Registered User
    Join Date
    Sep 2008
    Posts
    41

    Re: Decompress then save again as contact to phone book, it is possible?

    Hi,

    Thanks for info. I've change about midlet-permission as you suggest.
    About JRE75, you mean remove it=uncheck it from Setting menu?
    Because I do that and it show 28 errors message.

    Also, I didn't understand exactly about this :
    dont call it directly from your commandAction() handler as its blocking operation.
    According that, how to do that?

    Need your help again plz..

  8. #8
    Registered User
    Join Date
    Sep 2008
    Posts
    41

    Re: Decompress then save again as contact to phone book, it is possible?

    here the error messages (28 errors) :
    =============================
    Building "AddContact"
    C:\WTK22\apps\AddContact\src\AddContact.java:13: package javax.microedition.pim does not exist
    import javax.microedition.pim.Contact;
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:14: package javax.microedition.pim does not exist
    import javax.microedition.pim.ContactList;
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:15: package javax.microedition.pim does not exist
    import javax.microedition.pim.PIM;
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:16: package javax.microedition.pim does not exist
    import javax.microedition.pim.PIMException;
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:17: package javax.microedition.pim does not exist
    import javax.microedition.pim.PIMItem;
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:111: cannot find symbol
    symbol : class ContactList
    location: class AddContact
    ContactList contacts = null;
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:114: cannot find symbol
    symbol : class ContactList
    location: class AddContact
    contacts = (ContactList) PIM.getInstance().openPIMList(
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:115: cannot find symbol
    symbol : variable PIM
    location: class AddContact
    PIM.CONTACT_LIST, PIM.READ_WRITE);
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:115: cannot find symbol
    symbol : variable PIM
    location: class AddContact
    PIM.CONTACT_LIST, PIM.READ_WRITE);
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:114: cannot find symbol
    symbol : variable PIM
    location: class AddContact
    contacts = (ContactList) PIM.getInstance().openPIMList(
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:117: cannot find symbol
    symbol : class Contact
    location: class AddContact
    Contact contact = contacts.createContact();
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:120: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    new String[contacts.stringArraySize(Contact.NAME)];
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:123: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    Contact.NAME, Contact.NAME_FAMILY)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:123: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    Contact.NAME, Contact.NAME_FAMILY)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:124: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    name[Contact.NAME_FAMILY] = familyName.getString();
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:127: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    Contact.NAME, Contact.NAME_GIVEN)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:127: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    Contact.NAME, Contact.NAME_GIVEN)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:128: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    name[Contact.NAME_GIVEN] = givenName.getString();
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:130: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    if (contacts.isSupportedField(Contact.NAME)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:131: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    contact.addStringArray(Contact.NAME, PIMItem.ATTR_NONE, name);
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:131: cannot find symbol
    symbol : variable PIMItem
    location: class AddContact
    contact.addStringArray(Contact.NAME, PIMItem.ATTR_NONE, name);
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:134: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    if (contacts.isSupportedField(Contact.TEL)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:135: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    contact.addString(Contact.TEL, Contact.ATTR_HOME,
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:135: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    contact.addString(Contact.TEL, Contact.ATTR_HOME,
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:138: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    if (contacts.isSupportedField(Contact.BIRTHDAY)) {
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:139: cannot find symbol
    symbol : variable Contact
    location: class AddContact
    contact.addDate(Contact.BIRTHDAY, PIMItem.ATTR_NONE,
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:139: cannot find symbol
    symbol : variable PIMItem
    location: class AddContact
    contact.addDate(Contact.BIRTHDAY, PIMItem.ATTR_NONE,
    ^
    C:\WTK22\apps\AddContact\src\AddContact.java:144: cannot find symbol
    symbol : class PIMException
    location: class AddContact
    } catch (PIMException e) {
    ^
    ============

  9. #9
    Nokia Developer Champion
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    3,085

    Re: Decompress then save again as contact to phone book, it is possible?

    Move your JSR 75, PIM realted operation to a seperate thread pass the contact data to be stored in PIM to this thread and start it, dont call it directly from your commandAction() handler as its blocking operation.
    Move does't means REMOVE it from settings - add it back.

    Move to seperate thread means -- Create a seperate Thread class and move this PIM code block in its run() method and call it from this class - commandHander()

    thanks,
    ~Amitabh

Similar Threads

  1. Random RingTone within Contact List for 3rd
    By cckfranky in forum Symbian
    Replies: 5
    Last Post: 2007-12-29, 18:33
  2. Replies: 1
    Last Post: 2007-10-30, 20:37
  3. save NAME in new contact
    By oscarm in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2007-09-07, 21:20
  4. Retrieve contact phone number on series 60 third edition
    By razas in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-05-08, 07:12

Posting Permissions

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