Most asked Android Interview questions and answers

A list of most commonly asked android interview questions and answers.


Also see Android questions and answers

Also see android common terms

Ques: 1 What is Android?
Ans:
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.
Ques: 2 What is an Activity?
Ans:
A single screen in an application, with supporting Java code.
Ques: 3 What is an Intent?
Ans:
A class (Intent) which describes what a caller desires to do. The caller will send this intent to Android’s intent resolver, which finds the most suitable activity for the intent. E.g. opening a PDF document is an intent, and the Adobe Reader apps will be the perfect activity for that intent (class).
Ques: 4 What is a Sticky Intent?
Ans:
sendStickyBroadcast() performs a sendBroadcast(Intent) known as sticky, i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent). One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. 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.
Ques: 5 How the nine-patch Image different from a regular bitmap? Alternatively, what is the difference between nine-patch Image vs regular Bitmap Image?
Ans:
How the nine-patch Image different from a regular bitmap? Alternatively, what is the difference between nine-patch Image vs regular Bitmap Image?
Ques: 6 What is a resource?
Ans:
A user defined JSON, XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.
Ques: 7 How will you record a phone call in Android? or How to handle an Audio Stream for a call in Android?
Ans:
Permission.PROCESS_OUTGOING_CALLS: Will Allow an application to monitor, modify, or abort outgoing calls. So using that permission we can monitor the Phone calls.
Ques: 8 Does Android support the Bluetooth serial port profile?
Ans:
Yes.
Ques: 9 Can an application be started on powerup?
Ans:
Yes
Ques: 10 What is the APK format?
Ans:
The APK file is compressed AndroidManifest.xml file with extension .apk. It also includes the application code (.dex files), resource files, and other files which are compressed into a single .apk file.
Ques: 11 How to Translate in Android?
Ans:
The Google translator translates the data of one language into another language by using XMPP to transmit data. You can type the message in English and select the language which is understood by the citizens of the country in order to reach the message to the citizens.
Ques: 12 Describe Briefly the Android Application Architecture
Ans:
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
Ques: 13 What dialog boxes are supported in android?Android supports 4 dialog boxes:
Ans:
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.
Ques: 14 What are the features of Android?
Ans:
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.
Ques: 15 What is the TTL (Time to Live)? Why is it required?
Ans:
TTL is a value in data packet of Internet Protocol. It communicates to the network router whether or not the packet should be in the network for too long or discarded. Usually, data packets might not be transmitted to their intended destination within a stipulated period of time. The TTL value is set by a system default value which is an 8-bit binary digit field in the header of the packet. The purpose of TTL is, it would specify certain time limit in seconds, for transmitting the packet header. When the time is exhausted, the packet would be discarded. Each router receives the subtracts count, when the packet is discarded, and when it becomes zero, the router detects the discarded packets and sends a message, Internet Control Message Protocol message back to the originating host.
Ques: 16 How is nine-patch image different from a regular bitmap?        
Ans:
It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes.
Ques: 17 Explain about the exceptions of Android?         
Ans:
 The following are the exceptions that are supported by Android
 InflateException : When an error conditions are occurred, this exception is thrown
 Surface.OutOfResourceException: When a surface is not created or resized, this exception is thrown
 SurfaceHolder.BadSurfaceTypeException: This exception is thrown from the lockCanvas() method, when invoked on a Surface whose is SURFACE_TYPE_PUSH_BUFFERS
 WindowManager.BadTokenException: This exception is thrown at the time of trying to add view an invalid WindowManager.LayoutParamstoken.
