I have the following class, **SplashActivity.java**:

```
public class SplashScreen extends Activity{

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);

        setContentView(R.layout.splash);
        Thread timer = new Thread(){
            public void run(){
                try{
                    sleep(5000);
                }catch(InterruptedException e)
                {
                    e.printStackTrace();
                }
                finally{
                    Intent tutorial = new Intent(SplashScreen.this, TutorialOne.class);
                    startActivity(tutorial);
                }

            }
        };
        timer.start();
          }
}

```

I want this activity to load only once, when the app is first installed on the mobile device for the first time. Being new to android I have very little idea about this. I read in places that the `SharedPreferences` is to be used, but did not understand the implementation. And the thing about this activity is that, the activity has to act as a `Launcher` when used for the first time, that's what really confused me. Because in the manifest file I am declaring another activity which in my case would be the `MainPage.java`. So how can I implement this logic ?? Do I call upon the `SplashActivity` in the `MainPage` or is there something else that must be done ?? Please help someone ? 

Can someone please write down the code to implement this logic if possible?