0% found this document useful (0 votes)
85 views26 pages

TOP 30 Android Developer Interview Questions

The document discusses Android versions and their release years. It lists the versions from Android 1.5 Cupcake to Android 9.0 Pie. It also explains what an Activity is in Android and which methods are commonly implemented by Activity subclasses.

Uploaded by

Annonymous
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views26 pages

TOP 30 Android Developer Interview Questions

The document discusses Android versions and their release years. It lists the versions from Android 1.5 Cupcake to Android 9.0 Pie. It also explains what an Activity is in Android and which methods are commonly implemented by Activity subclasses.

Uploaded by

Annonymous
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 26

TOP 30

Interview Question

Created by- Topper World


Topperworld.in

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

Ans: The most recent version, Android 13, was published on August 15, 2022,
while the recently released Android 12.1/12L offers advancements for
foldable phones, tablets, desktop-sized screens, and Chromebooks.

Android is a mobile operating system developed by Google. It is based on the


Linux kernel and designed primarily for touchscreen mobile devices such as
smartphones and tablets.

Every other Android version has been named after either sweet or desserts.
The following table represents the Android name, version and the year of
release.

Android Name Version Year of Release

Android 1.5 Android Cupcake 2009

1.6 Donut 2009

2.0-2.1 Eclair 2009

2.2 – 2.2.3 Froyo 2010

2.3 – 2.3.7 Gingerbread 2010

3.0 – 3.2.6 Honeycomb 2011

©Topperworld
4.0 – 4.0.4 Ice Cream Sandwich 2011

4.1 – 4.3.1 Jelly Bean 2012

4.4 – 4.4.4 KitKat 2013

5.0 – 5.1.1 Lollipop 2014

6.0 – 6.0.1 Marshmallow 2015

7.0 – 7.1.2 Nougat 2016

8.0 – 8.1 Oreo 2017

9.0 Pie 2018

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


subclasses of an Activity?

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

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

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

➢ onCreate(Bundle):

©Topperworld
It is a method where your initialization is done. Under this, you will
callsetContentView(int) with a layout resource which defines your UI. Also,
you can retrieve the widgets in that UI by using findViewById(Int). These are
required to interact programmatically.

➢ onPause():

It is a method which deals with the user whenever it leaves the activity.

So any changes made by the user should be commited which is done by


the ContentProvider that holds the data.

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

1
2 public class MainActivity extends Activity {
}

Q3. What are the features of Android?

ANS:Google has changed the lives of everyone by launching a product that


improves the mobile experience for everyone.

©Topperworld
Android helps in understanding your tastes and needs, by giving various
features such as having wallpapers, themes, and launchers which completely
change the look of your device’s interface.

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

⚫ Open-source
⚫ Customizable operating System
⚫ Variety of apps can be developed.
⚫ Reduces overall complexity
⚫ Supports messaging services, web browser, storage(SQLite),
connectivity,media and many more.

Q4. Explain Android Architecture.

ANS:Android architecture refers to the different layers in the Android stack.

It includes your operating system, middleware, and important applications.

©Topperworld
Each layer in the architecture provides different services to the layer just
above it.

The four layers in the Android stack are:

⚫ Linux Kernel
⚫ Libraries
⚫ Android Framework

Q5. Which programming language is used for Android App


development?

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

Q6. What is APK format?

ANS:The APK file or Android application package is the compressed file


format that is used to distribute and install application software and
middleware onto Google’s Android operating system. The file has .apk

©Topperworld
extension and has all the application code, resource files, certificates, and
other files, compressed in it.

Q7. What is the life cycle of android activity?

ANS:User navigates between different screen or app, it goes through


different states in their lifecycle.

So an activity lifecycle consists of 7 different methods of android.app.Activity


class i.e :

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


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

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

➢ onPause(): Activity is partially obscured by another activity. Other activity


that’s in the foreground is semi-transparent.

➢ onStop(): The activity is completely hidden and not visible to the user.
➢ onDestroy(): Activity is destroyed and removed from the memory.

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

ANS: An Intent is an “intention” to do an action. An intent is a messaging


object you can use to request an action from another app component.

Methods are used to deliver intents to different components:

©Topperworld
❖ Flutter Application Development Course

Explore Curriculum

⚫ context.startActivity() – To start an activity

⚫ context.startService() – To start a service


⚫ context.sendBroadcast() – To deliver a broadcast

❖ Types of Intent:

➢ Implicit Intent:

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

➢ Explicit Intent:

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


the intent.

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


intent?

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

For example:

