Android Interview Questions

Want to become an expert in cracking Android interview questions?

Start with practicing the questions below. Whether a question involves multiple choice or live coding, we will give you hints as you go and tell you if your answers are correct or incorrect.

After that, take our timed public Android Interview Questions Test.

To use our service for testing candidates, buy a pack of candidates.


1. Screen Orientation

Android Event handling Public

Which of these methods are called when the screen changes orientation from portrait to landscape in Android?

(Select all acceptable answers.)

Easy  
3min
   


2. Shared Preferences

Android UI Public

Fill in the blanks, so that changes in the shared preferences are saved:

SharedPreferences pref = getApplicationContext().getSharedPreferences("MyPref", MODE_PRIVATE);
Editor editor = pref.();
editor.putString("start_message", "Hello!");
editor.putString("end_message", "Goodbye!");
editor.();
Easy 
3min
   


3. User Layout

Android UI Public New

Consider the following image:

Fill in the blanks in the following layout so that it renders like the image above:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="">
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="5dp"
                android:text="User"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="5dp"
                android:text="Last login date"/>
        </LinearLayout>
        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="">
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="5dp"
                android:text="Address"/>
            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:padding="5dp"
                android:text="Secondary address"/>
        </LinearLayout>
</LinearLayout>
Easy 
5min
   


4. Parcelable

Android Interprocess communication Public

Which statements are true for the Parcelable interface?

(Select all acceptable answers.)

Hard  
2min
   


5. Media Player

Android Multithreading Public

Consider the following code:

@Override
protected void onResume() {
    super.onResume();
    mp = MediaPlayer.create(getBaseContext(), R.raw.sound);
    Thread timer = new Thread() {
        @Override
        public void run() {
            try {
                Thread.sleep(1000);
                Intent main = new Intent(Splash.this, MainActivity.class);
                startActivity(main);
                finish();
            } catch (InterruptedException e) {}
        }
    };
    timer.start();
    mp.start();
}

@Override
protected void onPause() {
    super.onPause();
    if (mp != null) {
        if (mp.isPlaying()) {
            mp.stop();
        }
        mp.release();
        mp = null;
    }
}

Select the statements that are correct if the wave file sound is 3 seconds long.

(Select all acceptable answers.)

Hard  
3min
   


If you feel ready, take one of our timed public Android Interview Questions tests:
  • Android Online Test (Easy / Hard)
  • Android and Java Online Test (Easy / Hard)
Not exactly what you are looking for? Go to our For Jobseekers section.