Interviewer And Interviewee Guide

Behavioral Android Developer Interview Questions & Answers:

1. What is foreground Service?

A foreground service performs some operation that is noticeable to the user. For example, we can use a foreground service to play an audio track. A Notification must be displayed to the user.

2. What is bound Service?

A service is bound when an application component binds to it by calling bindService(). A bound service offers a client-server interface that allows components to interact with the service, send requests, receive results. A bound service runs only as long as another application component is bound to it.

3. Please explain what is a Pending Intent?

If you want someone to perform any Intent operation at future point of time on behalf of you, then we will use Pending Intent.

4. What is background Service?

A background service performs an operation that isn't directly noticed by the user. In Android API level 26 and above, there are restrictions to using background services and it is recommended to use WorkManager in these cases.

5. Explain what is application Context?

This context is tied to the lifecycle of an application. The application context can be used where you need a context whose lifecycle is separate from the current context or when you are passing a context beyond the scope of an activity.

6. Tell us what is DDMS? Describe some of its capabilities?

DDMS is the Dalvik Debug Monitor Server that ships with Android. It provides a wide array of debugging features including:

☛ port-forwarding services
☛ screen capture
☛ thread and heap information
☛ network traffic tracking
☛ incoming call and SMS spoofing
☛ simulating network state, speed, and latency
☛ location data spoofing

7. Explain me what is Armv7?

There are 3 CPU architectures in Android. ARMv7 is the most common as it is optimised for battery consumption. ARM64 is an evolved version of that that supports 64-bit processing for more powerful computing. ARMx86, is the least used for these three, since it is not battery friendly. It is more powerful than the other two.

8. What is difference between Activity & Service?

Activities are basically containers or windows to the user interface. Services is a component that is used to perform operations on the background. It does not have an UI.

9. Do you know what is ANR, and why does it happen?

‘ANR' in Android is ‘Application Not Responding.' It means when the user is interacting with the activity, and the activity is in the onResume() method, a dialog appears displaying “application not responding.”

It happens because we start a heavy and long running task like downloading data in the main UI thread. The solution of the problem is to start your heavy tasks in the backbround using Async Task class.

10. Do you know what are Handlers?

Handlers are objects for managing threads. It receives messages and writes code on how to handle the message. They run outside of the activity's lifecycle, so they need to be cleaned up properly or else you will have thread leaks.
Handlers allow communicating between the background thread and the main thread.
A Handler class is preferred when we need to perform a background task repeatedly after every x seconds/minutes.

Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.