Android Developer Interview Questions and Answers - A list of top android interview questions and answers are given below. The questions asked by interviewers in android is given below.
Operating Systems have developed a lot in last 15 years. Starting from black and white phones to recent smart phones or mini computers, mobile OS has come far away. Especially for smart phones, Mobile OS has greatly evolved from Palm OS in 1996 to Windows pocket PC in 2000 then to Blackberry OS and Android.
One of the most widely used mobile OS these days is ANDROID. Android is a software bunch comprising not only operating system but also middleware and key applications. Android Inc was founded in Palo Alto of California, U.S. by Andy Rubin, Rich miner, Nick sears and Chris White in 2003. Later Android Inc. was acquired by Google in 2005. After original release there have been number of updates in the original version of Android.
Android is a mobile operating system developed by Google, based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. This project is lead by Google. Android is an open source software stack created for a wide array of devices with different form factors. The primary purposes of Android are to create an open software platform available for carriers, OEMs, and developers to make their innovative ideas a reality and to introduce a successful, real-world product that improves the mobile experience for users.
Android applications are written in java programming language. Android is available as open source for developers to develop applications which can be further used for selling in android market. There are around 200000 applications developed for android with over 3 billion+ downloads. Android relies on Linux version 2.6 for core system services such as security, memory management, process management, network stack, and driver model. For software development, Android provides Android SDK (Software development kit).
The first version 1.0 of android development kit (SDK) was released in 2008 and latest updated version is Oreo.
Code name
Version
API level
Oreo
8.1.0-8.0.0
API level 26, 27(2017)
Nouga
7.0.0-7.1.0
API level 24, 25(2016)
Marshmallow
6
API level 23(2015)
Lollipop
5.0-5.1
API level 21, 22(2014)
KitKat
4.4 - 4.4.4
API level 19, 20(2013)
Jelly Bean
4.1.x-4.3.x
API level 16, 17, 18(2012)
IceCream Sandwich
4.0.3 - 4.0.4
API level 15, NDK 8(2011)
4.0.1 - 4.0.2
API level 14, NDK 7(2011)
Honeycomb
3.2.x
API level 13(2011)
3.1
API level 12, NDK 6(2011)
3
API level 11(2011)
Gingerbread
2.3.3 - 2.3.7
API level 10(2011)
2.3 - 2.3.2
API level 9, NDK 5(2010)
Froyo
2.2.x
API level 8, NDK 4(2010)
Eclair
2.1
API level 7, NDK 3(2010)
2.0.1
API level 6(2009)
2
API level 5(2009)
Donut
1.6
API level 4, NDK 2(2009)
Cupcake
1.5
API level 3, NDK 1(2009)
 Petit Four
1.1
API level 2(2009)
(No code name)
1
API level 1(2008)

























What is Android?
Android is an open source operating system that is mainly used on mobile devices like tablets and Smartphones. Android is a software stack for mobile devices that includes an operating system, middleware and key applications. The Android SDK provides the tools and APIs necessary to begin developing applications on the Android platform using the Java programming language.
What is Android Architecture?
Android Architecture consists of 5 main elements
  • Applications
  • Application Framework
  • Android runtime
  • Libraries
  • Linux Kernel
What is API Level?
API Level is an integer value that uniquely identifies the framework API revision offered by a version of the Android platform.
The Android platform provides a framework API that applications can use to interact with the underlying Android system. The framework API consists of:
  • A set of Intents
  • A core set of packages and classes
  • A set of XML elements and attributes for declaring a manifest file
  • A set of XML elements and attributes for declaring and accessing resources
  • A set of permissions that applications can request, as well as permission enforcements included in the system
What is NDK?
The NDK (Native Development Kit) provides all the tools (compilers, libraries, and header files) to build apps that access the device natively. Native code (in C/C++) is necessary for high performance to overcome the limitations in Java's memory management and performance.
Android apps are typically written in Java, with its elegant object-oriented design. However, at times, you need to overcome the limitations of Java, such as memory management and performance, by programming directly into Android native interface. Android provides Native Development Kit (NDK) to support native development in C/C++, besides the Android Software Development Kit (Android SDK) which supports Java.

Explain 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 inter connection 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 are the advantages of android?
Open-source: It means no license, distribution and development fee.
Platform-independent: It supports windows, mac and Linux platforms.
Supports various technologies: It supports camera, Bluetooth, Wi-Fi, speech, EDGE etc. technologies.
Highly optimized Virtual Machine: Android uses highly optimized virtual machine for mobile devices, called DVM (Dalvik Virtual Machine).

What are the Uses of API Level in Android?
The API Level identifier serves a key role in ensuring the best possible experience for users and application developers:
  • It lets the Android platform describe the maximum framework API revision that it supports.
  • It lets applications describe the framework API revision that they require.
