Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 45
Registered: ‎08-29-2013
My Device: Blackberry curve-9360 and Blackberry bold-9860
My Carrier: Company
Accepted Solution

How to use Gif image in Blackberry android runtime

Hello,

 

I have deploy an android app in blackberry 10. Eveything is working fine in blackberry 10 excepting gif image. In android application gif image is displayed using AnimationDrawable from the link

 

http://developer.android.com/reference/android/graphics/drawable/AnimationDrawable.html

 

then how to use it in blackberry 10.

 

Is there any way to use gif in blackberry 10.

 

Please suggest.

 

Thanks in advance.

Highlighted
Developer
Posts: 19,636
Registered: ‎07-14-2008
My Device: Not Specified

Re: How to use Gif image in Blackberry android runtime

Wrong forum for BB10.

 

If you are using native/Cascades for your development, then ask the quesiton here.

 

http://supportforums.blackberry.com/t5/Native-Development/bd-p/Cascades

 

If you are using Android development to run on BB10, then ask the quetion here:

 

http://supportforums.blackberry.com/t5/Android-Runtime-Development/bd-p/adt

 

Developer
Posts: 45
Registered: ‎08-29-2013
My Device: Blackberry curve-9360 and Blackberry bold-9860
My Carrier: Company

Re: How to use Gif image in Blackberry android runtime

Hi,

 

I have got the solution .

 

It needs gifDecoder and gifDecoderView classes and following code snippet

 

View view = inflate.inflate(R.layout.layout_gspot, null);
GifDecoderView gif = (GifDecoderView) view.findViewById(R.id.gifView);
gif.setGifImageFromAssets("abc.gif");

 

and following layout code

 

  <com.android.gifImageReader.GifDecoderView
         android:id="@+id/gifView"
         android:layout_width="120dp"
         android:layout_height="120dp"
         android:layout_alignLeft="@+id/textView1"
         android:layout_centerVertical="true"
         android:background="@android:color/transparent" />