Sunday 20 July 2014

Android Splash Screen Example with Animation | Animated Splash Screen android

Hello Friends,
        Today, I am going to share the tutorial of android splash screen with animation.
With help of this tutorial you can easily implement the facebook like splash screen
or skype like splash screen.
                           
Android animated splash screen

1. Create an Android Project "SplashScreen"
2. Create an folder "anim" inside the res folder
3. Create two file inside the "anim" folder
      a. alpha.xml
   
         <?xml version="1.0" encoding="utf-8"?>

              <alpha
              xmlns:android="http://schemas.android.com/apk/res/android"
              android:fromAlpha="0.0"
              android:toAlpha="1.0"
              android:duration="3000" />

     b. translate.xml
<?xml version="1.0" encoding="utf-8"?>

         <set

              xmlns:android="http://schemas.android.com/apk/res/android">
             <translate
                 xmlns:android="http://schemas.android.com/apk/res/android"
                 android:fromXDelta="0%"
                 android:toXDelta="0%"
                 android:fromYDelta="900%"
                 android:toYDelta="0%"
                 android:duration="2000"
                 android:zAdjustment="top" />
         </set>

4. inside your oncreate() called this method
 
public class SpalshScreenActivity extends Activity {

    /** Called when the activity is first created. */

    @Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        StartAnimations();

    }
     ................
     ................

  }

      private void StartAnimations() {
    	Animation anim = AnimationUtils.loadAnimation(this, R.anim.alpha);
		anim.reset();
		LinearLayout l = (LinearLayout) findViewById(R.id.lin_lay);
		l.clearAnimation();
		l.startAnimation(anim);

		anim = AnimationUtils.loadAnimation(this, R.anim.translate);
		anim.reset();
		ImageView iv = (ImageView) findViewById(R.id.logo);
		iv.clearAnimation();
		iv.startAnimation(anim);

		anim = AnimationUtils.loadAnimation(this, R.anim.translate);
		anim.reset();
		LinearLayout l2 = (LinearLayout) findViewById(R.id.linear2);
		l2.setVisibility(View.VISIBLE);
		l2.clearAnimation();
		l2.startAnimation(anim);
    }


Download the code : Android animate splash sreen

Hope this will help someone
Enjoy Coding.... :)

Mukesh Kumar

Hi Guys I am from Delhi working as Web/Mobile Application Developer(Android Developer), also have knowledge of Roboelctric and Mockito ,android test driven development... Blogging has been my passion and I think blogging is one of the powerful medium to share knowledge and ideas....

9 comments:

  1. Thanks buddy. It is very helping for mine :)

    ReplyDelete
  2. i'm going to develop a RESTAURANT billing application .
    I don't know where to start please help me....

    ReplyDelete
  3. Very nice thank you!

    ReplyDelete
  4. Thanks Mukesh, thats help me to build splashscreen more better

    ReplyDelete
  5. If only there are more C# android tutorials out there...

    ReplyDelete
  6. what is other required layout or xml?

    ReplyDelete
    Replies
    1. Hello Amir,
      I am not getting your point...what u want to implement?
      please check complete code at below link
      https://github.com/mukesh4u/AnimatdSplashScreen

      Delete

 

Copyright @ 2013 Android Developers Blog.