What is an APK File?
Just like Windows (PC) systems use an .exe file for installing software, Android does the same. An APK file is the file format used for installing software on the Android operating system.

What is the JobScheduler API?
JobScheduler is an abstract class that allows developers to create jobs that execute in the background when certain conditions are met. Typical conditions are:
  • device is plugged into a power source
  • device is connected to Wi-Fi 
Why would I want to install an APK File?
APK files of new Android builds are often leaked ahead of time, giving you early access to all the exciting new features that otherwise wouldn't be available to you. Also, some apps are restricted to regions and outside of yours.
APK files also allow you to bypass carriers to get the latest Google updates, which can take a a frustrating amount of time to arrive via an over-the-air update from your network. And if your Android device lacks access to the Google Play Store, APK files may be your only option for installing apps on your device.

What do you understand by having an emulator in Android environment?
An emulator allows you to play around the interface and it feels like you are working on actual mobile devices only. With the help of an emulator, you can write codes or debug codes securely especially during initial design phases.

What is an Android Manifest file?
Applications declare their components in a manifest file that's bundled into the Android package, the .apk file that also holds the application's code, files, and resources. The manifest is a structured XML file and is always named AndroidManifest.xml for all applications. It is also used for naming any libraries the application needs to be linked against (besides the default Android library) and identifying any permission the application expects to be granted.

How does the AOSP relate to the Android Compatibility Program?
Android Open-source project (AOSP) that maintains Android software and keep track of the new versions. It can be used for any purpose including the devices that are not compatible with other devices. It is related to the Android Compatibility Program as it defines the implementation of Android that is compatible with the third party apps.

Why cannot you run 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 and build tools will care for the generation of DVM compatible files.

How to create a new Android project within android IDE?
You have to use an “activity Creator” to start a new android project within android IDE. An “activity Creator” is made up of the shell script that will help you in creating fresh file structure to write codes.

What is the Google Android SDK?
Google Android SDK is a set of tools required by developers to enable them write apps on Android enabled devices. It has a graphical interface which imitates an Android handheld environment, enabling them in testing and debugging their codes.

What are the seven lifecycle methods of Android activity?
The seven lifecycle methods of Android activity are onCreate(), onStart(), onRestart(), onResume(), onPause(), onStop(), and onDestroy(). Their purpose is to help structure your code around how you want an activity to perform throughout its lifecycle on the device.

What are intents?
Intents display messages of notification from within the Android enabled device to the user. Intents are used to notify the user when a particular state occurs, and users have the opportunity to respond to the notification.

What dialog boxes are supported in android?
There are 4 dialog boxes which have been supported by Android. These are as follows
AlertDialog: An alert dialog box supports 0 to 3 buttons and a list of Selectable elements, including check boxes and radio buttons. Among the other dialog boxes, the most suggested
dialog box is the alert dialog box.
ProgressDialog: This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.
DatePickerDialog: This dialog box is used for selecting a date by the user.
TimePickerDialog: This dialog box is used for selecting time by the user.

