×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Jun 2010
    Posts
    1

    Problem to display the PIM Contact -> photo

    Hi,

    I am new bee in J2ME , My application is working fine on Java Wireless toolkit but on S60 phone app not shown Contact ->PHOTO . After search, i found that base64 decoding is required to view Contact ->PHOTO on S60 phone.

    Here is my Code but not working:
    ====================================
    photo = c.getBinary(Contact.PHOTO, Contact.ATTR_NONE);

    photo = Base64.decode(photo);

    Image image = Image.createImage(photo, 0, photo.length);

    =========================================

    Plz help me to fix this problem .

  2. #2
    Registered User
    Join Date
    Oct 2009
    Location
    Noida
    Posts
    941

    Re: Problem to display the PIM Contact -> photo

    try this:
    ====================================
    photo = c.getBinary(Contact.PHOTO, Contact.ATTR_NONE);

    photodata = Base64.decode(photo);

    Image image = Image.createImage(photodata , 0, photodata .length);

    =========================================

    If it still fails even try this:
    ====================================
    photo = c.getBinary(Contact.PHOTO, Contact.ATTR_NONE);

    photodata = Base64.decode(photo);

    dataphoto = Base64.decode(photodata ); // double base64 decoding

    Image image = Image.createImage(dataphoto , 0, dataphoto .length);

    =========================================
    Thanks,
    Ekta

  3. #3
    Registered User
    Join Date
    Feb 2011
    Location
    Bahia Brasil
    Posts
    8

    Re: Problem to display the PIM Contact -> photo

    hello,

    i'm stuck with an IndexOutOfBoundsException (debugger says it's probably the "Contact.ATTR_NONE" in "getBinary(Contact.PHOTO, Contact.ATTR_NONE)").
    will somebody please give me any hint or point to some documentation.. i've already finished the javadocs and i'm running out of google keyword searches.

    thanks

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

    Re: Problem to display the PIM Contact -> photo

    Quote Originally Posted by vinicius1880 View Post
    hello,

    i'm stuck with an IndexOutOfBoundsException (debugger says it's probably the "Contact.ATTR_NONE" in "getBinary(Contact.PHOTO, Contact.ATTR_NONE)").
    will somebody please give me any hint or point to some documentation.. i've already finished the javadocs and i'm running out of google keyword searches.

    thanks
    On which device you are trying... if Contact.PHOTO is failing -- your device might be supporting Contact.PHOTO_URL field, in which case you will need to use FCA API to get the contact photo from file path which you get as URL from this.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  5. #5
    Registered User
    Join Date
    Feb 2011
    Location
    Bahia Brasil
    Posts
    8

    Re: Problem to display the PIM Contact -> photo

    thanks for replying.
    well i'm testing both on the emulator and on my nokia5800 XM.
    the field Contact.PHOTO is indeed available on both, i'm querying the system in advance.
    this IndexOutOfBoundsException refers actually to the index argument in the getBinary call.
    it's either zero (when i use Contact.ATTR_NONE) or -1(when i try GetPreferredIndex())
    thanks again

Similar Threads

  1. Add Photo to Contact using PIM
    By mtawil in forum Mobile Java General
    Replies: 0
    Last Post: 2009-12-30, 15:25
  2. Problem in addind a photo to a contact
    By nroyer in forum Symbian
    Replies: 5
    Last Post: 2007-12-18, 14:15
  3. Problem to display the photo of a VCard using PIM API
    By oleberre in forum Mobile Java General
    Replies: 29
    Last Post: 2007-08-09, 12:10
  4. Replies: 2
    Last Post: 2007-07-07, 16:02
  5. problem with delete of contact by using contact PIM api
    By mail_rahman in forum Mobile Java General
    Replies: 4
    Last Post: 2007-06-28, 20:14

Posting Permissions

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