Android Interview Questions and answers

Question.1   What is Android?

Answer:  Android is a stack of software for mobile devices which includes an Operating System, middleware and some key applications. The application executes within its own process and its own instance of Dalvik Virtual Machine. Many Virtual Machines run efficiently by a DVM device. DVM executes Java languages byte code which later transforms into .dex format files.

Question.2  What are the advantages of Android?

Answer:  It is simple and powerful SDK.
Licensing, Distribution or Development fee is not required. Easy to Import third party Java library. Supporting platforms are – Linux, Mac Os, Windows. Innovative products like the location-aware services, location of a nearby convenience store etc., are some of the additive facilities in Android.  Components can be reused and replaced by the application framework.  Optimized DVM for mobile devices.  SQLite enables to store the data in a structured manner. Supports GSM telephone and Bluetooth, WiFi, 3G and EDGE technologies. The development is a combination of a device emulator,debugging tools, memory profiling and plug-in for Eclipse IDE. The customer will be benefited from wide range of mobile applications to choose, since the monopoly of wireless carriers like AT&T and Orange will be broken by Google Android.

Question.3   Describe Android Application Architecture.

Answer:  Android Application Architecture has the following components:
Services – like Network Operation
Intent – To perform inter-communication between activities or services
Resource Externalization – such as strings and graphics
Notification signaling users – light, sound, icon, notification, dialog etc.
Content Providers – They share data between applications .

Question.4  What is activity?

Answer:  The building block of the user interface is the activity. They’re in a long-running conversation with the user and may remain active, even when idle, as long as the conversation continues. In terms of desktop development, an Activity is equivalent to a Form.

Question.5  Describe the APK format?

Answer:  The (Android Packaging Key) APK file is compressed format of the AndroidManifest.xml file, application code (.dex files), resource files, and other files. A project is compiled into a single .apk file.

Question.6  What are the different phases of the Activity life cycle?

Answer:   As an activity transitions from state to state, it is notified of the change by calls to the following protected methods:
1) void onCreate(Bundle savedInstanceState)
2) void onStart()
3) void onRestart()
4) void onResume()
5) void onPause()
6) void onStop()
7) void onDestroy()
Taken together, these seven methods define the entire life cycle of an activity.

Question.7  What is intent?

Answer:  A class (Intent) describes what a caller desires to do. The caller sends this intent to Android’s intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF file is an intent, and the Adobe Reader is the suitable activity for this intent.

Question.8  What is an Explicit Intent?

Answer:  In an explicit intent, we actually specify the activity that is required to respond to the intent. In other words, we explicitly designate the target component. This is typically used for application internal messages.

Question.9  What is an Implicit Intent?

Answer:  In an implicit intent, the main power of the android design, we just declare an intent and leave it to the platform to find an activity that can respond to the intent. Here, we do not declare the target component and hence is typically used for activating components of other applications seamlessly

Question.10  What is an AndroidManifest file?

Answer:  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.

Question.11  What language does Android support for application development?

Answer:  Android applications are written using the Java programming language.

Question.12  What’s the difference between a file, a class and an activity in android?

Answer:  File – It is a block of arbitrary information, or resource for storing information. It can be of any type.
Class – Its a compiled form of .Java file . Android finally used this .class files to produce an executable apk
Activity – An activity is the equivalent of a Frame/Window in GUI toolkits. It is not a file or a file type it is just a class that can be extended in Android for loading UI elements on view.

Question.13  What is the significance of the .dex files?

Answer:  Android programs are compiled into .dex (Dalvik Executable) files, which are in turn zipped into a single .apk file on the device. .dex files can be created by automatically, translating compiled applications written in the Java programming language.

Question.14   What does ADT stand for?

Answer:   ADT stands for Android Development Tools The Android SDK includes several tools and utilities to help you create, test, and debug your projects.

Question.15  What are the different tools in Android? Explain them?

Answer:    The Android SDK and Virtual Device Manager- 
It is used to create and manage Android Virtual Devices (AVD) and SDK packages. The AVD hosts an emulator running a particular build of Android, letting you specify the supported SDK version, screen resolution, amount of SD card storage available, and available hardware capabilities (such as touch screens and GPS).

The Android Emulator- 
An implementation of the Android virtual machine designed to run within a virtual device on your development computer. Use the emulator to test and debug your Android applications.

Dalvik Debug Monitoring Service (DDMS) –
Use the DDMS perspective to monitor and control the Dalvik virtual machines on which you’re debugging your applications.

Android Asset Packaging Tool (AAPT) – 
Constructs the distributable Android package files (.apk).

Android Debug Bridge,(adb) –
Android Debug Bridge, is a command-line debugging application shipped with the SDK. It provides tools to browse the device, copy tools on the device, and forward ports for debugging.

Question.16  What is the Open Handset Alliance?

Answer:  The OHA is a consortium of 84 technology and mobile companies that have joined hands to accelerate innovation in mobile technology and at the same time offer the end users a better, cost-effective and richer mobile experience. Members of this include Google, HTC, Sony, Dell, Intel, Motorola, Qualcomm, Texas Instruments, Samsung, LG, T-Mobile, Nvidia. The OHA was started on 5 November 2007 by Google and 34 other companies. Android is the main software of the alliance.

Question.17  What is ViewGroup?

Answer:   A ViewGroup is a special view that can contain other views (called children.) The view group is the base class for layouts and views containers. This class also defines the class ViewGroup.LayoutParams which serves as the base class for layouts parameters.

Question.18  What is a Service?

Answer:  A Service is an application component representing either an application’s desire to perform a longer-running operation while not interacting with the user or to supply functionality for other applications to use. Services run without a dedicated GUI, but, like Activities and Broadcast Receivers, they still execute in the main thread of the application’s process. A Service could be, facility for an application to expose some of its functionality to other applications.

Question.19  What is the difference between Service and Thread?

Answer:    Service is like an Activity but has no interface. Probably if you want to fetch the weather for example you won’t create a blank activity for it, for this you will use a Service. It is also known as Background Service because it performs tasks in background. A Thread is a concurrent unit of execution. You need to know that you cannot update UI from a Thread. You need to use a Handler for this. 

Visit Here for : Android Online Training   from Industry Experts