×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    3

    Save animated gif as contact photo

    Hello - I am using a Asha 303. I have verified that I am able to attach an animated gif to a contact using the native contact application which the phone displays properly on incoming call. When I try to use the PIM API to attach the same gif file, the phone shows only the first frame of animated gif. Since the phone only supports the CONTACT.PHOTO option I am Base64 encoding the image before calling the contact.addBinary method. Can anyone suggest why the phone would not animate the gif when attached in this way? Has anyone succeeded in doing this?

    Thanks in advance

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

    Re: Save animated gif as contact photo

    Quote Originally Posted by dave7010 View Post
    Hello - I am using a Asha 303. I have verified that I am able to attach an animated gif to a contact using the native contact application which the phone displays properly on incoming call. When I try to use the PIM API to attach the same gif file, the phone shows only the first frame of animated gif. Since the phone only supports the CONTACT.PHOTO option I am Base64 encoding the image before calling the contact.addBinary method. Can anyone suggest why the phone would not animate the gif when attached in this way? Has anyone succeeded in doing this?

    Thanks in advance
    Check if this device supports - CONTACT.PHOTO_URL, field you save the file in file system and provide its URL.
    If CONTACT.PHOTO_URL is not supported then try addBinary without Base64 encoding and see if it works.
    thanks,
    ~Amitabh
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Save animated gif as contact photo

    Hi

    It seems native app and java interface are not similar in functionality. At least you do correctly encoding picture to base64. There is 'attribute' parameter that describes base64 encoded data value. If Nokia device supported the attribute they would give more information how to use it. By default that parameter is ignored. So i think you cannot fix that.

  4. #4
    Registered User
    Join Date
    Jul 2012
    Posts
    3

    Re: Save animated gif as contact photo

    The CONTACT.PHOTO_URL is not supported. They do support PIMItem.EXTENDED_FIELD_MIN_VALUE for video. Problem is that I want to display an animation of sorts that no audio which means the phone won't ring. I tried without Base64 encoding which does not work even for static pictures. Which 'attribute' parameter are you referring to?

  5. #5
    Nokia Developer Expert
    Join Date
    Oct 2007
    Posts
    441

    Re: Save animated gif as contact photo

    Hi

    i referred to the third parameter in the call
    Code:
    public void setBinary(int field,
                          int index,
                          int attributes,
                          byte[] value,
                          int offset,
                          int length)
    attributes - a bit array specifying any optional attributes describing this value. These attributes are a hint to the about the value's characteristics and some or all may be ignored by this method due to platform restrictions. Attributes that are invalid or not applicable are also ignored.

    As for base64 encoding that is only way how it accepts binary -- so you do it correctly

    Have you checked this "How to add a video clip to a contact in Java ME"

  6. #6
    Registered User
    Join Date
    Jul 2012
    Posts
    3

    Re: Save animated gif as contact photo

    As I mentioned in my previous post, attaching a video will not be suitable since the video will be without audio. The user will not hear his phone ring. If there was a way to for the phone to default to native ringtone where no audio was found this would be ideal.

Similar Threads

  1. Add photo to contact using Qt
    By rami75lu in forum [Archived] Qt Mobility Project
    Replies: 1
    Last Post: 2011-05-12, 12:18
  2. Save image into phone photo gallery
    By VVNart in forum [Archived] Qt Quick
    Replies: 0
    Last Post: 2011-05-12, 10:07
  3. Add Photo to Contact using PIM
    By mtawil in forum Mobile Java General
    Replies: 0
    Last Post: 2009-12-30, 15:25
  4. S40 support for Contact.PHOTO
    By zsu0915 in forum Mobile Java General
    Replies: 2
    Last Post: 2008-06-30, 17:51

Posting Permissions

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