What are typical subdirectories that the “res” directory does contain?
The “res” folder contains various resource files:
  • res/drawable/* -> images and nine-patch files.
  • res/layout/ -> XML-based UI layout files.
  • res/values/ -> strings, colors, dimensions.
  • res/menu/ -> menu specification files
  • res/raw/ -> raw files like a CSV file, movie clip or audio clip (mp3)
  • res/xml/ -> general XML files
What is an Adapter in android?
The Adapter is used to create child views to represent the parent view items.

What is ANR?
ANR is the acronym for Application Not Responding. When an application is unresponsive for a long time, the dialogue shows up to let the user know about the situation.

What is DDMS and what can it do?
DDMS is short for Dalvik Debug Monitor Server. It ships natively with Android and contains a number of useful debugging features including: location data spoofing, port-forwarding, network traffic tracking, incoming call/SMS spoofing, thread and heap information, screen capture, and the ability to simulate network state, speed, and latency.

What is AIDL?
AIDL is the abbreviation for Android Interface Definition Language. It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication. The process involves breaking down objects into primitives that are Android understandable.

What is GSON?
GSON is a Java Library that can convert Java Objects into JSON Objects.

What is ADB?
ADB simply stands for Android Debug Bridge. It presents developers with the power to perform shell commands that are remote. Its major work is to permit and direct communication towards and from the emulator port.

What’s the difference between a Frame Layout and a Table Layout?
A Frame Layout stacks up child views above each other with the last view added on the top. Though we can control the position of the children inside the Frame Layout using the layout gravity attribute.
When the width and height of the Frame Layout are set to wrap content, the size of the Frame Layout equals the size of the largest child (plus padding).
A Table Layout consists of Table Rows. The children are arranged in the form of rows and column

What is the difference between DP, SP and PX?
DP (Density-independent Pixel): abstract unit that is based on the physical density of the screen. One DP is one pixel on a 160 dpi screen (the unit is relative to a 160 dpi screen), but one DP equals two hardware pixels on a 320 dpi screen
SP (Scale-independent Pixel): same as DP but it is also scaled by the user’s font size preference. This unit is used to specify font sizes.
PX (Pixel): corresponds to actual pixels on the screen

What are the methods to avoid memory leaks in Android?
Android applications are well bundled with the memory but they have a drawback of running lots of application that keeps in the memory to make the processing faster. The more application in the memory, the faster will be the switch between the applications. The memory leaks can be avoided by changing the context. The context is used for many operations but it is used to access the resources on android. The widgets have a context parameter in their constructors.
There are mainly two types of context: either activity or application. The program is as follows:
@Override
Protected void onCreate(Bundle state)
{
     super.onCreate(state);
     TextView label = new TextView(this);
     label.setText("Test memory leak");
     setContentView(label);
}
If the context is having leaks in it then the activity then there is a possibility of the leaks of memory. The leaking of the entire activity can be checked. The system will automatically create and destroy one of the activities by default. Android will reload the application by using the rotation policy. And it will keep the entire static field maintained.

How can we use escape characters as attributes?
Escape characters usually have backlashes before them. For instance, one can create a newline character with the use of ‘\\n’.

What is the importance of settings permissions in app development?
Permissions allow certain restrictions to be imposed primarily to protect data and code. Without these, codes could be compromised, resulting to defects in functionality.

What is a ContentProvider?
A Content Provider is part of an Android application that manages access to a repository of data.

What is the role of compatibility that is used in Android?
The compatibility is defined in terms of android compatible devices that run any application. This application is written by third party developers using the Android platform that comes in the form of SDK and NDK. There are many filters that are used to separate devices that are there to participate in the compatibility mode for the Android applications. The devices that are compatible require the android to approve it for their trademark. The devices that are not passes the compatibility are just given in the Android source code and can use the android trademark. The compatibility is a way through which the user can participate in the Android application platform. The source code is free to use and it can be used by anyone.

What are “launch modes”?
A launch mode defines how a new instance or the existing instance of an activity is associated with the current task.
The launch mode of an Activity supports four different modes:
Standard (default): Multiple instances of the activity class can be instantiated and multiple instances can be added to the same task or different tasks. This is the common mode for most of the activities.
singleTop: The difference from “standard” is, if an instance of the Activity already exists at the top of the current task and the system routes the intent to this Activity, no new instance will be created because it will fire off an onNewIntent() method instead of creating a new Activity instance.
SingleTask: A new task will always be created and a new Activity instance will be pushed to the task as the root one. However, if any activity instance exists in any tasks, the system routes the intent to that activity instance through the onNewIntent() method call. In this mode, activity instances can be pushed to the same task. Result: A certain Activity cannot exist in multiple tasks at the same time.
SingleInstance: Same as singleTask, except that the no activities instance can be pushed into the same task of the single Instance’s.

What are the different types of services?
Services are largely divided into two categories: Bound Services and Unbound/Started Services
Bound Services: An Android component may bind itself to a Service using bindservice (). A bound service would run as long as the other application components are bound to it. As soon as the components call unbindService (), the service destroys itself.
Unbound Services: A service is started when a component (like activity) calls startService () method and it runs in the background indefinitely even if the original component is destroyed.

What is the difference between AsyncTask and Thread class?
A Thread is generally used for long tasks to be run in background. We need a Handler class to use a Thread.
An AsyncTask is an intelligent Thread subclass. It’s recommended to use AsyncTask when the caller class is the UI Thread as there is no need to manipulate the handlers. AsyncTask are generally used for small tasks that can communicate back with the main UI thread using the two methods onPreExecute () and onPostExecute () it has.

What is the difference between Serializable and Parcelable?
Serializable is a Java marker interface. A class that implements this interface allows the serialization of an object from this type in certain situations.
Parcelable is an Android specific interface where you have to implement the serialization by yourself. The parcelable process is much faster than Serializable (= no need for reflection). Parcelable is always the default choice in Android.

What is a Hybrid mobile App?
Hybrid applications are web applications in native browsers. They are developed using HTML, CSS and JavaScript and then wrapped in native application.

What is Firebase?
Firebase is a mobile platform by Google to help developers develop a high-quality app and grow their base. It offers Crash reports, analytics, real-time communication and AdMob support.
Request to Download PDF

Post A Comment:

0 comments: