Posts

Showing posts from March, 2010

Simple animation in android

Hi, here is a way to create a very simple animation in android. Probably you know that there are tow types of animations in android. 1. tween animation and 2. Frame animation I'm describing a simple example of tween animation. Let's start. suppose we have a ImageView on a LinearLayout. we want to create a animation so that the image will move from a point to another point. First we have to create a xml file in the res/layout folder in which we'll show the image. It may be something like this - <?xml version="1.0" encoding="utf-8"? > < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:layout_gravity="center" android:layout_height="fill_parent" android:layout_width="fill_parent" > < ImageView android:background="@drawable/animtest" android:layout_w