Android Interview Questions
- Nikita Singh
- 02nd Jan, 2023
- 658 Followers
Android Interview Questions
In the year 2008, Android came as a popular computing platform, which is based on the Linux operating system. In the smartphone market, it became one of the most leading names that managed to change the whole. In the last ten years time, it grabs the majority of market share sharing with iOS and has effectively become the world's most popular operating system. With the maturity of Android, it is finding its new way into a variety of devices, not just on smartphones but also including televisions, projectors, automobiles, and even now vehicles.
Today with the advent of the Android platform, Android developers are huge in demand and every sector and industry is looking to recruit them in-house. If you aspire to be an Android developer, then this is just the place for you. Given below is the list of questions, which answers both basic and advanced concepts of Android. These questions if well prepared before an interview shall give an extra edge to the candidate and give confidence of facing the panel:
Practice here the top 90+ Android Interview Questions for Senior Developer
Practice top Android Interview Questions for Senior Developers. These Android Interview Questions are really very popular and asked various times in Android Interviews. So, practice these questions for the best preparation of Android Interviews. apart from this, you can also, download below the Android Interview Questions for Senior Developer PDF completely free.
Android Interview Questions
1) Enlist major components of Android App?
The major components of the Android App are listed below:
- Content Providers
- Broadcast Receivers
- App APK files
- Layout XML Files
2) What is a frament in Android?
The fragment in Android is as follows.
- A fragment has its own layout and behavior with its own life cycle callbacks.
- Fragments can be added or removed in an activity while the activity is running and used in multiple activities.
- Multiple fragments can be combined in a single activity to build a multi-pane UI.
- The fragment life cycle is closely related to the life cycle of its host activity which means when the activity is paused, all the fragments available in the activity will also be stopped
- Fragments were added to the Android API in the Honeycomb version of Android API version 11.
3) List some storage options available in Android?
Some storage options available in Android are listed below:
- Shared Preferences
- Internal Storage
- External Storage
- SQLite database
4) What is APK format?
The full form of the APK is Android Package Kit which is the file format for applications used on the Android operating system;
APK files are compiled with Android Studio, which is the official integrated development environment (IDE) for building Android software. An APK file includes all of the software program’s code and assets.
5) What is ANR in Android?
ANR is an abbreviation for Application not responding that describes an unresponsive Android app. an "ANR" event is triggered, When an app is running on an Android device and stops responding.
6) What is DVM?
The DVM is an abbreviation for Dalvik Virtual Machine which is used to run Android applications. The DVM executes Dalvik bytecode.
7) What is a BuildType in Gradle?
Build Type is a build and packaging settings like signing configuration for a project. For instance, debug and release build types. The debug build type will use an android debug certificate for packaging the APK file. While the release build type will use a user-defined release certificate for signing and packaging the APK.
8) What is Armv7?
ARMv7 is a RISC(reduced instruction set computer) processor, with a Load/Store memory model. A Load/Store memory mode means memory access is restricted to specific instructions. An ARMV7 processor is a family of CPUs based on the RISC architecture developed by Advanced RISC Machines (ARM).
9) What is an activity in Android?
An Android activity is a screen of the Android app's user interface. It is similar to windows in a desktop application. An Android app may contain one or more activities that mean one or more screens
10) What is an intent in Android?
Android uses Intent for the communication between the components of an Application. The intent is the object which is used in android for passing the information among Activities in an Application. It also provides connectivity between two apps.
11) What is NDK?
NDK stands for The Native Development Kit which is a set of tools. It allows you to use C and C++ code with Android. It also provides platform libraries that you can use to manage native activities and access physical device components, such as sensors and touch input.
12) What is an "Emulator" in Android?
The Android Emulator imitates Android devices on your system. Therefore, users will be able to check your application on a spread of devices and Android API levels without having to possess every physical device. The emulator provides the majority of the capabilities of a real Android device
13) Please explain the lifecycle of an Activity?
Android is an open-source operating system that can be useful for many tasks. An android application will undergo various states that are associatively called as Android Activity Life Cycle.
The lifecycle of activity consists of 7 methods:-
- onCreate() - The function onCreate() is called When a user first opens an activity that acts the same as a constructor of a class.
- onStart() - The function onStart() is called when an activity becomes visible to the user and is called after onCreate.
- onResume() - The function onResume() is called just before the user starts interacting with the application.
- onPause() - The function onPause() is called when the app is partially visible to the user on the mobile screen.
- onStop() - The function onStop() is called when the activity is no longer on the activity stack and not visible to the user.
- onRestart() - The function onRestart() is called when the activity in the stopped state is about to start again.
- onDestroy() - The function onDestroy() is called when the activity is cleared from the application stack.
14) What's the difference between onCreate() and onStart()?
The major difference between onCreate() and onStart() is as follows.
onCreate() is called when the Activity is created; that is, it is launched or started. (Additionally, this triggers when the orientation is changed.) It is called again when the process is killed, then returned to.
while onStart() called following onCreate() at startup. Additionally, it is also called when the app is navigated back to after onStop() (and following onRestart()), which occurs after the Activity is no longer visible (which is during the time that "the user can see the activity on-screen, though it may not be in the foreground and interacting with the user").
15) What is use of FLAG_ACTIVITY_CLEAR_TASK?
In Android, FLAG_ACTIVITY_CLEAR_TASK is used to end any previously existing task that helps to start new Activity in conjunction with FLAG_ACTIVITY_NEW_TASK.
16) What is service in Android? List its types?
Services in Android are a component that acts as an application to run in the background in order to perform long-running operation tasks.
The types of Services are listed below:
- Background Services
- Foreground Services
- Bound Services
17) Explian the use of AsyncTasks?
Android AsyncTask going to do background operation on the background thread and update on the main thread. In android, We can't directly touch the background thread to the main thread in android development. asyncTask helps us to make communication between the background thread to the main thread.
18) What is IntentService?
IntentService is a direct subclass for Services that handle asynchronous requests on demand. Clients send requests through Context. It is born to make things easier. It is also used to perform a certain task in the background. The instance of IntentService terminates itself automatically when needed.
19) What are Handlers in Android?
A Handler is used to send and process Message and Runnable objects associated with a thread's MessageQueue. When a Handler created default bound with a Looper class. It will deliver messages and runnable to that Looper's message queue and execute them on Looper's thread.
Handlers are mainly used to Update the User Interface from a background thread, Enqueue a task for a different thread and Schedule a task for a specified time.
20) What is use of onTrimMemory() method?
The onTrimMemory(int level) is used when the operating system has determined that a process to trim unneeded memory from its subprocess.
21) How do you disable onBackPressed()?
You can disable onBackPressed() by overriding it.
22) List some layouts available in android?
Some layouts available in Android are as follows:
- Linear Layout
- Relative Layout
- Constraint Layout
- Table Layout
- Frame Layout
- List View
- Grid View
- Absolute Layout
23) What are some measures you can take to avoid ANR?
You can avoid ANR to perform long-running operations on the worker thread, not on the main thread. To create a worker thread, we can use AsyncTask class for long-running operations like File uploading, File downloading, etc
24) What Is the Google Android SDK?
The Android software development kit (SDK) consists of a comprehensive set of development tools that includes a debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials.
25) What is a PendingIntent?
A Pending Intent is an action to require in the future. It allows you to pass a future Intent to a different application and permit that application to execute the Intent.
26) What is use of AndroidManifest.xml file?
AndroidManifest.xml file is responsible to protect the application from accessing any protected parts by providing the permissions. Every app project has an AndroidManifest.xml file which is also the root of the project source set. This file contains information about your package, Android operating system, the Android build tools, Google Play, and other including components of the application such as activities, content providers, services, broadcast receivers, etc.
27) What is a Sticky Intent?
The Intent is used with sticky broadcast, which is called sticky intent. This intent will stick with the android system for future broadcast receiver requests.
28) What are retained fragments?
A Fragment represents a reusable portion of your app's User Interface. Retained Fragment consists of the configuration change that causes the underlying Activity to be destroyed. The term "retained" refers to the fragment that will not be destroyed on configuration changes.
29) What are Sensors in Android?
The Android platform provides several sensors that are used to monitor the motion of a device. The sensors' possible architectures vary with sensor types such as the gravity, linear acceleration, rotation vector, significant motion, step counter, and step detector sensors that are either hardware-based or software-based.
30) Explain different launch modes in Android?
Different launch modes are explained below:
- Android Launch mode 'Standard' — Multiple instances every time, A very default launch mode!
- Launch mode 'SingleTop' — Multiple instances Conditionally
- Specialized Launch mode 'SingleTask' — Single instance throughout System.
- Specialized Launch mode 'SingleInstance' — Single instance throughout System.
31) What are the intent filters?
In an application, An Intent is a messaging object that can be used to request an action from another app component. It specifies the type of intents that the component would like to receive. For instance, you make it possible for other apps to directly start your activity with a certain kind of intent by declaring an intent filter for an activity.
32) What is SQLite?
SQLite is an embedded SQL database engine with multiple tables, indices, triggers, and views, contained in a single disk file. SQLite modifies data directly to ordinary disk files.
33) What is AppCompatActivity?
AppCompatActivity is the base class for activities with the support library action bar features. ActionBar can be added to your activity by extending this class for your activity and setting the activity theme to Theme when running on API level 7 or higher.
34) What is Proguard?
Proguard detects and removes unused classes, fields, methods, and attributes. Mobile app development companies use the Proguard in android, it optimizes bytecode and removes unused instructions. It renames the remaining classes, fields, and methods by using short meaningless names.
35) What is taskAffinity?
An android application includes Activities that form a stack like a deck of cards. When you start an android application and start five activities A, B, C, D, E. Then they will form a stack such as:
E for chat view
D for weather screen
C for map view
B for weather screen
A for the login screen
36) What is Toast in Android?
Android Toast displays information for a short period of time that contains a message to be displayed quickly and disappears after some time. It also used to show notifications for a particular interval of time at the bottom of the screen by default.
37) How is data stored in Shared Preferences?
Shared Preferences persist data across user sessions that should be remembered across sessions, such as user’s preferred settings or their game score, even if the app is killed and restarted, or the device is rebooted.
38) What is a StateListDrawable?
StateListDrawable is a java class of Android, that is used for drawable contents in an application.
39) What is drawer layout in android?
The drawer Layout is the root layout. It defines a FrameLayout and a Navigation View. In Navigation View we set the items from the menu file and FrameLayout is used to replace the Fragments on the click of menu items.
40) What is Android Jetpack?
Android Jetpack is a set of Android components, tools, and guidance inspired by the backward compatibility of the Support Library and Android Architecture Components that are platform-independent, allowing your app to run on multiple Android platforms.
41) How to start/stop a service in Android?
You can Start android background service as follows:
Intent intent = new Intent(Activity.this, MyBackgroundService.class); startService(intent); You can Stop android background service as follows: Intent intent = new Intent(Activity.this, MyBackgroundService.class); stopService(intent);
42) What is Android Bound Service?
The bound service is a server in a client-server interface that allows components such as activities to bind to the service, send requests, receive responses, and perform interprocess communication (IPC).
43) What is DialogFragment?
A DialogFragment is a fragment that floats on top of the current activity window and displays a modal window. An instance of DialogFragment can be used to display an existing Dialog implementation dialog or a custom view hierarchy by using the Dialog class that is the base class for implementing a dialog.
44) What is presenter?
The Presenter acts as a mediator between model and view. All your presentation logic belongs to the presenter which is responsible for querying the model and updating the view, reacting to user interactions, and updating the model.
45) What is Bitmap pooling in android?
You can avoid continuous allocation and deallocation of memory in your application by using the Bitmap pool, you can reduce GC overhead, which results in a smooth-running application.
46) What is Android RecyclerView?
Android Recycler View is a version of ListView. It has improved performance and other benefits. You can use RecyclerView and CardView together, which creates both lists and grids very easily.
47) What is a ViewHolder Pattern?
A view holder design pattern is used to speed up the rendering of your ListView to make it work smoothly, findViewById is quite expensive when used each time a list item is rendered, it must traverse your layout hierarchy.
48) What is rooting in Android?
Rooting is the process of attaining users privileged control known as root access over various Android subsystems to allowing Android mobile operating systems to run on smartphones, tablets, and other devices.
49) What is WebView in Android?
Android WebView is a system component that allows Android apps to display web content. It is pre-installed on your device and should be kept up to date to ensure you have the latest security updates and other bug fixes.
50) What is a SurfaceView?
A SurfaceView is a view in a view hierarchy that has its own separate Surface. It also provides a dedicated drawing surface embedded inside of a view hierarchy.
51) What is a Spannable in Android?
Scannable is a Spanned, adding in the ability to modify the spans to add or remove formatting, but not to modify the text itself.
52) What is DEX?
Samsung DeX is a feature that is included on some high-end Samsung handheld devices. It enables users to extend their device into a desktop-like experience by connecting a keyboard, mouse, and monitor. Samsung DeX is also a platform that turns your smartphone into a desktop computing experience.
53) What is Espresso?
The Espresso is a testing framework for Android. It is an easier way to write reliable user interface tests. It automatically synchronizes your test actions with the UI of your application. It also ensures that your activity is started before the tests run.
54) What is Android?
Android is an open-sourced operating system by Linux that is primarily used in mobile devices like cell phones and tablets. This Linux kernel based system is equipped with high and advanced components that allow developers to create and run apps. Therefore performs the basic as well as the advanced functions.
55) What are the Android application components?
Android application components are the building block essentially used in the Android application. The application manifest file named Android manifest.xml couples the components. This describes each component of the application and describes how they interact, and then the processing activity takes place.
There are four main components, which are:
- Activities: They show the UI and handle the interaction of the users in smartphone screen.
- Services: They take care of the processing associated with the application.
- Broadcast Receivers: They handle the communication process between Android OS and application.
- Content Providers: They handle issues with data and database management.
56) What does Fragment mean?
A fragment means behavior or the portion of user interface in a Fragment Activity. One can combine multiple fragments in a single activity to build a UI and can reuse the fragment in multiple activities. The fragment can be considered as a modular section of an activity. This has its life cycle, gets its input events, which can be added or removed accordingly. It is must host a fragment in an activity and fragments lifecycle is directly related by the host activity’s lifecycle.
57) What options do the users get to save data in Android?
Android provides some options to save or store the app data. Here the choice depends on the specific needs and requirement of space by the users.
Few of the data storage options available on Android are as follows:
- Internal file storage: stores the private file on the device file system.
- External file storage: stores the file on the shared external file system.
- Shared preferences: stores the private primitive data in key-value pairs.
- Databases: stores the structured data in a private database.
To expose one app’s data to other apps, the content provider can be used.
58) What is AIDL?
AIDL is Android Interface Definition Language. This IDL allows the user to define the programming interface; both the clients and service agree upon to communicate with each other using inter-process communication (IPC). On Android platform, it becomes difficult for one processor to access the memory of another process. They need to decompose their objects into primitive that the operating system can manage, and marshal the objects across. The code to perform that marshaling is tedious to write therefore Android handles this for the users with the help of AIDL
59) What are services in Android and what is its type?
Services here is an application component that can perform long-duration operations in the background. It doesn’t provide a user interface. Other application components can start a service and can continue to perform/ run in the background when the users switch to some other application. There are three different types of services:
- Foreground: The activity of performing the operation in foreground service is noticeable to the users. A notification is displayed for the same.
- Background: Generally, a background service performs its operations, which is directed not noticed by the users on their screen. Example if an app uses service to compact its storage this will be considered as background service.
- Bound: A service is bound when an application component binds to it by calling it as bind service. A bound service runs only as long as another application component is bound to it.
60) What is the use of Android manifest.xml?
Every application should have an Androidmanifest.xml file at the root of the project source set. This file describes the essential information required by the user for the app to the Android build tools. Apart from this, it is required for the following reasons:
- To give permission that the application requires to ensure the access is protected.
- To provide with the hardware and software features, which the app requires when installing from Google play etc.
61) What are launch modes?
It is an instruction for Android OS that specifies how the activity should be launched or performed. The activities are performed into two areas, which are:
- Tasks: It’s a collection of activities, with which the users interact when they perform certain jobs. An application contains a number of activities.
- Back Stack: Back stack in a back stack the activities are arranged with the order in which each is opened. This maintained stack called back stack.
62) Explain sticky intent?
Sticky intent sticks with the Android for future broadcast listeners. For instance, if Battery low event occurs then that intent will be stick with Android, so that if any future user requested for Battery – Low, it will be fired.
63) What is the difference between Serializable and parseable?
Serializable is a standard Java interface. It is not a part of the Android SDK. Its simplicity is its biggest beauty. Just by implementing this interface the POJO will be ready to jump from one particular activity to another. There is another interface known as parseable. It is a part of the Android SDK. Paracelable was specifically designed in a way that there is no reflection left while using.
64) Give a brief idea about Android application architecture?
The architecture of Android application has few components, which have their functions to perform:
- Service: It performs the background functions
- Intent: Performs the interconnection function between activities and data passing mechanism
- Resource: Externalization it is used to perform strings and graphics functions
- Notification: This shows the lights, sound, icon, notification, incoming chats messages dialogue box, etc.
- Content providers: It shares the data between applications.
65) State the code names of Android along with the year when they were brought in?
Following are the code names with year:
- Cupcake (April 2009)
- Doughnut (September 2009)
- Eclair (October 2009)
- Froyo (may 2010)
- Gingerbread (December 2010)
- Honeycomb (February 2011)
- Ice Cream Sandwich (October 2011)
- Jellybean (July 2012)
- Kitkat (October 2013)
- Lollipop (November 2014)
- Marshmallow (since October 2015)
66) State the advantages of Android?
Advantages of Android are as follows:
- It is an Open source that requires no licensing
- It is Platform independent that supports Windows, Mac, and Linux platforms.
- Supports different technologies like camera, Bluetooth, wifi, speech, EDGE, etc.
- It is a highly optimized virtual machine.
67) What are the other languages that Android supports other than JAVA?
Android supports C++, C. The app can be developed in C or C++ using Android NDK (Native development kit). This makes system works faster.
68) State the life cycle methods of Android activities?
There are seven lifecycle methods of Android activities. They are:
- On create()
- On start()
- On resume()
- On pause()
- On stop()
- On restart()
- On destroy()
69) What is DDMS?
DDMS is Dalvik Debug Monitor Server.This gives a wide array of debugging features of which are
- Port forwarding services
- Screen capture
- Thread and heap information
- Network traffic tracking
- Location data
70) what dialogue boxes are supported by the Android box?
Dialogue box supported by Android are:
- Alert dialogue
- Process dialogue
- Data picker dialogue
- Time picker dialogue
71) What are few exceptions in Android?
These are the following exceptions in Android:
- Inflate exception
- Surface.out of resource exception
- Surface holder bad surface type exception
- Window manager took exception.
72) What are the tools used to develop an Android app?
Tools used to develop an Android app are as follows:
- Eclipse +ADT Plugin
- SDK Tools
73) What is meant by Google Android SDK?
The Google Android SDK is a set of tools that are used by the developers to write the app on Android-enabled devices. It contains a graphical interface that emulates an Android-driven handheld environment and allows the developers to debug their codes as per the requirements.
74) State the difference between a regular bitmap and nine- patch image?
A nine- patch image allows the resizing of the image that can be used as background or other image size requirements for the target device. The nine- patch refers to the way one can resize the image. It can be done in the in the following manners
- 4-image corner unscaled one.
- Four edges, scaled in 1 axis
- The last middle one that can be scaled into both the axes.
75) What is portable Wi-Fi hotspot?
Portable Wi-Fi hotspot allows the users to share a mobile Internet connection with another device. Using an Android powered phone as a Wi-Fi hotspot user can use their laptop to connect to the Internet using the same access point.
76) State the importance of XML- based layouts?
XML based layouts provide a consistent and standard means of setting GUI format. In general use, layout details are placed in XML files, and all other items are generally placed in a source files.
77) Explain Orientation?
Orientation is set using set orientation (), dictates whether the linear layout is represented as a row or else as a column. There the values are set as HORIZONTAL or VERTICAL.
78) Differentiate between activities and services.
Activities can be closed or can be terminated easily as and when the user wants to. Services are designed to run on the background or behind the scenes and can act independently. Most of the services run on a continuous basis regardless of their certain or no certain activities been executed.
79) State the importance of having an emulator with the Android environment?
The emulator lets the developers “play” all around the interface that gives the experience of an actual mobile device. It is for writing and testing codes, and debug too. Emulators are safe for testing codes especially if the user is in the early stage of design.
80) What is the importance of settings permission in app development?
Permission allows certain restrictions to be imposed primarily to protect data and code. Without this, codes could be compromised, resulting in defects in the actual function.
81) What is AAPT?
AAPT is Android Asset packing tool. This provides developers with the ability to deal with zip-compatible archives, and it includes creating, extracting as well as viewing its content.
82) State few disadvantages of Android in the mobile market.
Few of the disadvantages of Android in the mobile market are as follows:
- Developers can write and register apps that will only run under the Android environment.
- With the growing popularity and demand for the Android mobile devices, developers can easily take advantage of this trend by uploading the app on the market for the distribution purpose, and people can download it.
83) What are the four essential states of an activity?
The four initial stages of the activity are as followed:
- Active: If the activity is in the foreground that means it is running on the device.
- Paused: When the activity is at the background and is still visible on the screen.
- Stopped: when the activity is not visible and is actually hidden by another activity that is running on the device.
- Destroyed: when the activation process is killed or is terminated, it’s considered to be completely destroyed.
84) What is meant by activities?
Activities are windows to an interface. Like a window is created with the aim to display the output and to know about input in the form of a dialogue box. In the same manner, activities play its role, may not always in the form of a user interface.
85) Describe intents?
Intents help to display the notification message to the user from within the Android device. Users are made to response this alert.
86) List few items, which you think may be important in every Android project?
The important items for Android projects are:
87) What are containers?
In a general term, the container means some object that can be used to hold or to procure. In a similar manner here, containers are used to hold objects and the widgets altogether.It depends on which specific item is it required and what kind of arrangement is needed. It can be used to hold labels, fields or buttons.
88) What role has Dalvik played in Android development?
Dalvik plays an important role in the development of Android. It acts as a virtual machine where the Android application runs. It is with the help of Dalvik only that devices can execute multiple virtual machines effectively along with better memory management.
89) Explain the steps in creating a bounded service through AIDL.
Follow the below steps to create a bounded service through AIDL
- Step 1. Create the .aidl file that defines the programming interface.
- Step 2. Implement the interface, by extending the inner abstract stub class and imparting its methods.
- Step 3. Expose the interface by implementing the service to the users.
90) State the importance of default resources.
Default resources contain the default string and files. If this resource is not present the error will keep occurring, and the app will not be able to run. Resources are placed in subdirectories under the project res/ directory. Moreover, therefore helps the app to function in the desired conditions.
91) Explain fragment.
Fragments are reusable in nature and is a portion of an activity. In other words, it is modular that can be combined or is movable in an activity.
92) When is it desirable to kill the foreground activity?
Terminating or killing the foreground activity is the last and final savior. It is generally desirable or is the best time to kill this activity when it is consuming too much of memory. When the memory paging state is reached by the activity, it is killed so that the interface can sustain the responsiveness of the user of the application.
93) What is sticky intent in Android?
There are basically three kinds of intent in Android which are intent, sticky intent and pending intent. Sticky intent is the one that sticks with Android and helps in the future broadcast of listeners. Like in the case of BATTERY_LOW, the sticky intent will stick to the Android so that in future if the request appears again then it will return the BATTERY_LOW intent. In short words, sticky intent is the one that helps in the easy communication between service and function. This intent allows broadcasting and performing operations even after the completion of the intent. For example, ACTION_BATTERY_CHANGED will be operated after the call of registerReceiver() for performing the action.
94) Is the latest Android operating system supported in all mobile phones?
The supporting facility of Android new version depends on the capabilities and specs of the phone. There are few Android power phones that allow the user to update their version to the higher operating version. Few don’t allow getting the updated version work. Either the new feature will not be supported, or the performance of the operating device will slow down.
95) What is a marshmallow in Android?
In the latest update of Android version 6.0, the official Android code name is known as a marshmallow. It was launched in May 2015. This was the successor of the Android version 5.0 named as Lollipop. Google named this version as a marshmallow on 17th August 2015 for Nexus devices.
96) What are runnable in android?
Runnable is a concurrent unit of execution in Android. It is also a class that implements a Runnable interface. The Runnable interface is used extensively to execute code in Threads.
Latest Interview Questions
Pratice HR Questions
Most Popular Interview Questions
Latest MCQ Tests
Related Interview Questions
Leave A Comment :
Valid name is required.
Valid name is required.
Valid email id is required.