Android Interview Questions For Fresher

Android is one of the most popular mobile platforms, an OS, ruling the process of running the devices successfully, out there. In the competitive world, the more you know about the technology, the more the chances of you getting recruited. As we know that Android increases the weightage to your resume, here we are presenting the compilation of 101 Important Android basic Interview Questions that help the freshers to ace the Interview. Ready?


Android is an ideal and complete set of software that consists of the OS, middleware, and the most important mobile applications one looks for. As Android OS is open-source and by its strong compatibility, the OS works on various hardware suppliers like Samsung, OnePlus, Google Pixel, HTC, Sony, etc. So, the customers have wider choices to pick out a product based on the manufacturer they like. The cherry on the top is – Android products are cheaper compared to Apple’s IOS.

So, we know that it is a bit tough to crack interviews, although you have a good knowledge of this particular skill. To boost up the confidence levels in you, we strongly suggest you go through our predicted and reliable compilation of Android Interview Questions which helps in polishing the basic knowledge much stronger.

Q1. What is Android?

Android is a package of software that mainly consists of an Operating System, along with the middleware and hundreds of needed applications. It is an open-source framework and relies upon Linux that helps in developing advanced and user-friendly applications. Android works on many hardware manufactured supplies such as OnePlus, Samsung, Sony, etc. This OS was developed by Google and supports various touch screen devices such as Tablets, Cell Phones, Televisions, etc.

Q2. Explain the android activity life cycle?

Have a look at the picture below, to understand the life cycle process easily.

Q3. Describe Android Architecture?

The Android Architecture consists of a stack of prominent elements that are helpful to run a device. It is organized in layers.

The architecture is comprised of five levels, namely :

Applications

Android Framework

Android Runtime

Platform Libraries

Linux Kernel

Q4. What is an Activity?

An activity is a screen with which the user interacts, precisely, a user interface such as a window or frame on which we can input data or we can get the output. The best examples are the pop-up windows, web pages, any interface with which you interact on the screen.

Q5. What is the APK format?

APK is an abbreviation for ‘Android Application Package’ which is a kit in the file format used on the Android Operating system and on other OS distribution systems that support it. This file formatted package consists of the software code and media needed and is mainly used to install various supported files which can be games, applications, etc.

Q6. What is the Intent in Android?

The intent is a messaging element that passes the information from one application to the other by raising the requests. It displays the notification or pop-up important messages to the user from within the Android enabled device on the interface/screen itself. It alerts the user about the happening of an event. If we think that all the components of an Android are isolated, the only way to arrange communication between them is through intents.

Q7. What are the types of Intent?

There are two types of Intents in Android, namely :

Implicit Intents: Application doesn’t define its specific target component in an Intent to be raised.

Explicit Intents: Application defines its target component in an Intent to be raised.

Q8. What is an Explicit Intent?

Explicit Intent is an Intent where the application defines its specific target when its Intent to be raised. Here, the developer has control over which class should be launched.

Intent i = new Intent(this, 3rdQuestion.class);

startActivity(i)

Here, from the current page, the 3rdQuestion (defined target component) is going to be opened once the intent object is passed through the startActivity().

Q9. What is an Implicit Intent?

Implicit Intent is an Intent where the application doesn’t define its target when its Intent to be raised. It is the work of the android operating system to filter out which component is going to give a response to the action.

Intent i = new Intent(this, Uri.parse(https://o7services.com/));

startActivity(i)

Here, from the current page, the https://o7services.com/ will be opened directly (as no inner component is specified) once the intent object is passed through the startActivity().

Q10. What is the action?

In Android, most of the functionalities are done with help on intended actions. An Action in Android technology is nothing but the thing the user wants to do with the applications in android or what he expects to get as a response when the intents are raised. Simply, the changes expected to be done on the screen of the interface when the intents are raised. The above are the commonly asked Android Interview Questions for Freshers and Experienced candidates in an Android Interview.

Q11. What is ADB?

ADB is an abbreviation that stands for ‘Android Debug Bridge’, which is a command-line tool that allows the developers the power to perform and execute the remote shell commands. This tool helps in communicating with and controls Android devices and computers or other supportive devices connect over a USB port. Simply, Allowing and controlling the communication exchange towards and from the emulator ports is its basic function.

Q12. What is ANR?

ANR is an abbreviation that stands for ‘Application Not Responding’. It is a dialog or message box that gives an alert message about the unresponsiveness of an application, whenever the application takes a long time to respond for intent or action.

Q13. When does ANR occur?

ANR is a dialog box that informs the user about the unresponsiveness of an application. There are two possible conditions where ANR dialog is expected to be displayed.

When the User Interface thread takes around 5 seconds or much more time to get executed. In such cases, the Graphical User Interface gets locked up, resulting in unresponsiveness.

When the crash occurs or when a Broadcast Receiver doesn’t finish the execution within 10 Sec.

Q14. How can the ANR be prevented?

It is better if we avoid including long-running tasks in the UI thread. In the case of ANR occurrence, or in the scope of UI to be unresponsive, it is better to create a child or worker class in which we can place database and network operations, etc. Other best things to follow are – to raise a progress dialog to the user if you are doing a background work; If it is a game, place calculations on child thread, etc.

Q15. What is AIDL?

AIDL is an abbreviation for ‘Android Interface Definition Language’. It helps in providing the same level of communication between the client and server through Interprocess Communication (IPC) by handling the interface requirements. As processes are independent and one process can’t access the part of other processes, AIDL helps in breaking down the process into the primitive processes or parts further making it easy for the Android OS to understand and compute it.

Q6. What data types are supported by AIDL?

AIDL supports the following data types:

string

charSequence

List

Map

and all the primitive data types of Java – int, long, char, and Boolean.

Q7. What is an Android Manifest file?

The file that represents Android Manifest is AndroidManifest.xml. It contains the package (package name matches your code’s namespace) of information about the application along with its components. It passes the information about the application to the Android tools, Google Play, and mainly, to the OS.

What is a Fragment?

A primitive part of an activity is known as a fragment. They are reusable and reliable. You can move the fragment around the activity and can combine it with other fragments that belong to the same activity.

Q8. What is a Visible activity?
Q1. A visible activity is nothing but an activity that is visible to the user. It sits behind a foreground dialog. It doesn’t need to be present on the foreground itself.
Q9. What is a Sticky Intent?

A Sticky Intent is an intent that is used with a sticky broadcast allowing the communication between function and service. Here, sendStickyBroadcast() performs a sendBroadcast(Intent). The sticky intent moves around even after the completion of the broadcast, allowing the users to retrieve the data from the return value registerReceiver(BroadcastReceiver, IntentFilter). These are the generally asked Android Interview Questions and Answers for the fresher candidate in the Interview.

Q10. What is a portable wi-fi hotspot?

Portable Wi-Fi Hotspot is a hotspot that allows one to share their device’s internet connection with other wireless devices. Portable means easy and handy, which says that it is a handy internet hotspot to share the internet with any suitable devices with the help of one device. For example, using an access point, you can share your Android’s internet with other phones, laptops, etc.

Q11. In an activity, what are the 4 essential states?

Talking of an activity, the 4 essential states of it are :

Active – Here, the activity is at the foreground

Paused – Here, the activity is in the background and is still visible.

Stopped – Here, the activity is not visible or stopped by another activity.

Destroyed – Here, either the activity is fully terminated or killed.

Q12. Enumerate three key loops when monitoring an activity?

.

Entire lifetime: Loop where the activity happens between onCreate() and onDestroy().

Visible lifetime: Loop where the activity happens between onStart() and onStop().

Foreground lifetime: Loop where the activity happens between onResume() and onPause().

Q13. How many dialog boxes can you use in your Android application?

Majorly, there are 4 types of dialog boxes we often use in our Android Applications. They are :

AlertDialog

ProgressDialog

DatePickerDialog

TimePickerDialog

Q14. What are the different storage methods in Android?

The main storage options for data persistence are:

Shared Preferences: It is all about storing the private fundamental data in key-value pairs. Can’t save the user-defined java types.

Internal Storage: Stores the private data on the device memory.

Q15. Android supports which language for the application development system?

The maximum parts of Android are developed in Java programming language, in such a way that its APIs too – are designed to be called with Java. It is java with which almost every application is being designed because of the feasibility it provides to quickly learn to create and deploy applications in the Android environment. C and C++ can also be used to create the android apps with their Android Native Development Kit. However, Google doesn’t promote C and C++ usage in creating apps.

Q16. Give a main difference between a regular bitmap image and a nine-patch image?

A bitmap is a raster graphic, a digital image that is composed of a continuous matrix of dots. When clear zoom in or 100% resolution, we can see that each dot corresponds to an individual pixel on a display, where each dot can be of a different color. Nine-patch image is a regular png with stretchable regions, where you can resize the image – 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and coming to the middle one, it can be scaled into both axes.

Q17. How to Translate in Android?

Using XMPP for the transmission of data, The Google translator translates the data of one language into the other, easily, in an Android. Else, you can just type a sentence in the left textbox by selecting the corresponding language, and then, can translate the text entered into another desirable language by choosing the language to be converted into, in the right box.

Q18. Do you think that all the mobile phones have the ability to support the latest Android operating system?

The answer is a ‘No’. As the new version comes on, most of the android phones lose their ability to support the new version much earlier due to the various changes to be made. Whenever Google releases a new Android version, then manufacturers have to adopt the version in and manufacture the phones in such a way that they possess the ability to support the features present in the new version.

Q19. What composes a typical Android application project?

The compilation of a file of a typical Android application project gives a .apk file. The .apk file is generally made up of AndroidManifest.xml file, application program/code, resource files, and other related files.

Q20. List out the core components you find under the Android application architecture?

5 major core components are present under the Android application architecture. They are :

Services

Intent

Resource externalization

Notifications

Content providers

Q21. In an Android device, how to remove an icon or a widget from the main screen?

To remove the icons and widgets from the main screen of the Android device is :

Press and hold that icon or widget.

Drag it downwards to the lower portion of the screen where a remove button appears, and drop that icon or widget on the remove button/ label until you see the icon/widget disappears.

The best time to kill a foreground activity will be when it is already consuming too much memory. When the application running in the foreground activity reaches the memory paging, it will be killed to retain the responsiveness of the User Interface to the user.

Q22. Without using a user interface, I want to use or add a fragment. Do you think it is possible?

Yes. Using the method add(Fragment, string), we can add a fragment from the activity without using a user interface as it is done when you want to create a behavior in the background for the certain and specific activity.

Q23. Which one among the deal of multiple resources, takes precedence?

When dealing with the multiple resources that are ideal with the device configuration, the ‘locale’ qualifier is the one that takes precedence over all almost every single time.

Q24. What is the importance of Default Resources?

Default resources contain the default string and files. In the absence of this resource, the errors keep on occurring repeatedly causing the failure of the application run. It helps the application to run healthy in the desired conditions while accessing the resources from the subdirectories under the project res/ directory.

Tell us the steps to create a bounded service through AIDL.

To define a programming interface, create a .aidl file.

To extend the inner abstract Stub class and implanting its methods, Implement the interface.

Expose the interface, to implement the service to the clients.

Q25. What do you think is the proper way to set up an Android-powered device for an application development?

The proper way of setting up an Android-powered device for app development is :

Declare the application as “debuggable” in Android Manifest.

Turn on the device’s “USB Debugging”

Set up the system to detect your device.

Q26. What is AndroidManifest.xml?

The AndroidManifest.xml is a package (package name matches your code’s namespace) of information about the application along with its components. It passes the information about the application to the Android tools, Google Play, and mainly, to the OS.

Q27. What role does Dalvik play in Android development?

Dalvik is a virtual machine that runs every Android application. It works almost like a Java Virtual Machine (JVM). Using Dalvik Virtual Machine, an android device can execute multiple virtual machines efficiently with better memory management. Android Training in jalandhar at O7 Solutions provides in-depth training of the Android concepts under the guidance of real-time professionals.

Q28. What is the bean class in android?

Bean Class is also known as JavaBeans, where beans indicate the components of the class. Javabeans is a model that is platform-independent, portable and is written in a java programming language. The deal with these classes is, they group many objects into a single one. It allows the user to access the properties using getter and setter class methods.

The synchronization taken and accessing the data of an application without internet connectivity is known as offline synchronization. Offline games are the best examples.

Q29. What is ANR responding time in android?

Generally, 5 seconds or more is considered as ANR’s responding time in Android. ANR is an abbreviation for ‘Application Not Responding’. When the User Interface thread takes around 5 seconds or much more time to get executed. In such cases, the Graphical User Interface gets locked up, resulting in unresponsiveness.

Q1. List out the states wherein a process is based?

The four different states wherein a process is based are :

Foreground activity

Visible activity

Background activity

Empty process

Q30. When is the onStop() method invoked?

The onStop() method is invoked (called) just before the activity needs to get destroyed. Or simple, when the User Interface is no longer visible to the user either because of the overriding by other applications or prioritized.

Q31. What does the onPause() method do?

The onPause() method is invoked when the User Interface is partially visible to the user. The instance is like when a dialog box pops up, the UI gets unresponsive and partially visible unless you make an action over the dialog. Here, the dialog activity calls the onPause() method.

Q32. Is the onDestroy() method always called?

No, It is not necessary. If it is called – only a specific part of the process, a particular activity will be destroyed. So, it is called before the activity is destroyed.

Q33. What are the containers?

A container can be called a package or a view that contains a certain number of other views. For example, if we take a header part of the android, If the total header is one view, it contains the set of other views such as Title, Menu bar, Logo, etc. So, These container classes are called layouts, and the subviews can be called children views.

Q34. What is the function of an intent filter?

The function of an Intent Filter is to filter out the intents that the components are willing to receive and respond to. Depending upon the activities and services that a component is going to perform, the number of intent filters used may vary, be they one or more.

Q35. In Android Application Development, Tell us about the importance of settings permissions?

The importance of settings permissions in app development is to restrict access primarily, to protect the data, code, and other important files. Without these, the manipulations can be done on the code, which may disturb and defect the functionality of an activity or an application.

Q35. How are escape characters used as an attribute?

Characters that are illegal to use in a string, are replaced by the escape characters. The escape characters are preceded with double backslashes as in \n is a newline character and \t is a tab space character.

Q36. What are the elements that can occur only once, but should be present?

and (manifest and application) are the elements that can occur only once and must be present in the manifest file.

In Android, the layouts are placed as XML files in the Layout folders.

Q37. What is the nine-patch images tool in android?

Nine-patch image tool is a tool used to resize the image, splitting the simple bitmap image into 9 portions/sections – 4 corners that are unscaled, 4 edges that are scaled in 1 axis, & coming to the middle one, it can be scaled into both the axis. Nine-patch image is a regular png with stretchable regions.

Q38. Explain the dialog boxes supported by android?

AlertDialog: It shows a title, some list of selected items, or a customized layout, with a maximum of 3 buttons.

ProgressDialog: It is the extension of AlertDialog, and shows us the progress bar.

DatePickerDialog: It comes with a predefined UI allowing the user to select a date.

TimePickerDialog: It comes with a predefined UI allowing the user to select the time.

Q39. What are the exceptions available in android?

The exceptions available in android are :

InflateException,

Surface.OutOfResourceException,

SurfaceHolder.BadSurfaceTypeException,

WindowManager.BadTokenException

Q40. What is the order of dialog-box in android?

The order of dialog-box in android is :

Positive > Neutral > Negative

Q41. How is the use of a web view in Android?

Using the Webkit engine, Web view is used to display a web page that can be loaded either directly from the application or through URL as a part of the Android application’s activity layout. However, the absence of navigation control and address bar can be seen.

Q42. What is a drawable folder in android?

In Android, A Graphical/Compiled visual resource which can be used as a background, banners, icons, splash screen, etc. is known as a Drawable folder. Based on the resolution of graphical images, the drawable folder is divided into 3 types. HDPI image folder (maintains images of Higher resolution), LDPI (for Lower resolution images), MDPI (for medium resolution images).

Q43. Tell us the method you use to find any view element in your program?

By using findViewById(), we can find any view element in a program. It returns an instance of view based on the intent or activity targeted. These are the commonly asked Android Interview Questions for freshers & experienced candidates in an interview.

Q44. What are application Widgets in android?

App Widgets are small application icon views that can be embedded in other applications and receive notification of the status, periodically. Like weather reports, or gaming icons present in Home Screen.

Q45. Which kernel is used in android?

The kernel used in an Android device is the customized Linux 3.6 Kernel. It is the heart of the Android OS as it is what controls every software and hardware functions in it.

Q46. What is sleep mode in Android?

Sleep mode is nothing but the mode in which the CPU will be sleeping. As the CPU becomes idle in this mode, it doesn’t accept any commands from an android device except the alarm & Radio interface layer.

Q47. What is the singleton class in Android?

In Android, a singleton class is a class that can have only one object for itself and ensures that it’s the only object which is present in the Java Virtual Machine representing that class. However, the object can be shareable to all other classes. The real-time example for it is – The President’s office in India is Singleton.

Q48. How to launch an activity in android?

In Android, we can launch an activity using an Intent.

Example 1 (Explicit):

Intent i = new Intent(this, 3rdQuestion.class);

startActivity(i)

Example 2 (Implicit):

Intent j = new Intent(this, Uri.parse(https://o7services.com/));

startActivity(j)

Q49. How to stop the services in android?

A user can stop the services by using the methods stopSelf() and stopService().

Q50. What is the stopSelf() method?

The stopSelf() method is used to stop the current service running in the system. This method is intended to get called from inside the service only. If you pass the id through it, the id must be the latest service started. However, if the service receives the new request before you call the stopSelf() method, the service won’t stop, rather runs the new request ignoring the stopSelf() method.

Q51. What is the stopService() method?

The stopService() method or stopService(Intent service) is used to stop the services when the method should get called from outside the service.

Q52. What is the time limit of the broadcast receiver in android?

The time limit of the broadcast receiver in android is 10 seconds. If the crash happens or when a Broadcast Receiver doesn’t finish the execution within 10 Sec, ANR occurs.

Q53. The method used for broadcast receivers in the Android life cycle is?

The method used for broadcast receivers in the Android life cycle is onReceive() method. The above are the frequently asked Android Interview Questions & Answers for the Freshers and Experienced candidate in an interview.

Q54. What is the use of a content provider in android?

In Android, the use of a content provider is to share the data between applications using intents.

Q55. What are the wake locks available in android?

FULL_WAKE_LOCK are the wake locks available in android. Wake locks are nothing but the indications to your device to keep it on working, precisely, making sure that the device doesn’t doze off.

Q56. How does the application class act in android?

Application class works as the base class for all other classes and its components like services and activities. This is a pre-defined class. So, there is no need to import or extend this class.

Q57. List out the features that are considered while creating an android app?

The features that are considered while creating android apps are Screen Size, Input configuration, Platform Version, Device features, etc.

Q58. What is JNI in android?

In Android, JNI is an abbreviation for ‘Java Native Interface’, which is a part of Java’s SDK and helps in defining a way for the bytecode of the Android compiles from managed code (written in the Java or Kotlin) to interact with native code (written in C or C++).

Q59. How many orientations does android support?

The android is currently supporting majorly four types of orientations, namely :

Portrait

Landscape

Sensor

Unspecified

Q60. Is class immutable in android?

Yes, a class can be an Immutable one. The class must be declared as a final class to turn it into an immutable one.

Q61. What are the types of notifications in android?

There are 3 types of notifications present in Android, majorly. They are :

Toast notification,

Status bar notification,

Dialog notification.

Q62. What is the sandbox in android?

In Android, Sandbox is a kernel-level application that isolates the app data and code execution from each other. So, it protects the apps and their resources from other malicious apps.

Q63. What are the levels of securities present in android?

App Level Security And Kernel Level Security are the levels of securities that are present in android.

Q64. How many protection levels are present in the android permission tag?

There are three protection levels present in the android permission tag. They are :

Normal Protection Level,

Signature Protection Level,

Dangerous Protection Level.

Q65. We keep on calling the methods onCreate() and onStart() in android. Is that mandatory?

No, It is not mandatory. We can write the program without using onCreate() and onStart() in android. It works fine. However, to complete the life cycle of an Android Architecture, we mention them.

Q66. What are return types of startActivityForResult() in android?

There are two return types for startActivityForResult() in android. They are :

RESULT_CANCEL

RESULT_CRASH

Q67. What is transient data in android?

The transient data in android is nothing but logical data. Transient data is created within an application. In the end, the data is either discarded or reset back to its default state.

Q68. What are the commands needed to create an APK in android?

In android, The commands that are needed to create an APK file are:

Javac

Dx tool

Aapt tool

Jarsigner tool

Zipalign

Q69. Tell us the main difference you find between set and list in android?

Set won’t accept the duplicate elements, where the list can contain the duplicate elements and is mutable.

Q70. What is an interface in android?

In Android, Interface is nothing but the bridge or a medium of communication between the classes/intents/activities of the Android with the outer world (users).

Q71. What is the anchor view?

Anchor view is the view that provides the information on respective relative positions. It is represented by instances of the LMAnchorView.

Q72. What is a fragment life cycle in android?

In android, the flow of fragment life cycle is as follows:

onAttach() -> onCreate() -> onCreateView() -> onActivityCreated() -> onStart() -> onResume().

Q73. What is a thread in android?

The thread is a small, independent dispatchable and concurrent unit that works on independent execution in a program. Every application has several threads within, that executes the activities concurrently. When the execution is started, each virtual machine instance has at least one main Thread running. Android Training in jalandhar at O7 Solutions provides a holistic training of the Android App Development concepts and its application under the guidance of real – time professionals.

Q74. What is AAPT?

AAPT means Android Asset Packaging Tool. This tool helps developers to deal with zipping compatible archives, creating, extracting and for viewing its contents.

Q75. Explain Sensors in Android?

The sensors are built-in devices in an android device. The data of the motion, orientation, environment around us, etc. is provided based on the working of hardware sensors and software sensors. They provide the data with high accuracy.

Q76. How many sensors does an Android phone have?

Today, the android mobile devices are packed with nearly 14 sensors. The data of the motion, orientation, environment around us, etc. is provided based on the working of hardware sensors and software sensors. All thanks to the micro-electromechanical systems.

Q77. What is the SDK?

The abbreviation SDK stands for ‘Software Development Kit’. It enables the developers to create applications for the Android platform. The Android SDK contains sample projects with source programs, some development tools, libraries to build Android applications, etc. The best examples are Windows 7 SDK, the Mac OS X SDK, etc.

Q78. How many pre-defined thread classes are available?

The predefined thread classes are four in number. They are :

AsyncTask (For start and stop of UI threads)

HandlerThread (for callbacks)

ThreadPoolExecutor (for parallel work)

IntentService (for getting intents off the UI thread)

Q79. What are the priorities of running a thread?

Generally, In threads, there are three priorities. The priority numbers are integers ranging from 1 to 10. They are :

MAX_PRIORITY

MIN_PRIORITY

NORM_PRIORITY

Explain the thread priorities.

MAX_PRIORITY: The maximum priority that a thread can possess. The constant value of it is 10.

MIN_PRIORITY: The minimum priority that a thread can possess. The constant value of it is 1.

NORM_PRIORITY: The default priority that a thread possesses. The default value of this type of priority is 5.

Q80. List the exceptions of Android?

The Exceptions supported by the Android are :

InflateException

Surface.OutOfResourceException

SurfaceHolder.BadSurfaceTypeException

WindowManager.BadTokenException

SurfaceTypeException

Q81. What is logcat?

It is a command-line tool that is well known for logging utility. It allows access to the messages from applications to services running on an Android device.

Q82. List a few versions of android which have been released till now?

The following are the names of the android with their versions:

Android 1.5: Android Cupcake

Android 1.6: Android Donut

Android 2.0: Android Eclair

Android 2.2: Android Froyo

Android 2.3: Android Gingerbread

Android 3.0: Android Honeycomb

Android 4.0: Android Ice Cream Sandwich

Android 4.1 to 4.3.1: Android Jelly Bean

Android 4.4 to 4.4.4: Android KitKat

Android 5.0 to 5.1.1: Android Lollipop

Android 6.0 to 6.0.1: Android Marshmallow

Android 7.0 to 7.1: Android Nougat

Android 8.0 to Android 8.1: Android Oreo

Android 9.0: Android Pie

Android 10.0: Google is under talks of selecting a dessert name for this version. For now, it is being called as ‘Android 10’.

Q83. What is the major difference between an Activity and a Service?

Activities running and closing/ termination are completely based on the user’s choice while services are mostly about the background work, designed to run behind the scenes. So, the services mostly work independently, where activities don’t.

We have covered almost every topic in Android with the motto of preparing you to face the Interview Questions on ‘Android’ topic, strongly. However, these 101 questions are most popular and are predicted to be asked in the interview, by our team. We hope these lists of Interview Questions will help you. Hope you will ace the questions asked on ‘Android’ with your answers. Good luck!