Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One of the ways in which android application developer can add moving images like those in GIF Format is by using AnimationDrawable class which is under the package “android.graphics.drawable.AnimationDrawable”.This class uses multiple images as frames and displays them with particular animation which can be set using the class functions.</p> <p>Firstly,the package needs to be imported and in the \res\drawable folder the images have to be copied which are to be displayed or animated.</p> <p>Secondly,the images needs to be converted to <code>Bitmap</code> using <code>BitmapDrawable</code> class which is under the package “android.graphics.drawable.BitmapDrawable” .The images are converted as shown below:</p> <pre><code>BitmapDrawable frame1=(BitmapDrawable)getResources().getDrawable(R.drawable.w1); </code></pre> <p>where w1 is the name of the image in\res\drawable folder.</p> <p>Thirdly,these Bitmap images have to be added to the animation.</p> <p>The addFrame(Drawable frame,int duration) function is used to add frames(images) to the animation.The two parameters frame and duration are Bitamap image(frame) and the time in milliseconds for which the frame(image) should appear.The function <code>setOmeShot(boolean)</code> is used to set whether animation is to be played once or repeat.Pass true if the animation should only play once otherwise false.</p> <p>Fourthly, the animation has to be set to the ImageView.</p> <p>Lastly the animation has to be started.</p> <pre><code>animation.start(); </code></pre> <p>//For full post with sample code you can visit <a href="http://jannatyahan.com/android-application-development-tutorial-for-displaying-moving-images-in-android-application/" rel="nofollow">post on my website</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload