Like Us on Facebook

How to create Animated Splash Screen in Android

Hi friends today I am going to share with you how to create an animated splash screen. All of you know Android Apps required some time for start up. To avoid the delay and leaving the blank screen for the short period of time we use splash screen . But if you make an Animated splash screen, it will be great for user experience of your Apps. So , an Animated splash screen reduce waste of time and entertained user to engaging with the apps more. But how to create an Animated Splash screen? There are so many way to make it. Here is the one of them I am telling you

 Read more 
How to Animate your Android App
How to make FlashLight Application in Android

How to create Animated Splash screen in Android UandBlog

Prerequisites:
 
  • JDK 7.0 or Above
  • Android Studio 2.0
 

Steps to follow:

 
Step 1: Create a New Android Studio project name AnimationSplash.

Step 2: Select minimum API level 16so that it can support maximum of Android Device available in the google play.

Step 3: Give your layout xml name is activity_main And click finish .
 
Step 4: Now create a class SplashScreen.java. Inside it write the following code.
 
public class SplashScreen extends Activity{
 
  ProgressBar mprogressBar;
 
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.splashscreen);
    Animation anim1 = AnimationUtils.loadAnimation(this,R.anim.anim_down);
    ImageView img =(ImageView)findViewById(R.id.imageView);
    img.setAnimation(anim1);
 
    mprogressBar = (ProgressBar) findViewById(R.id.progressBar);
    ObjectAnimator anim = ObjectAnimator.ofInt(mprogressBar, "progress", 0, 100);
    anim.setDuration(4000);
    anim.setInterpolator(new DecelerateInterpolator());
    anim.start();
 
    Handler handler = new Handler();
 
    handler.postDelayed(new Runnable() {
      @Override
      public void run() {
 
        startActivity(new Intent(SplashScreen.this,MainActivity.class));
        finish();
 
      }
    },3000);
  }
}
 

Step 5: Create a folder anim within res folder. create an xml file is called anim_down.xml. write the following code within it.
 
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android">
 
<translate
    android:duration ="900"
    android:fromYDelta="-2000"
    android:toYDelta="0"
    />
 
</set>


Step 6: Create an Xml file within Drawable folder name circular_screen.xml . write the following code inside it. Put an image inside Drawable folder.
 
<?xml version="1.0" encoding="utf-8"?>
<shape
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:innerRadiusRatio="2.3"
  android:shape="ring"
  android:thickness="10dp"
  android:useLevel="true">
<solid android:color="@color/colorPrimary" />
</shape>
 

Step 7: And create xml file splashscreen.xml within layout folder.
 
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
  android:orientation="vertical" android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:weightSum="1">
 
 
<ProgressBar
    style="?android:attr/progressBarStyleLarge"
    android:layout_width="65dp"
    android:layout_height="64dp"
    android:id="@+id/progressBar"
    android:max="48"
    android:progress="1"
    android:progressDrawable="@drawable/circular_screen"
    android:layout_gravity="center_horizontal"
    android:layout_centerVertical="true"
    android:layout_centerHorizontal="true" />
 
<ImageView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/imageView"
    android:src ="@drawable/anim_image"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="54dp" />
 
</RelativeLayout>

Posted By UandBlog

UandBlog is a Global Leading source of Finance, Health, Lifestyle, Technology, Gaming and Programing and other information, it is a fastest growing blog for all , for latest post or information like us on facebook , follow on Twitter, Google+ and Pinterest.

Comments ( 3 )

umesh raj:
wrong download code u uploaded...i need the drawable anim image...
umesh raj:
wrong download code u uploaded.. i need anim image which is in the drawable code
pavan yadav:
Its not the animation which u have shown at the beginning. FAKE...!!!

    Leave a comment..

    Click to login.

    Subscribe Latest Information

    Most Popular Posts

    You May Like Also