Android Developer Interview Preparation Guide
Download PDF

Android Developer related Frequently Asked Questions by expert members with professional career as Android Developer. These list of interview questions and answers will help you strengthen your technical skills, prepare for the new job interview and quickly revise your concepts

56 Android Developer Questions and Answers:

1 :: Explain me what is Context?

A Context is a handle to the system; it provides services like resolving resources, obtaining access to databases and preferences, and so on. An Android app has activities. Context is like a handle to the environment your application is currently running in.

2 :: Explain me what is the Android Application Architecture?

Android application architecture has the following components:
☛ Services − It will perform background functionalities
☛ Intent − It will perform the inter connection between activities and the data passing mechanism
☛ Resource Externalization − strings and graphics
☛ Notification − light, sound, icon, notification, dialog box and toast
☛ Content Providers − It will share the data between applications

3 :: Explain me scenario in which only onDestroy is called for an activity without onPause() and onStop()?

If finish() is called in the OnCreate method of an activity, the system will invoke onDestroy() method directly.

4 :: Explain me how does the activity respond when the user rotates the screen?

When the screen is rotated, the current instance of activity is destroyed a new instance of the Activity is created in the new orientation. The onRestart() method is invoked first when a screen is rotated. The other lifecycle methods get invoked in the similar flow as they were when the activity was first created.

5 :: What are content providers?

A ContentProvider provides data from one application to another, when requested. It manages access to a structured set of data. It provides mechanisms for defining data security. ContentProvider is the standard interface that connects data in one process with code running in another process.
When you want to access data in a ContentProvider, you must instead use the ContentResolver object in your application’s Context to communicate with the provider as a client. The provider object receives data requests from clients, performs the requested action, and returns the results.

6 :: Explain me difference between AsyncTasks & Threads?

☛ Thread should be used to separate long running operations from main thread so that performance is improved. But it can’t be cancelled elegantly and it can’t handle configuration changes of Android. You can’t update UI from Thread.
☛ AsyncTask can be used to handle work items shorter than 5ms in duration. With AsyncTask, you can update UI unlike java Thread. But many long running tasks will choke the performance.

7 :: Please explain what is a Job Scheduling?

Job Scheduling api, as the name suggests, allows to schedule jobs while letting the system optimize based on memory, power, and connectivity conditions. The JobScheduler supports batch scheduling of jobs. The Android system can combine jobs so that battery consumption is reduced. JobManager makes handling uploads easier as it handles automatically the unreliability of the network. It also survives application restarts. Some scenarios:
☛ Tasks that should be done once the device is connect to a power supply
☛ Tasks that require network access or a Wi-Fi connection.
☛ Task that are not critical or user facing
☛ Tasks that should be running on a regular basis as batch where the timing is not critical
☛ You can click on this link to learn more about Job Schedulers.

8 :: Explain me what is an intent?

Intents are messages that can be used to pass information to the various components of android. For instance, launch an activity, open a webview etc. Two types of intents-
☛ Implicit: Implicit intent is when you call system default intent like send email, send SMS, dial number.
☛ Explicit: Explicit intent is when you call an application activity from another activity of the same application.

9 :: What are fragments?

Fragment is a UI entity attached to Activity. Fragments can be reused by attaching in different activities. Activity can have multiple fragments attached to it. Fragment must be attached to an activity and its lifecycle will depend on its host activity.

10 :: Do you know what is Application?

The Application class in Android is the base class within an Android app that contains all other components such as activities and services. The Application class, or any subclass of the Application class, is instantiated before any other class when the process for your application/package is created.