Android Interview Q & A

Top 30 Android Interview Questions &Answers

In the today’s world ,Android demanding is growing day to day.So the top questions which is asked by the interviewer is give below.

1 What is Android ?

Android is open source and linux based operating system which is used  in mobile,smartphones and tablets computers etc.

It is acquired by the google in 2005 and launched it in 2007 for the smartphones ,tablets etc.

2 Who is the founder of Android ?

Andy rubin

3 what is the main component/framework  of android ?

Activity

It represents a single screen in which user can interact and perform operations.

It is same as frame/window

Services:

The operations are performed in the background is known as services

Intent:

It is used to go one activity to another or transfer data between the activities .There are   two types of intent(implicit & explicit)

Content provider:

It is used to share data between the applications

It enable user to access the data like audio,video etc within the application

Resources:

resources -res/string, res/layout, res/drawable, res/menu etc

Others

view,fragment etc

4 what is intent

It is a message which is passed between the component(like activity,services,broadcast receiver etc)

It is used to go one activity to another,transfer data between the activites or launch the activity etc.

There are two types of intent

a.implicit

b.explicit

5 How to go from one activity to another ?

Intent intent=new Intent(getApplicationContext,Activity2.class)

 startActivity(intent)

6 what do you mean by ANR ?

ANR stands for “Application not responding”.It is dialog box which appears when application not responding for long period of time

7 what are the Android activity life-cycle ?

onCreate:when android activity launched  first time

onStart:when activity visible to the user

onResume:when activity start interact with the user

onPause:when activity not visible to the user

onStop:when activity is not visible to longer to the user

onRestart:when activity has stopped

onDestroy: when activity has finished

8 What do you mean by APK ?

APK stands for android packaging kit.It is the compressed file of application codes ,manifest(All classes are defined etc) , resources files(drawable,string ,menu etc)  and other files.All the files are compressed into single unit is known as APK.

9 What do you mean by ADB ?

ADB stands for Android Debug Bridge.It is a debugging application which provides tools to the developer to perform action such as communicate to the emulator,browse the device,copy tools etc

10 What are the various storage methods in android ?

Android provides various storage methods.

1.shared preference: It store value in key-value pair formate

2.Internal storage: It store private data on the device memory

3.External storage: It store private data from the main device or secondary storage

4.SQLite database: It stores the relational database

11 What are the dialog boxes in Android ?

  1Alert Dialog Box

  2 Datepicker Dialog Box

3.TimePicker Dialog Box

4.Progress Dialog Box

12 What is the difference between implicit and explicit intent ?

Implicit Intent:

when requested tasks are performed by the system/Os then it is known as implicit intent.

Example:

suppose we want to open the “www.google.com” url

Intent intent=new Intent( );

intent.setAction(intent.ACTION_VIEW):

intent.setData(www.google.com);

startActivity(intent);

Explicit Intent:

when requested tasks are exactly known then it is known as explicit intent

Example:

suppose there are two activities (Activity1 and Activity2).
I want to go from Activity1 to Activity2

Intent intent=new Intent(Activity1.this,Activity2.class);
startActivity(intent);

13 which languages are used in the android development ?

Java is the primary language which is supported by Android Studio  to develop android applcation.

Kotlin is secondary language which supported by Android studio.It  it is little bit easier than the java,need to write less code etc.

C/C++ is also used to develope android app.It makes speed fast.

14 what is Toast in android ?

Android toast is a small pop-up which is used to show the message  for the short period of time.

//code for display the message for the short period of time

Toast.makeText(getApplicationContext,” toast message”,Toast.LENGHT_SHORT).show( ));

//code for display the message for the long period of time

Toast.makeText(getApplicationContext,” toast message”,Toast.LENGHT_LONG).show( ));

15 What are the essential folders/items required in android project ?

There are the various folders/items required

AndroidManifest.xml

build.xml

bin/

src/

res/

assets/

16 What is AndroidManifest.xml in android ?

It is the root directory of the application and contains the complete information about the application.

All the Activity(.java class) of the application must be decleared inside the AndroidManifest.xml before run the application

17 What is APPT in Android ?

APPT stands for(Android Assest Packaging Tool)

It provides the tool to the developers in which they can packaging all the resources of the application into the single unit such as AndroidManifest.xml and other XML files.

18 What is Layout ? List the various layout in Android

Layout means simply creating GUI(Graphical User Interface) for our application.

Layout contains different widgets such as button,textview,radiobutton etc

Various Layouts are listed below

1 Linear Layout

2 Relative Layout

3 Table Layout

4.GridView Layout

5 Cardview Layout

6 Recycleview Layout

7 Listview Layout

8 Frame Layout

19 What is fragment in android ?

Fragment is like a sub-activity/part of an activity/portion of an activity.

One fragment can display in multiple activities

Multiple fragment can display in one activity

20 What are the major component of android architecture ?

There are four major component of Android Architecture.

1.Linux Kernal

2.Libraries

3.Android Framework

4.Android Application

21 What is AIDL in android ?

AIDL stands for “Android Interface Definition Language”

It provides the medium to communicate between the client and server

It is an interface between the client and server to communicate each others.

22 What is “bundle” in android ?

Bundle is used to pass the data between the activities

We can pass any type of data(like Integer,String,Float etc)

Example:

Suppose we have two activities(FirstActivity.class and SecondActivity.class)

FirstActivity.class //Here i am passing “suman kumar” to the second Activity

Intent intent=new Intent(FirstActivity.this , SecondActivity.class);

Bundle bundle=new Bundle();

bundle.putString(“pass_name”,”suman kumar”);

intent.putExtras(bundle);

startActivity(intent);

SecondActivity.class// Here i am getting “suman kumar” from the first Activity

Bundle bundle=getIntent.getExtras( );

String name=bundle.getString(“pass_name);

Here we can get name “suman kumar”.

23 What are benifit of Android operating system ?

It is an open source (anyone can use it) and platform-Independent(support on window,Lunix or Mac) operating system.

It support different technologies like Wi-Fi,Bluetooth,Camera etc

24 How make HTTP request in android ?

HTTP stands for(Hyper Text Transfer Protocol)

1.By using Volley

2.By using Retrofit

3.By using AsyncTask

4,By using Jackson

25 Where the layouts are placed in android ?

Layouts are placed in XML files in Android

26.How we can get the layout “id” in android ?

We can get the layout id with the help of “findViewById”.

Example

//textview layout in xml files

<Textview
   android id:"id/textview1"
   android height="match_parent"
   android weight="match_parengt"/>

//Get id in java class

 Textview getid=(Textview)findViewById(R.id.textview1)

27 What is Orientation in Android ?

Orientation means how do you want to keep your smartphone screen(Horizontally or Vertically).

It support two type of screen roration

1.portait:When device is Vertically aligned

2.Landscape:When device is Horizontally aligned

28 What are the flags used to run the Android Application ?

There are two types of flags are used to run the android application

1.FLAG_ACTIVITY_NEW_TASK

2.FLAG_ACTIVITY_CLEAR_TOP

29 List the various exceptions in Android

Some exceptions are given below

1.InflateException

2.Surface.OutOfResourceException

3.WindowManager.BadTokenException

4.SurfaceHolder.BadSurfaceTypeException

30 What is DDMS ?

DDMS stands for (Delvik Debug Monitor Server).

It is a debugging tools which has different features

Port forwarding services

Capturing screen

Keep radio state information

Thead and Heap information