Ques: 18 Explain IP datagram, Fragmentation and MTU ?             
Ans:
IP datagram can be used to describe a portion of IP data. Each IP datagram has set of fields arranged in an order. The order is specific which helps to decode and read the stream easily. IP datagram has fields like Version, header length, Type of service, Total length, checksum, flag, protocol, Time to live, Identification, source and destination ip address, padding, options and payload.
MTU:- Maximum Transmission Unit is the size of the largest packet that a communication protocol can pass. The size can be fixed by some standard or decided at the time of connection
Fragmentation is a process of breaking the IP packets into smaller pieces. Fragmentation is needed when the datagram is larger than the MTU. Each fragment becomes a datagram in itself and transmitted independently from source. When received by destination they are reassembled.
Ques: 19 what is sticky intent?  
Ans:
sendStickyBroadcast() performs a sendBroadcast(Intent) known as sticky, i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver(BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent). One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. 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.
Ques: 20 What is an adb ?           
Ans:
Android Debug Bridge, 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.
Ques: 21 How is nine-patch image different from a regular bitmap?
Ans:
It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes.
Ques: 22 Describe a real time scenario where android can be used?
Ans:
magine a situation that you are in a country where no one understands the language you speak and you can not read or write. However, you have mobile phone with you.
With a mobile phone with android, the Google translator translates the data of one language into another language by using XMPP to transmit data. You can type the message in English and select the language which is understood by the citizens of the country in order to reach the message to the citizens.
Ques: 23 Are the Android releases available in a ROM? 
Ans:
No, Android is not yet available in a ROM format.
Currently Android is installed by using a clean SD Card, and booted from there.
It is booted by running a special application called ‘Haret.exe’ residing on your SD Card which will terminate the Windows kernel and boot into Linux/Android.
It can’t easily be run from ROM because a) it’s too experimental to risk putting in ROM and then killing a device and b) WinMo does some hardware initialisation that isn’t documented, but is needed before Android can run.
Ques: 24 What is the future scope of Mobile Application developers?
Ans:
Future of the mobile application development is bright
Ques: 25 How do I create a new homescreen?
Ans:
I have used up all the space on one of my homescreens and I want to add some more widgets to a new homescreen. I can’t figure out how to add a new homescreen
Ques: 26 What features are in a release?             
Ans:
Generally, it’s very difficult to detail them, unless there is a significant new feature (in which case, that will be very well advertised!). Usually it’s minor speed improvements, bug fixes etc… and sometimes, new bugs are introduced (so bear that in mind)
Ques: 27 Describe Android Application Architecture?
Ans:
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
Ques: 28 What is a Dalvik ?
Ans:
The name of Android?s virtual machine. The Dalvik VM is an interpreter-only virtual machine that executes files in the Dalvik Executable (.dex) format, a format that is optimized for efficient storage and memory-mappable execution. The virtual machine is register-based, and it can run classes compiled by a Java language compiler that have been transformed into its native format using the included ?dx? tool. The VM runs on top of Posix-compliant operating systems, which it relies on for underlying functionality (such as threading and low level memory management). The Dalvik core class library is intended to provide a familiar development base for those used to programming with Java Standard Edition, but it is geared specifically to the needs of a small mobile device.
Ques: 29 Is GSensor working?
Ans:
Yes
Ques: 30 What innovations the OHA members strive to achieve?             
 Ans:
The OHA members have endeavoured to develop Android, the open source mobile platform consisting of an OS, web browser and key applications. Different companies have different contributions to make and roles to play. For instance, the software companies like Google are developing the requisite software, the hardware companies the chipsets and the mobile companies are ensuring compatible handsets for Android.

Describe the APK format.
The APK file is compressed the AndroidManifest.xml file, application code (.dex files), resource files, and other files. A project is compiled into a single .apk file.

What is an action?
A description of something that an Intent sender desires.

What is activity?
A single screen in an application, with supporting Java code.

What is intent?
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.

How is nine-patch image different from a regular bitmap?
It is a resizable bitmap resource that can be used for backgrounds or other images on the device. The NinePatch class permits drawing a bitmap in nine sections. The four corners are unscaled; the four edges are scaled in one axis, and the middle is scaled in both axes.

What languages does Android support for application development?
Android applications are written using the Java programming language.

What is a resource?
A user-supplied XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.

How will you record a phone call in Android? How to get a handle on Audio Stream for a call in Android?
Permissions.PROCESS_OUTGOING_CALLS: Allows an application to monitor, modify, or abort outgoing calls.

What’s the difference between file, class and activity in android?
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.

What is a Sticky Intent?
sendStickyBroadcast() performs a sendBroadcast (Intent) that is “sticky,” i.e. the Intent you are sending stays around after the broadcast is complete, so that others can quickly retrieve that data through the return value of registerReceiver (BroadcastReceiver, IntentFilter). In all other ways, this behaves the same as sendBroadcast(Intent).

One example of a sticky broadcast sent via the operating system is ACTION_BATTERY_CHANGED. 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.

This entry was posted in Android, Interview Q&A and tagged . Bookmark the permalink.