Top 50 Android Interview Questions You Must Prepare In 2024

Last updated on Nov 02,2023 82.8K Views
A technophile with a passion for unraveling the intricate tapestry of the... A technophile with a passion for unraveling the intricate tapestry of the tech world. I've spent over a decade exploring the fascinating world of...

Top 50 Android Interview Questions You Must Prepare In 2024

edureka.co

Android Interview Questions

While both iOS and Android skills are in high demand, employers are hiring Android developers much faster and more often than any other professionals in mobile tech. In the fourth quarter of last year, Android retained its position as the largest mobile operating system worldwide, controlling the mobile OS industry with a nearly 71 percent share, while iOS accounted for approximately 28 percent of the mobile operating system market. With these numbers only expected to rise in the coming years, Android App Development Certification has emerged as one of the hottest skills in the market today!

The demand for Android developers is on a meteoric rise and the time is right to break into a career in Android development. To help you get started, we have compiled a list of frequently asked Android interview questions to help you ace the Android interviews that come your way and to Develop the skills you need to create successful mobile apps in a Flutter Certification that covers all the fundamentals. In case you have attended Android interviews yourself or have any questions that you want us to answer for you, do feel free to add them as comments below.

Q1. What is the latest version of Android? List all the versions of Android.

The most recent version, Android 13, was published on August 15, 2022, while the recently released Android 12.1/12L offers advancements for foldable phones, tablets, desktop-sized screens, and Chromebooks. Android is a mobile operating system developed by Google. It is based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. Every other Android version has been named after either sweet or desserts. The following table represents the Android name, version and the year of release.

Android NameVersionYear of Release
Android 1.5Android Cupcake2009
1.6Donut2009
2.0-2.1Eclair2009
2.2 – 2.2.3Froyo2010
2.3 – 2.3.7Gingerbread2010
3.0 – 3.2.6Honeycomb2011
4.0 – 4.0.4Ice Cream Sandwich2011
4.1 – 4.3.1Jelly Bean2012
4.4 – 4.4.4KitKat2013
5.0 – 5.1.1Lollipop2014
6.0 – 6.0.1Marshmallow2015
7.0 – 7.1.2Nougat2016
8.0 – 8.1Oreo2017
9.0Pie2018

Q2. What is an Activity? Which method is implemented by all subclasses of an Activity? 

An Activity is the screen representation of an application in Android.

It serves as an entry point for the user’s interaction. Each activity has a layout file where you can place your UI. An application can have different activities. For example, facebook start page where you enter your email/phone and password to login acts as an activity.

Below are the two methods which almost all subclasses of Activity will implement:

An activity is implemented as a subclass of Activity class as follows:

public class MainActivity extends Activity {
}

Q3. What are the features of Android?

Google has changed the lives of everyone by launching a product that improves the mobile experience for everyone. Android helps in understanding your tastes and needs, by giving various features such as having wallpapers, themes, and launchers which completely change the look of your device’s interface.

Android has plenty of features. Some of the features are listed below:

Q4. Explain Android Architecture.

Android architecture refers to the different layers in the Android stack. It includes your operating system, middleware, and important applications. Each layer in the architecture provides different services to the layer just above it. The four layers in the Android stack are:

For more information about Android layers, Stack and their functions in the blog post – Android Tutorial.

Q5. Which programming language is used for Android App development?

Java is the official programming language for Android App development. It is also possible to develop in C/ c++ language using  NDK (Android Native Development). However, the major parts of Android are written in Java programming language and the APIs are also designed primarily from Java.

Q6. What is APK format?

The APK file or Android application package is the compressed file format that is used to distribute and install application software and middleware onto Google’s Android operating system. The file has .apk extension and has all the application code, resource files, certificates, and other files, compressed in it.

Q7. What is the life cycle of android activity?

User navigates between different screen or app, it goes through different states in their lifecycle. So an activity lifecycle consists of 7 different methods of android.app.Activity class i.e :

onCreate() : In this state, the activity is created.

onStart(): This callback method is called when the activity becomes visible to the user.

onResume(): The activity is in the foreground and the user can interact with it.

onPause(): Activity is partially obscured by another activity. Other activity that’s in the foreground is semi-transparent.

onStop(): The activity is completely hidden and not visible to the user.

onDestroy(): Activity is destroyed and removed from the memory.

Q8. Define intents in Android. What are the different types of intents?

An Intent is an “intention” to do an action.  An intent is a messaging object you can use to request an action from another app component.

Methods are used to deliver intents to different components:

Types of Intent:

Implicit Intent: Implicit intent is when the target component is not defined in the intent and the android system has to evaluate the registered components based on the intent data.

Explicit Intent: Explicit intent is when an application defines the target component directly in the intent.

Q9. What is the difference between an implicit intent and explicit intent?

Implicit Intent is used whenever you are performing an action. For example, send email, SMS, dial number or you can use a Uri to specify the data type. For example:


Intent i = new Intent(ACTION_VIEW,Uri.parse("http://www.edureka.co")); 
startActivity(i);

Explicit, on the other hand, helps you to switch from one activity to another activity(often known as the target activity). It is also used to pass data using putExtra method and retrieved by other activity by getIntent().getExtras() methods.

For example:

Intent i = new Intent(this, Activitytwo.class); #ActivityTwo is the target component
i.putExtra("Value1","This is ActivityTwo"); 
i.putExtra("Value2","This Value two for ActivityTwo"); 
startactivity(i);

Q10. What is an Android Framework?

Android Framework is an essential part of the Android Architecture. It is a set of APIs that allows developers to write apps and has the following components:

ServicesComponents that conduct long-running operations in the background, without the inclusion of a user interface.
IntentObjects that initiate actions from other app components, either within your program (explicit intents) or through another piece of software on the device (implicit intents).
ActivitiesComponents that provide users with screens on which they can interact with objects and perform actions. This is the base from which Intents can be deployed.
Content ProvidersComponents that enable users to access data within an app such as audio, video, images, contact information, etc.
OthersApp widgets and Processes and Threads

Q11. What is the difference between File, Class, and Activity in android?

The difference between them are as follows:

Q12. What is Google Android SDK? What are the tools placed in android SDK?

The Google Android SDK is a toolset that provides a developer the API libraries and tools required to build, test, and debug apps for Android in Windows, Mac or Linux. The tools placed in Android SDk are:

Q13. What is a Toast? Write its syntax.

Syntax:

Toast.makeText(ProjectActivity.this, "Your message here", Toast.LENGTH_LONG).show();

Q14. What is an Android Framework?

Android Framework is an essential part of the Android Architecture. It is a set of APIs that allows developers to write apps and has the following components:

Q15. What is an ANR? What are some measures you can take to avoid ANR?

ANR stands for ‘Application Not Responding’. This dialogue is displayed if the main thread in the application has been unresponsive for a long time and in the following conditions:

 Following measures can be taken to avoid ANR:

Q16. What is AAPT?

AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.

Q16. What are broadcast receivers? How is it implemented?

It is implemented as a subclass of BroadcastReceiver class and each message is broadcaster as an Intent object.

public class MyReceiver extends BroadcastReceiver {
Public void onReceive(context,intent){}
}

Q17. How will you pass data to sub-activities?

Bundle b=new Bundle();
b.putString("Email","abc@xyz.com");
i.putExtras(b); // where I is intent

Q18. What is the use of WebView in Android?

WebView is a view that display web pages inside your application. According to Android, “this class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more. In order to add WebView to your application, you have to add <WebView>element to your XML layout file.

Q19. What are the different kinds of context in Android?

Context defines the current state of an App. Context provides access to creating new activity instance, access databases, start a service, etc. There is a base class ApplicationContext, and subclasses for components: Activity, Service.

Q20. Explain in brief about the important file and folder when you create a new app?

Q21. What are the different storage methods in Android?

Android offers several options to see persistent application data. They are:

Q22. Can you deploy executable JARs on android? Which package is supported by it?

No, Android does not support JAR deployments. Applications are packed into Android Package(.apk) using Android Asset Packaging Tool (APT) and then deployed on to the Android platform.

Q23. What is a Service? How is it implemented?

A service in android is a background process which is used to perform long-running operations. Let’s say, a service of location is active in the background while the user is in a different application. So it does not disturb the user interaction with an activity. Now, services are classified into two types, namely:

  1. Local: This service is accessed from within the application.
  2. Remote – This service is accessed remotely from other applications running on the same device.

It is implemented as a subclass of Service class as follows :

public class MyService extends Service {
}

Q24. What is a Sticky Intent?

A Sticky Intent is a broadcast from sendStickyBroadcast() method which floats around even after the broadcast, allowing others to collect data from it.

Q25. Explain Folder, File & Description of Android Apps

Q26. How does Manifest file plays an integral role in App development?

Manifest file plays an integral role as it provides the essential information about your app to the Android system, which the system must have before it can run any of the app’s code. Manifest file performs various tasks such as:

Structure of a manifest file: The structure of a manifest file consists of various elements such as action, activity, activity-alias and many more. Refer to the below screenshot which shows the general structure of the manifest file.

&lt;?xml version="1.0" encoding="utf-8"?&gt;
cmanifest xmlns:android="&lt;a class="Xx" rel="nofollow noreferrer noopener" href="https://www.google.com/url?q=http://schemas.android.com/apk/res/android&amp;sa=D&amp;source=hangouts&amp;ust=1556291767429000&amp;usg=AFQjCNH7OW4Zi9NULaQDs71WDEo-67ZouA" target="_blank" tabindex="-1" data-display="http://schemas.android.com/apk/res/android" data-sanitized="https://www.google.com/url?q=http://schemas.android.com/apk/res/android&amp;sa=D&amp;source=hangouts&amp;ust=1556291767429000&amp;usg=AFQjCNH7OW4Zi9NULaQDs71WDEo-67ZouA"&gt;http://schemas.android.com/apk/res/android"
package="com.example.aayushi.myapplication"&gt;
&lt;application android:allowBackup-"true" android:icon="@mipmap/ic_launcher android:label="My Application android: roundIcon="@mipmap/ic launcher round" android:supportsRtl="true android:theme="style/AppTheme"&gt;
&lt;activity android:name=".MainActivity"&gt;
  &lt;intent-filter&gt;
    &lt;action android:name="android.intent.action.MAIN &gt;
    &lt;category android:name="android.intent.category. LAUNCHER" /&gt;
   &lt;/intent-filter&gt;
  &lt;/activity&gt;
 &lt;/applications
&lt;/manifest&gt;

Q27. What is the difference between a fragment and an activity?

Activity is typically a single, focused operation that a user can perform such as dial a number, take a picture, send an email, view a map etc.

Fragment is a modular section of an activity, with its own lifecycle and input events, and which can be added or removed at will. Also, a fragment’s lifecycle is directly affected by its host activity’s lifecycle i.e. when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all of its fragments.

Q28. Can you change the name of an application after its deployment?

It is not recommended to change the application after its deployment. This may break some functionality.

Q29. What database is used in Android? How does it differ from client-server database management systems?

SQLite is the open-source relational database. The SQLite engine is serverless, transactional, and self-contained. 
Instead of the typical client-server relationship of most database management systems, the SQLite engine is integrally linked with the application. The library can also be called dynamically and makes use of simple function calls that reduce latency in database access.

Q30. What is DDMS?

DDMS stands for Dalvik Debug Monitor Server. It gives the following array of debugging features:

Q31. What is the difference between Service and Thread?

ServiceThread
 Service is like an Activity but has no interface. A Thread is a concurrent unit of execution.
A Service is not a separate process. It works in background until the service or someone else explicitly stop it.By default, all components of the same application run in the same process and thread (called the “main” thread).
Service is not killed when an application is killed. Thread is killed when an Application is killed.
It expose some of its functionality to other applications by calling Context.bindService().GOOGLE has brought in Handlers and loopers into android threads.

Q32. What are the containers?

Containers, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.

Q33. What are some of the disadvantages of Android?

Android being an open-source platform, and considering that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. An app that runs on one version of Android OS may or may not run on another version.

Another disadvantage is that it can be challenging for developers to create apps that can adjust correctly to the right screen size and other varying features and specs of various Android devices.

Q34. What is an Android Runtime?

Q35. What is the importance of an emulator in Android?

Q36. Name the four essential states of an activity.

The four essential states of activity are:

Q37. What is the difference between a regular bitmap and a nine-patch image?

A nine-patch image, unlike bitmap, can be resized and used as background or other image sizes for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes. This is what differentiates a nine-patch image from a regular bitmap.

Q38. What are the core building blocks of android?

Q39. What are the dialog boxes that are supported in Android?

Android supports four dialog boxes:

Q40. What does APK stand for? 

APK stands for Android Packaging Kit. The Android packaging key is compressed with classes, UI’s, supportive assets and manifest. All these files are compressed to a single file which is called APK.

Q41. What is a sticky broadcast? Give an example.

sticky broadcast is used for communicating between applications. These broadcasts happen without the user being notified. The Android OS normally treats each application as if it were a separate user. Here’s an example: When you call registerReceiver() for that action — even with a null BroadcastReceiver — you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.

Q42. What is Dalvik Virtual Machine (DVM)?

Q43. What are the exceptions in android?

Q44. What is a content provider? How is it implemented?

It is implemented as a subclass of ContentProviderclass and must implement a standard set of APIs that enable other applications to perform transactions.

public class MyContentprovider extends ContentProvider {
 public void onCreate(){}
 }

Q45. What is the significance of the .dex files?

Q46. How are escape characters used as attribute?

Escape characters are preceded by double backslashes. For example – a newline character is created using ‘n’.

Q47. What does ADB stand for?

ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator instance. ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.

It is a client-server program that includes three components:
Client – which runs on your development machine. You can invoke a client from a shell by issuing an ADB command. Other Android tools such as DDMS also create ADB clients.
Server, which runs as a background process on your development machine. The server manages communication between the client and the ADB daemon running on an emulator or device.
Daemon, which runs as a background process on each emulator or device instance.

Q48. Can you list and explain the four Java classes related to using sensors on the Android platform?

Sensor Manager: This class provides methods regarding the registration of sensor event listeners, the management of data acquisition, and calibration. It also provides methods for accessing and listing sensors.

Sensor: This class creates an instance of a specific sensor, providing methods that allow you to determine its capabilities.

SensorEvent: This class provides information on a sensor event by creating a sensor event object.

SensorEventListener: This interface provides two callback methods that can receive notifications of sensor events.

Q49. What is Orientation in android? How is it done?

Orientation helps to represent the layout in a row or column. 

Syntax:

&lt;activity android name=".activity" android: screenOrientation="portrait"&gt;

Q50. What is AIDL? What are the datatypes supported by AIDL ?

AIDL stands for Android Interface Definition Language.
– It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication.
– The process involves breaking down objects into primitives that are Android understandable.

Data Types:

So this brings us to the end of the Android interview questions blog. The topics that you learnt in this Android Interview Questions article are the most sought-after skill sets that recruiters look for in an Android developer. These set of Android Interview Questions will definitely help you ace your job interview. Good luck with your interview!

In case you are facing any challenges with these Android interview questions, please comment your problems in the section below. Apart from this Android Interview Questions, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka

Got a question for us? Please mention it in the comments section of “Android Interview Questions” and we will get back to you.

 

BROWSE COURSES