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

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);
}
}
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>
<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>
<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>
<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>

Comments ( 3 )

umesh raj:
wrong download code u uploaded...i need the drawable anim image...
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
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...!!!
Its not the animation which u have shown at the beginning. FAKE...!!!
Subscribe Latest Information
Categories
Most Popular Posts
How to Withdraw Money from ATM Machine 7steps 1127808 Views
How to Create Chat Application in Android Studio 144128 Views
How to Create a Shopping Cart Application in Android 105679 Views
You May Like Also
How to create your first Android Game 14669 Views
How to make a Simple Quiz App in Android 67748 Views
How to Animate your Android App 8066 Views