Top 10 Android interview questions and answers

1.What is the difference between the service and intent service ?

Service:

A service is an application component that is used to perform  long-running operations in the background .It does not contain UI(user interface).

Example:

Playing music

Intent service

The service is the base class for the intent service.It handles asynchronous requests(expressed as intents) on demand.

So when client send requests through startService(Intent) calls then  service is started to handle each intent using worker thread and service will stopped.

2.What is the difference between the Volley and Retrofit ?

Volley

Volley is a networking library that provides the great features such as  synchronous request ,asynchronous requests,multiple requests at the same time ,prioritization and caching also.

Features of Volley

1.Caching mechanism

2.Retry mechanism

3.Automatic image loading from URL

4.No automatic JSON parsing

Retrofit

Retrofit is REST client library through which  we can make powerful android application with good UI(user interface)

Features of Retrofit

1.Automatic JSON parsing

2.No Retry policy

3.No caching mechanism

4.No automatic image loading from URL

3.List out the android architecture.

There are five android architecture components are give below

1.Linux kernel

2.Libraries

3.Android runtime

4.Application Framework

5.Applications

4.What are the differences between the MVP and MVVM in an android ?

MVP

MVP stands for Model View Presenter

Model describes the business logic

View represents the UI(User Interface)

Presenter acts as a bridge between the model and view

MVP has one to one mapping between the view and presenter.

MVVM

MVVM stands for Model View ViewModel

Model same as MVP Model

View also acts same as MVP View

MVVM has many views to view model

5.List out the life-cycle of activity in an android ?

onCreate( ) 

onStart( )

onResume( )

onPause( )

onStop( )

onDestroy( )

onRestart( )

6.What is the difference between sterilization and parcelable ?

Sterilization:

1.Sterilization is java standard interface which is used to convert objects into byte streams.

2.Sterilization is easier to implement as compared to parcelable.

3.It takes less time to implement as compared to Parcelable

Parcelable

1.Parcelable is an android specific interface which is also used to convert objects into byte streams.

2.Parcelable is faster than the Sterilization

3.Parcelable array values can pass through intent in an android.

7.What do you mean by pending intent ?

If you want to perform some operation in the future point of time then this type of intent is known as pending intent.

8.Describe the life-cycle of fragment  ?

onAttach(  )

onCreate( )

onCreateView ( )

onActivityCreated ( )

onResume( )

onpause( )

onStop( )

onDestroyView( )

onDestroy( )

onDetach( )

9.What do you mean by ANR ?

ANR stands for Application Not Responding.It is like a dialog box it appears when application is not responding for a long period of time .

10.What do you mean by LIveData ?

LiveData is an observable data holder class.It used to update app component observers that are in an active life cycle.

Thanks and Regards

Placement preparation



sumankumar80

Hello Friends,I have written and developed this website because you can learn technology easily ,prepare for the placement and also for the any type of examination . By :Suman Kumar

Leave a Reply

Your email address will not be published. Required fields are marked *