Android interview question set 1/Android Interview Questions and Answers for Freshers & Experienced

What Are Support Libraries?

Android Support Libraries are packages that contain code. They support a specific range of Android platform versions and sets of features. Most of these support libraries are now part of the androidx namespace. This is the recommended set of libraries to use.

What Are Quality Guidelines?

Google also provides an extensive list of quality guidelines. You can use this list to ensure that your app adheres to current quality standards. If your app passes these tests, you can be sure it meets your users’ expectations for performance, stability, and security.

What Is Material Design?

Material design is a design language that Google developed in 2014. It consists of the building blocks for your UI components. This language, and the design principles it embodies, are applicable to Android as well as other applications.

What is a Theme?

A theme is nothing but a set of properties that are bundled together in order to define a particular display setting. Android provides a few standard themes that are already listed in the resource file. The properties that include it are text size, color, background color, etc.

How will your application perform actions that are provided by another application, like sending an email?

For this we have Intents. Intents contain an action to be performed, defined within them and they can launch the appropriate activity from another application. The syntax for this is:
Intent i= new Intent(Intent.ACTION_SEND);
i.putExtra(Intent.EXTRA_EMAIL, recipientArray);
startActivity(i);

Where and how do you define the icon for your activity.

We define this icon of the activity inside the manifest file of the application.
To declare it you can write:

<activity android:icon=”@drawable/app_icon” android:name=”.MyActivity”></activity>
Here drawable is a resource file that is present in the res/ folder. It will have an icon with the name app_icon.

Can a standard java bytecode run in Android?

Android makes use of Dalvik Virtual Machine that needs a special bytecode. First, the java class file is converted into a Dalvik executable file using an Android tool. Generally, the developers do not use this tool, build tools to take care of the generation of DVM compatible files.

How to find memory leaks in Android applications?

In Android Studio, there is an Android Device Manager(ADM), which helps in detecting the memory leaks in the Android Platform. Upon opening it, there will be your device/ emulator with a heap sign on the left-hand side of the ADM. While running the app, you can see the heap size, memory analysis, etc. displayed on it.

How do you troubleshoot the android application which is crashing frequently?

Given below are the few steps that we need to follow while troubleshooting the crashing issue:

Free up memory space: There is only limited space available on mobile devices for mobile apps. To avoid crashing issues or memory-related issues, you need to first check the memory space.
Clear app data usage: You can clear the app data using the Application Manager under “Settings”. This will clear the cache memory and allow some free space to install another app or it will boost up your current app.
Memory Management: Some apps run perfectly on one type of mobile device but the same app may not work on another type of device as for such devices the processing power, memory management, and CPU speed is different. For any app to run properly on any type of mobile device, you should manage the memory on the device.
Compatibility issue: It is always not possible to test mobile apps on all mobile devices, browsers, operating systems, etc. So you need to test your mobile app on as many mobile devices as you can in order to avoid any compatibility issue.

What all devices have you worked on?

There are many mobile devices available in the market with different operating systems.

Specifically, I have worked on Android, Windows, Symbian, iPhone, etc

What language is supported by Android for application development?

The main language supported is Java programming language. Java is the most popular language for app development, which makes it ideal even for new Android developers to quickly learn to create and deploy applications in the Android environment.

What is the .apk extension in Android?

APK stands for Application Package kit. The .apk extension is a default file format used by the Android Operating System. This is used for the installation of the application in any Android device as it contains resource files, certificates, manifest files, and other codes as well.

How do you remove icons and widgets from the main screen of the Android device?

To remove an icon or shortcut, press and hold that icon. You then drag it downwards to the lower part of the screen where a remove button appears.

What do you understand with the nine patch images tool?

With this tool, we can resize the images and change bitmap images into nine sections. These nine sections include four corners, four edges, and an axis.

What are the commit() and apply() methods in Shared Preferences?

The commit() method returns a boolean value by writing the data synchronously. It returns 0 or 1.
The apply() method does not return any response, and it is Asynchronous.
Once you have used the apply() method and then if you call the commit() method, commit() won’t work until apply() finishes first.

What are the event Listeners?

An event listener is the interface of the View class of Android. It invokes a callback method when the user’s action activates the registered View.

What are the event Listeners?

An event listener is the interface of the View class of Android. It invokes a callback method when the user’s action activates the registered View.

Name some User Interface components.

There are many things that come under the UI components. To name some, I would say Text View, Edit Text, Buttons, Image Button, Radio Button, Radio Group, Check Box, Spinner, Progress Bar, and many others.

What is Gradle?

Gradle is an open-source build system that automates the building, testing, deployment, etc. It often uses the Java Virtual Machine supported languages like Java or Scala. It helps the developers by providing them flexibility while developing the application.

What is an ADT, and what is its use?

ADT in Android is an abbreviation of Android Development Tools. It is a very powerful plugin used in Eclipse IDE. It specifically gives an integrated environment to develop Android Applications.

What is an Android Manifest file?

The manifest file describes all the essential information about the project application for build tools, Android operating system, and google play. This file is a must for every Android project that we develop, and it is present in the root of the project source set.

How many layout types are there?

The type of layouts used in Android Apps are as follows:

1.Linear Layout
2.Relative Layout
3.Constraint Layout
4.Table Layout
5.Frame Layout
6.Absolute Layout
7.Scrollview layout

What are layouts?

Layout is nothing but arrangements of elements on the device screen. These elements can be images, tests, videos, anything. They basically define the structure of the Android user interface to make it user friendly.

What are the different ways of storage supported in Android?

The various storage ways supported in Android are as follows:

1.Shared Preference
2.Internal Storage
3.External Storage
4.SQLite Databases
5.Network Connection

How can you launch an activity in Android?

We launch an activity using Intents. For this we need to use intent as follows:

ntent intent_name= new Intent(this, Activity_name.class);
startActivity(intent_name);

Can you develop Android Apps with languages other than Java? If so, name some.

Yes, there are many languages that we can work with, for the development of Android Applications. To name some, I would say Java, Python, C, C++, Kotlin, C#, Corona/LUA.

What are Layout XML files?

Layout XML files contain the structure for the user interface of the application. The XML file also contains various different layouts and views, and they also specify various GUI components that are there in Activity or fragments.

What is a Notification?

A notification is just like a message that shows up outside the Application UI to provide reminders to the users. They remind the user about a message received, or some other timely information from the app.

What do you understand about Shared Preferences?

It is a simple mechanism for data storage in Android. In this, there is no need to create files, and using APIs, it stores the data in XML files. It stores the data in the pair of key-values. SharedPreferences class lets the user save the values and retrieve them when required. Using SharedPreferences we can save primitive data like- boolean, float, integer, string and long.

What do you understand by View Group?

It is the subclass of the ViewClass. It gives an invisible container to hold layouts or views. You can understand view groups as special views that are capable of holding other views, that are Child View.

What is a View?

A view is an important building block that helps in designing the user interface of the application. It can be a rectangular box or a circular shape, for example, Text View, Edit Text, Buttons, etc. Views occupy a certain area of the screen, and it is also responsible for event handling. A view is the superclass of all the graphical user interface components.

Define the three key loops when monitoring an activity.

• Entire lifetime: An activity that happens between onCreate and onDestroy
• Visible lifetime: An activity that happens between onStart and onStop
• Foreground lifetime: An activity that happens between onResume and onPause

What is an ANR notification in Android?

ANR is a short form for ‘Application Not Responding’. Android systems show this dialog if an application is performing too many tasks on the main thread and has been unresponsive for a long time.

What is action in Android?

In Android, an action is a description of something that an intent sender desires.
Contained in:

<intent-filter>

Syntax:

Where can you define the icon for your activity?

The icon for an activity is defined in the manifest file.

Syntax:

<activity android:icon="@drawable/app_icon" android:name=".MyTestActivity"></activity>

This means that we have to open AndroidManifest.xml. Right under the root ‘manifest’ node of the XML, we can see the ‘application’ node. We have added this attribute to ‘application’. (The ‘icon’ in ‘@drawable/icon’ refers to the file name of the icon.)

android:icon="@drawable/icon"

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

There are two types of intents: implicit intent and explicit intent. Let us see the differences between them.

Implicit intent: It is when we call system default intent like send e-mail, send SMS, or dial number.

For example:

