Top News

Breaking


Source Code:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   
xmlns:app="http://schemas.android.com/apk/res-auto"
   
xmlns:tools="http://schemas.android.com/tools"
   
android:layout_width="match_parent"
   
android:layout_height="match_parent"
   
android:background="@drawable/bg"
   
android:orientation="vertical"
   
android:weightSum="10"
   
tools:context=".MainActivity"
>
    <!-- layout no 1 empty -->
   
<LinearLayout
        
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_weight="2.5"
       
android:orientation="horizontal"
/>
   
<!-- layout no 2 Contain 2 buttons -->
   
<LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_weight="3"
       
android:orientation="horizontal"
       
android:weightSum="4"
>
       
<!-- button no 1 for Images -->
       
<LinearLayout
           
android:layout_width="0dp"
           
android:layout_height="match_parent"
           
android:layout_weight="2"
           
android:weightSum="1"
>
            <
Button
               
android:layout_width="0dp"
               
android:layout_height="wrap_content"
                
android:layout_weight="1"
               
android:background="@drawable/image"
/>
        </
LinearLayout>
       
<!-- button no 2 for Videos -->
       
<LinearLayout
           
android:layout_width="0dp"
           
android:layout_height="match_parent"
           
android:layout_weight="2"
           
android:weightSum="1"
>
            <
Button
               
android:layout_width="0dp"
               
android:layout_height="wrap_content"
               
android:layout_weight="1"
                
android:background="@drawable/video"
/>
        </
LinearLayout>
    </
LinearLayout>
   
<!-- layout no 3 empty -->
   
<LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_weight="0.5"
       
android:orientation="horizontal"
/>
   
<!-- layout no 5 contain 2 buttons -->
   
<LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_weight="1"
       
android:orientation="horizontal"
       
android:weightSum="2"
>
       
<!-- button no 1 for share -->
       
<LinearLayout
           
android:layout_width="0dp"
           
android:layout_height="60dp"
           
android:layout_gravity="center"
           
android:layout_marginLeft="10dp"
           
android:layout_marginRight="15dp"
           
android:layout_weight="1"
           
android:gravity="center"
           
android:padding="10dp"
>
            <
Button
               
android:layout_width="wrap_content"
               
android:layout_height="wrap_content"
               
android:background="@drawable/share"
/>
        </
LinearLayout>
       
<!-- button no 1 for Rate us -->
       
<LinearLayout
           
android:layout_width="0dp"
           
android:layout_height="60dp"
           
android:layout_gravity="center"
           
android:layout_marginLeft="10dp"
           
android:layout_marginRight="15dp"
           
android:layout_weight="1"
           
android:gravity="center"
           
android:padding="10dp"
>
            <
Button
               
android:layout_width="wrap_content"
               
android:layout_height="wrap_content"
               
android:background="@drawable/rateus"
/>
        </
LinearLayout>
    </
LinearLayout>
   
<!-- layout no 6 empty -->
   
<LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_weight="0.5"
       
android:orientation="horizontal"
/>
   
<!-- layout no 7 help button -->
   
<LinearLayout
       
android:layout_width="150dp"
       
android:layout_height="0dp"
       
android:layout_gravity="center"
       
android:layout_weight="1"
       
android:gravity="center"
       
android:paddingTop="10dp"
       
android:paddingBottom="10dp"
       
android:weightSum="1"
>
        <
Button
           
android:layout_width="150dp"
           
android:layout_height="wrap_content"
           
android:layout_gravity="center"
           
android:background="@drawable/help"
           
android:gravity="center"
/>
    </
LinearLayout>
   
<!-- layout no 8 empty -->
   
<LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_weight="0.5"
       
android:orientation="horizontal"
/>
   
<!-- layout no 9 ads -->
   
<LinearLayout
       
android:layout_width="match_parent"
       
android:layout_height="0dp"
       
android:layout_gravity="center"
       
android:layout_weight="0.8"
       
android:gravity="center"
>
        <
com.google.android.gms.ads.AdView
            
xmlns:ads="http://schemas.android.com/apk/res-auto"
           
android:id="@+id/adView"
           
android:layout_width="wrap_content"
           
android:layout_height="wrap_content"
           
android:layout_gravity="bottom"
           
ads:adSize="SMART_BANNER"
           
ads:adUnitId="@string/banner_smart"
/>
    </
LinearLayout>
</
LinearLayout>
Step No 1:
AndroidManifest.xml
<application>
<activity android:name=".SplashScreen"          
      android:configChanges="screenSize|orientation"
      android:screenOrientation="portrait">
      <intent-filter>
         <action android:name="android.intent.action.MAIN" />
         <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
</activity>
</application>

Step No 2:
activity_splash_screen.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"  
xmlns:app="http://schemas.android.com/apk/res-auto"   
xmlns:tools="http://schemas.android.com/tools"  
android:layout_width="match_parent"
android:layout_height="match_parent" 
android:background="@drawable/bg"   
android:layout_gravity="center"  
android:gravity="center"   
android:orientation="vertical"   
tools:context=".SplashScreen">

    <ImageView       
                    android:layout_width="200dp"       
                    android:layout_height="200dp"      
                     android:background="@drawable/icon"
                     android:layout_gravity="center" />
</LinearLayout>

Step No 3:
SplashScreen.java
import android.content.Intent;
import android.os.Handler;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.Window;

public class SplashScreen extends AppCompatActivity {

    @Override    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        setContentView(R.layout.activity_splash_screen);

        new Handler().postDelayed(new Runnable() {
            @Override            public void run() {
                Intent intent = new Intent(getApplicationContext(), MainActivity.class);
                startActivity(intent);
                finish();
            }
        },3000);
    }
}