1
2 Intent i = new
Intent(ACTION_VIEW,Uri.parse("<a
href="https://topperworld.in/">https://topperworld.
in/</a>"));
startActivity(i);

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

For example:

1
2
3
4 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);

©Topperworld
Q10. What is an Android Framework?

ANS:Android Framework is an essential part of the Android Architecture.

It is a set of APIs that allows developers to write apps and has the following
components:

Components that conduct long-running operations in the


Services
background, without the inclusion of a user interface.

Objects that initiate actions from other app components,


Intent either within your program (explicit intents) or through
another piece of software on the device (implicit intents).

Components that provide users with screens on which they


Activities can interact with objects and perform actions. This is the
base from which Intents can be deployed.

Content Components that enable users to access data within an app


Providers such as audio, video, images, contact information, etc.

Others App widgets and Processes and Threads

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

ANS:The difference between them are as follows:

⚫ File is a block of arbitrary information or resources for storing


information. It can be any file type.
⚫ Class is a compiled from of .Java file which Android uses to produce an
executable apk.
⚫ Activity is the equivalent of a Frame/Window in GUI toolkits. It is not a
file or a file type but just a class that can be extended in Android to load
UI elements on view.

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

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

The tools placed in Android SDk are:

⚫ Android Emulator
⚫ DDMS – Dalvik Debug Monitoring Services

©Topperworld
⚫ AAPT – Android Asset Packaging tool
⚫ ADB – Android debug bridge

Q13. What is a Toast? Write its syntax.

ANS:

⚫ Toast notification is a message that pops up on the window.


⚫ It only covers the expanse of space required for the message and the
user’s recent activity remains visible and interactive.
⚫ The notification automatically fades in and out and does not accept
interaction events.

Syntax:

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

Q14. What is an Android Framework?

ANS: Android Framework is an essential part of the Android Architecture. It is


a set of APIs that allows developers to write apps and has the following
components:

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

ANS:ANR stands for ‘Application Not Responding ’ . This dialogue is


displayed if the main thread in the application has been unresponsive for a
long time and in the following conditions:

• When there is no response to an input event after 5 seconds.


• When a broadcast receiver is not done executing within 10 seconds.

Following measures can be taken to avoid ANR:

• To avoid ANR, an app should perform a lengthy database or networking


operations in separate threads.
• One technique is to create a child thread to prevent the Android system
from concluding a code that has been unresponsive for a long period of
time. Most of the actual workings of the codes can be placed within the
child thread to ensure that the main thread runs with minimal
unresponsive time.
• For background task-intensive apps, you can alleviate pressure from
the UI thread by using the IntentService.

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

ANS:

• Broadcast Receiver is a mechanism using which host application can


listen for System level events.
• Broadcast receiver is used by the application whenever they need to
perform the execution based on system events. Like listening for
Incoming call, sms etc.
• Broadcast receivers helps in responding to broadcast messages from
other application or from the system.
• It is used to handle communication between Android operating system
and applications.

It is implemented as a subclass of BroadcastReceiver class and each message


is broadcaster as an Intent object.

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

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

ANS:

©Topperworld
• We can use Bundles to pass data to sub-activities.
• There are like HashMaps that and take trivial data types. These Bundles
transport information from one Activity to another

1
2
3 Bundle b=new Bundle();
b.putString("Email","[email protected]");
i.putExtras(b); // where I is intent

Q18. What is the use of WebView in Android?

ANS:WebView is a view that display web pages inside your application.

According to Android, “this class is the basis upon which you can roll your
own web browser or simply display some online content within your Activity. It
uses the WebKit rendering engine to display web pages and includes methods
to navigate forward and backward through a history, zoom in and out,
perform text searches and more.

In order to add WebView to your application, you have to


add <WebView>element to your XML layout file.

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

ANS:Context defines the current state of an App. Context provides access to


creating new activity instance, access databases, start a service, etc. There is
a base class ApplicationContext, and subclasses for components: Activity,
Service.

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

ANS:

• App – It describes the fundamental characteristics of the app and


defines each of its components.
• java – This contains the .java source files for your project. By default, it
includes an MainActivity.

java source file. Under this, you create all the activities which have .java
extensions and all the code behind the application.

MainActivity.java is the actual file which gets converted to a dalvik


executable and runs your app.

• res – It is a directory for files that define your app ’ s user


interface. You can add TextView, button etc to build the GUI and use
various attributes like android:layout_width, android:layout_height etc
which are used to set its width and height.

©Topperworld
• Gradle Scripts – This is an auto-generated file which contains
compileSdkVersion, buildToolsVersion, applicationId, minSdkVersion,
targetSdkVersion, versionCode and versionName

Q21. What are the different storage methods in Android?

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

⚫ Shared Preferences – Store private primitive data in key-value pairs


⚫ Internal Storage – Store private data on the device memory
⚫ External Storage – Store public data on the shared external storage
⚫ SQLite Databases – Store structured data in a private database

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


supported by it?

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

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

ANS: A service in android is a background process which is used to perform


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

1. Local : This service is accessed from within the application.

2. Remote : This service is accessed remotely from other applications

running on the same device.

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

1
2 public class MyService extends Service {
}

Q24. What is a Sticky Intent?

ANS:A Sticky Intent is a broadcast from sendStickyBroadcast() method which


floats around even after the broadcast, allowing others to collect data from it.

Q25. Explain Folder, File & Description of Android Apps

ANS:

• src: contains the .java source files for your project.

©Topperworld
• gen: contains the .R file, a compiler-generated file that references all
the resources found in your project.
• bin: contains the Android package files .apk built by the ADT during the
build process and everything else needed to run an Android application.
• res/drawable-hdpi: this is a directory for drawable objects that are
designed for high-density screens.
• res/layout: this is a directory for files that define your app’s user
interface.
• res/values: this is a directory for other various XML files that contain a
collection of resources, such as strings and colors definitions.
• AndroidManifest.xml: this is the manifest file which describes the
fundamental characteristics of the app and defines each of its
components.

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


development?

ANS:Manifest file plays an integral role as it provides the essential


information about your app to the Android system, which the system must
have before it can run any of the app’s code.

Manifest file performs various tasks such as:

©Topperworld
⚫ It names the Java package for the app as the package name serves as a
unique identifier for the application.
⚫ It protects the application by declaring permissions in order to access
protected parts of the API and interact with other applications.
⚫ Manifest file declares the minimum level of the android API and list the
libraries which is linked with the application.
⚫ Manifest file list the instrumentation classes.
⚫ These classes provide profiling and other information as the
application runs, but this information is removed as soon the
application is publishes. It remains only till the application is in
development mode.

➢ Structure of a manifest file:

The structure of a manifest file consists of various elements such as action,


activity, activity-alias and many more. Refer to the below screenshot which
shows the general structure of the manifest file.

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

ANS:Activity is typically a single, focused operation that a user can perform


such as dial a number, take a picture, send an email, view a map etc.

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

©Topperworld
activity is paused, so are all fragments in it, and when the activity is destroyed,
so are all of its fragments.

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


deployment?

ANS:It is not recommended to change the application after its deployment.


This may break some functionality.

Q29. What database is used in Android? How does it differ from


client-server database management systems?

ANS:SQLite is the open-source relational database. The SQLite engine is


serverless, transactional, and self-contained.
Instead of the typical client-server relationship of most database
management systems, the SQLite engine is integrally linked with the
application.

The library can also be called dynamically and makes use of simple function
calls that reduce latency in database access.

©Topperworld
Q30. What is DDMS?

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

◼ Port forwarding services


◼ Screen capture on the device
◼ Thread and heap information
◼ Logcat
◼ Incoming call and SMS spoofing
◼ Network traffic tracking
◼ Location data spoofing

©Topperworld
ABOUT US

At TopperWorld, we are on a mission to empower college students with the


knowledge, tools, and resources they need to succeed in their academic
journey and beyond.

➢ Our Vision

❖ Our vision is to create a world where every college student can easily
access high-quality educational content, connect with peers, and achieve
their academic goals.
❖ We believe that education should be accessible, affordable, and engaging,
and that's exactly what we strive to offer through our platform.

➢ Unleash Your Potential

❖ In an ever-evolving world, the pursuit of knowledge is essential.


TopperWorld serves as your virtual campus, where you can explore a
diverse array of online resources tailored to your specific college
curriculum.
❖ Whether you're studying science, arts, engineering, or any other discipline,
we've got you covered.
❖ Our platform hosts a vast library of e-books, quizzes, and interactive
study tools to ensure you have the best resources at your fingertips.

➢ The TopperWorld Community

©Topperworld
❖ Education is not just about textbooks and lectures; it's also about forming
connections and growing together.
❖ TopperWorld encourages you to engage with your fellow students, ask
questions, and share your knowledge.
❖ We believe that collaborative learning is the key to academic success.

➢ Start Your Journey with TopperWorld

❖ Your journey to becoming a top-performing college student begins with


TopperWorld.
❖ Join us today and experience a world of endless learning possibilities.
❖ Together, we'll help you reach your full academic potential and pave the
way for a brighter future.
❖ Join us on this exciting journey, and let's make academic success a reality
for every college student.

©Topperworld
“Unlock Your
Potential”
With- Topper World

Explore More

topperworld.in

DSA Tutorial C Tutorial C++ Tutorial

Java Tutorial Python Tutorial

Follow Us On
E-mail
[email protected]

You might also like