Android Development Technical Interview Questions Answers

Android Development Technical Interview Questions Answers


What is Android?
Android platform is a software stack for mobile devices consisting of an operating system, middleware, a user-friendly interface, and key powerful mobile applications. Developers can create applications for the platform using the Android SDK. Applications are written using the Java programming language and run on Dalvik, a custom virtual machine designed for embedded use, which runs on top of a Linux kernel. Key Features : 
  • Android is Open System.
  • Android runs on top of the Linux Kernel.
  • Android applications run on Dalvik virtual machine.
  • Android uses the WebKit browser.
  • Android uses SQLite as Datastore.


What is the current version of Android, and how old is it?

The Latest Version of Android is 10.0
The initial version of Android 10.0 was released on September 3, 2019, on Google's Pixel devices.


Describe Android Application Architecture?

Android application architecture has the following components. They are as follows − Services − It will perform background functionalities Intent − It will perform the interconnection 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


What is Dalvik Virtual Machine

It is a type of JVM used in android devices to run apps and is optimized for low processing power and low memory environments. Unlike the JVM, the Dalvik Virtual Machine doesn’t run .class files, instead, it runs .dex files. .dex files are built from .class files at the time of compilation and provide higher efficiency in low-resource environments. The Dalvik VM allows multiple instances of Virtual machines to be created simultaneously providing security, isolation, memory management, and threading support. It is developed by Dan Bornstein of Google.

The Dex File Format:

In standard Java environments, Java source code is compiled into Java bytecode, which is stored within .class files. The .class files are read by the JVM at runtime. Each class in your Java code will result in one .class file. This means that if you have, say, one .java source file that contains one public class, one static inner class, and three anonymous classes, the compilation process (javac) will output 5 .class files.

On the Android platform, Java source code is still compiled into .class files. But after .class files are generated, the “dx” tool is used to convert the .class files into a .dex, or Dalvik Executable, file. Whereas a .class file contains only one class, a .dex file contains multiple classes. It is the .dex file that is executed on the Dalvik VM.

The .dex file has been optimized for memory usage and the design is primarily driven by sharing of data.


Why cannot you run the standard Java bytecode on Android?

Android uses Dalvik virtual machine (DVM) which requires a special bytecode. First of all, we have to convert Java class files into Dalvik executable files using an Android tool called ‘dx’. In normal circumstances, developers will not be using this tool directly; build tools will care for the generation of DVM-compatible files.


What is Android Debug Bridge 

ADB (adb.exe) allows you to issue commands to the Emulator.exe tool. When you are working in a command-line environment, the ADB tool allows you to do the following:

Start and stop the server
Install and uninstall applications


Move files to and from the emulator
What is An Activity?

Activity performs actions on the screen. If you want to do any operations, we can do it with an activity


What is a NinePatch (9-patch) image?

It is a resizable bitmap resource that can be used for backgrounds or other images on a device. NinePatch class permits drawing a bitmap in nine sections. The 9-patch images have an extension as .9.png. It allows extensions in 9 ways, i.e., 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.


What is the APK format?

The Android packaging key is compressed with classes, UI's, supportive assets, and manifest. All files are compressed to a single file called APK.



What is An Intent?

It is connected to either the external world of application or the internal world of application, Such as opening a pdf is intent and connects to the web browser. etc.



What is an explicit Intent?

Android Explicit intent specifies the component to be invoked from activity. In other words, we can call another activity in android by explicit intent.



What is an implicit Intent?

Implicit Intent doesn't specify the component. In such case, intent provides information on available components provided by the system that is to be invoked.


What’s the difference between an implicit and an explicit intent?

An explicit intent is where you tell the system which Activity or system component it should use to respond to this intent. Implicit intents allow you to declare the action you want to perform; the Android system will then check which components are registered to handle that action.

Here, you’re looking for an understanding of when you should use each type of intent, as the vast majority of the time you’ll use explicit intents to start components in your own application, while implicit intents are most commonly used to communicate with components from other third-party applications.


What is An android manifest file?

Every application must have an AndroidManifest.xml file (with precisely that name) in its root directory. The manifest file presents essential information about your app to the Android system, information the system must have before it can run any of the app's code.


What language does Android support to develop an application?

Android applications have written using java(Android SDK) and C/C++(Android NDK).


What does ADT stand for?

ADT stands for Android development tool, This is useful to develop applications and test the applications.


What’s the difference between onCreate() and onStart()?

The onCreate() method is called once during the Activity lifecycle, either when the application starts, or when the Activity has been destroyed and then recreated, for example during a configuration change.

The onStart() method is called whenever the Activity becomes visible to the user, typically after onCreate() or restart().



What the tools are placed in An Android SDK?

Android SDK collaborated with Android Emulator, DDMS(Dalvik Debug Monitoring Services), AAPT(Android Asset Packaging tool), and ADB(Android debug bridge)


What is view group in android?

View group is a collection of views and other child views, it is an invisible part and the base class for layouts.


What is a service in android?

The Service is like as an activity to do background functionalities without UI interaction.


What is a content provider in android?

A content provider component supplies data from one application to others on request. Such requests are handled by the methods of the ContentResolver class. A content provider can use different ways to store its data and the data can be stored in a database, in files, or even over a network.


What are the notifications available on android?

Toast Notification − It will show a pop-up message on the surface of the window

Status Bar Notification − It will show notifications on the status bar Dialogue

Notification − It is an activity-related notification.


What is a container in android?

The container holds objects, widgets, labels, fields, icons, buttons, etc.


What is ADB in android?

It acts as a bridge between emulator and IDE, it executes remote shell commands to run applications on an emulator


What is ANR in android?

ANR stands for application is not responding, basically it is a dialog box that appears when the application is not responding.

One technique that prevents the Android system from concluding a code that has been unresponsive for a long period is to create a child thread. Within the child thread, most of the actual tasks of the codes can be placed so that the main thread runs with minimal periods of unresponsive time.


What is an Adapter in android?

The Adapter is used to create child views to represent the parent view items.


What is Fragment in android?

Fragments are Android's solution to creating reusable user interfaces.

The main use of fragments is to build multipane activities, which makes it perfect for Tablet/Phone responsive apps.

Fragments are components that run in the context of an Activity. Fragment components encapsulate application code so that it is easier to reuse and to support different-sized devices.

Mini-activities are known as fragments. Think of a fragment as another form of activity. You create fragments to contain views, just like activities. Fragments are always embedded in an activity.


When should you use a Fragment, rather than an Activity?

This is still a much-debated topic, but the code used to create an Activity is fundamentally more involved than the code used to create a Fragment. The old Activity has to be destroyed, paused, or stopped, and a new Activity has to be created. The developer should acknowledge that the best practice is to only use Activities when you need to swap the entire screen, and use fragments everywhere else.

Bonus points if the Android developer mentions any of the following use cases, where you’ll almost always use a Fragment, rather than an Activity:

When you’re working with UI components or behavior that you’re going to use across multiple Activities. When you’re using one of the navigational methods that are closely linked to fragments, such as swipe views.When your users would benefit from seeing two different layouts side-by-side. When you have data that needs to persist across Activity restarts (i.e you need to use retained fragments).


What is a Handler in android?

Handler is a thread that runs on the Main UI thread. Handler allows to schedule or repeats the Task at a given interval of time. The handler provides us a way to communicate with the main Thread.


What are shared preferences in android?

Shared preferences are the simplest mechanism to store the data in XML documents.


What are the key components in android architecture?

Linux Kernel Libraries Android Framework Android applications.


What does the intent filter do in android?

Intent filters filter out the intents.


Where layouts are placed on android?

In The Layout folder, layouts are placed as XML files


What is a nine-patch images tool in android?

We can change bitmap images into nine sections as four corners, four edges, and an axis


How many dialog boxes do support in android?

AlertDialog, ProgressDialog, DatePickerDialog, and TimePickerDialog

What are the exceptions available in android?

InflateException, Surface.OutOfResourceException, SurfaceHolder.BadSurfaceTypeException, and WindowManager.BadTokenException

What is the order of dialog box in android?

Positive, Neutral, Negative.


What are the different storage available in android?

Shared Preferences, Internal Storage, External Storage, SQLite Databases, and Network Connection


What is a Sticky Intent in android?
Sticky Intent is also a type of intent that allows the communication between a function and a service, for example,send a sticky broadcast() is performing the operations after completion of intent also.


How to Translate in Android?

Android uses Google translator to translate data from one language into another language and placed it as a string while the development


How is the use of web view in Android?

WebView is a UI component that can display either remote web pages or static HTML


Why can't you run the java byte code on Android?

Android uses DVM (Dalvik Virtual Machine ) rather using JVM(Java Virtual Machine), if we want, we can get access to the .jar file as a library.


How does android track the application on the process?

Android provides a Unique ID to all applications called Linux ID, this ID is used to track each application.


How to change the application name after its deployment?

It's not truly recommended to change the application name after its deployment, if we change it, it will impact all other internal components.


Define the application resource file in android?

JSON,XML bitmap.etc are application resources.You can inject these files into the build process and can load them from the code.


How to launch an activity in android?

Using intent, we can launch an activity. Intent intent = new Intent(this, TestActivity.class); startActivity(intent);



How do you pass the data to sub-activities android?

Using Bundle, we can pass the data to sub-activities. Bundle bun = new Bundle(); bun.putString("EMAIL", "contact@gmail.com");



What is a singleton class in android?

A class that can create only an object, that object can be shared able to all other classes.



What is a fragment in android?

The fragment is a piece of activity, if you want to turn your application 360 degrees, you can do this by fragment.



What is sleep mode in android?

Sleep mode means the CPU will be sleeping and it doesn't accept any commands from the android device excthe ept Radio interface layer and alarm.



Which Kernal is used in android?

Android is a customized Linux 3.6 kernel.



How to update UI from service in android?

Use a dynamic broadcast receiver in the activity, and send a broadcast from the service. Once the dynamic receiver is triggered update the UI from that receiver.



What are application Widgets in android?

App Widgets are miniature application views that can be embedded in other applications (such as the Home screen) and receive periodic updates. These views have referred to as Widgets in the user interface, and you can publish one with an App Widget provider.



How do you find any view element in your program?

Using with findViewById we can find the view element.



What is a drawable folder in android?

A compiled visual resource that can be used as backgrounds, banners, icons, splashscreensn, etc.

What is the type of flags to run an application in android?

FLAG_ACTIVITY_NEW_TASK FLAG_ACTIVITY_CLEAR_TOP.



What is a ThreadPool? And is it more effective than using several separate Threads?

ThreadPool consists of a task queue and a group of worker threads, which allows it to run multiple parallel instances of a task.

Here, you’re assessing the app developer’s understanding of how multithreading has the potential to improve an app’s performance, but also how it can negatively impact performance when used incorrectly.

Using ThreadPool is more efficient than having multiple operations waiting to run on a single thread, but it also helps you avoid the considerable overhead of creating and destroying a thread every time you require a worker thread.



What is the difference between Serializable and Parcelable?

Serializable is a standard Java interface that’s easy to integrate into your app, as it doesn’t require any methods. Despite being easy to implement, Serializable uses the Java reflection API, which makes it a slow process that creates lots of temporary objects.

Parcelable is optimized for Android, so it’s faster than Serializable. It’s also fully customizable, so you can be explicit about the serialization process, which results in fewer garbage objects.

While the developer may acknowledge that implementing Parcelable does require more work, the performance benefits mean that they should advise using Parcelable over Serialization, wherever possible.



What is a BuildType in Gradle? And what can you use it for?

Build types define properties that Gradle uses when building and packaging your Android app.

This question allows you to check that the developer can differentiate between product flavors, build variants, and build types, as these are very similar concepts that are a common source of confusion:

A build type defines how a module is built, for example, whether ProGuard is run.

A product flavor defines what is built, such as which resources are included in the build.

Gradle creates a build variant for every possible combination of your project’s product flavors and builds types.



What is the major difference between ListView and RecyclerView?

There are many differences between ListView and RecyclerView, but the Android developer should be aware of the following in particular:

The ViewHolder pattern is entirely optional in ListView, but it’s baked into RecyclerView.
ListView only supports vertical scrolling, but RecyclerView isn’t limited to vertically scrolling lists.


How do you find memory leaks in the mobile app on the Android platform?

Android Studio is using Android Device Manager (ADM), this ADM is used to detect memory leaks in the Android platform.

When you open ADM in the Android Studio then on the left-hand side of the ADM, you will find your device or emulator in which a heap sign will be displayed. When you are running any mobile app then you will see the heap size, memory analysis, and other statistics displayed on it.


What are the different data storage options available on the Android platform?

The android platform provides a wide range of data storage options. These options must be used based on the need such as whether data is secure and used with permission only or can be accessed publicly.

Below is the list of data storage options on the Android platform:

SharedPreference: It stores data in XML files. It is the simplest way to store private data in the key-value pair.

SQLite: It stores structured data in a private database.

Internal Storage: It stores data in the device file system and any other app cannot read this data.

External Storage: Data is stored in the file system but it is accessible to all apps on the device

Android Development Technical Interview Questions Answers
Previous Post Next Post