Intent sendIntent = new Intent();
sendIntent.setAction(Intent.ACTION_SEND);
sendIntent.putExtra(Intent.EXTRA_TEXT, textMessage);
sendIntent.setType("text/plain")
startactivity(sendIntent);

Explicit intent: It is when we call our own application activity. We can also pass the information from one activity to another using explicit intent.

For example, from the first activity to the second activity:

Intent intent = new Intent(first.this, second.class);
startactivity(intent);

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.

Where will you declare your activity so the system can access it?

Activity is to be declared in the manifest file. For example:

<manifest></manifest>
<application></application>
<activity android:name=”.MyIntellipaat”>

Can Android applications only be programmed in Java?

No, not necessarily. We can program Android apps using the Native Development Kit (NDK) in C/C++. The NDK is a toolset that allows us to implement parts of our app using native code languages such as C and C++. Typically, good use cases for NDK are CPU-intensive applications such as game engines, signal processing, and physics simulation.

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.

Explain the difference between Implicit and Explicit Intent.

The difference between the implicit and explicit Intents are given below:
Explicit Intent:

An Explicit Intent is where you inform the system about which activity should handle this intent. Here target component is defined directly in the intent.
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);

Implicit Intent:

An Implicit Intent permits you to declare the action you want to carry out. Further, the Android system will check which components are registered to handle that specific action based on intent data. Here target component is not defined in the intent.

For example,
Intent i = new Intent(ACTION_VIEW,Uri.parse("http://www.interview bit.com"));
startActivity(i);

How are escape characters used as attribute?

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

What is the significance of the .dex files?

Android programs are compiled into ‘.dex’ (Dalvik Executable) files, which are zipped into a single .apk file on the device.
‘.dex’ files can be created by translating compiled applications written in Java.
(.dex) is a format that is optimized for effective storage and memory-mappable executions.

What is a content provider? How is it implemented?

Content providers manage access to a structured set of data. It is the standard interface that connects data in one process with code running in another process.
They encapsulate the data and provide mechanisms for defining data security.
Content providers are used to share the data between different applications.

What is the Adapter in Android?

The adapter, as the name suggests is based on the concept of inheritance. Using the Adapter, you can create a child view on Android to present the items in the parent view.

What do you mean by a Drawable Folder in Android?

The drawable folder in Android is a collection of drawable resources that is used for graphics that can be drawn. Every drawable is stored as an independent file in the drawable folder. It can be used as a background, banner, icons, splash screen, etc.

What is a Toast? Write its syntax.

Toast is a message that pops up on the screen. It is used to display the message regarding the status of the operation initiated by the user and covers only the expanse of space required for the message while the user’s recent activity remains visible and interactive.

Toast notification automatically fades in and out and it does not accept interaction events.

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

Mention the difference between class, file and activity in Android?

The difference between them is as follows:

Class is a compiled form of a .java file that Android uses to produce an executable .apk file.
A file is a block of arbitrary information or resources used for storing information. It can be of any file type.
Activity is a single screen that represents GUI(Graphical User Interface) with which users can interact in order to do something like dial the phone, view email, etc.

What is a content provider? How is it implemented?

Content providers manage access to a structured set of data. It is the standard interface that connects data in one process with code running in another process.
They encapsulate the data and provide mechanisms for defining data security.
Content providers are used to share the data between different applications.

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(){}
}

What is a sticky broadcast? Give an example.

A 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.

Search
R4R Team
R4R provides Android Freshers questions and answers (Android Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,Android interview question set 1,Android Freshers & Experienced Interview Questions and Answers,Android Objetive choice questions and answers,Android Multiple choice questions and answers,Android objective, Android questions , Android answers,Android MCQs questions and answers Java, C ,C++, ASP, ASP.net C# ,Struts ,Questions & Answer, Struts2, Ajax, Hibernate, Swing ,JSP , Servlet, J2EE ,Core Java ,Stping, VC++, HTML, DHTML, JAVASCRIPT, VB ,CSS, interview ,questions, and answers, for,experienced, and fresher R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for Android fresher interview questions ,Android Experienced interview questions,Android fresher interview questions and answers ,Android Experienced interview questions and answers,tricky Android queries for interview pdf,complex Android for practice with answers,Android for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .