Monday, December 16, 2013

Android Interview Questions and Answers

1. What is android? 

A.Android is a stack of software for mobile devices which has 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 language byte code which later
transforms into .dex format files.

 2. What are the advantages of Android?

A. The following are the advantages of Android:
* 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.
* Features like weather details, live RSS feeds, opening screen, icon on the opening screen can be customized
* 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.

3. Explain about the exceptions of Android? 

A.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
Window Manager.Layout Paramstoken.

4. Describe the APK format. 

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

5. What is .apk extension?

A.The extension for an Android package file, which typically contains all of the files related to a single Android
application. The file itself is a compressed collection of an AndroidManifest.xml file, application code (.dex
files), resource files, and other files. A project is compiled into a single .apk file.

6. What is .dex extension? 

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

 7. Explain the Architecture of Android ? 
A. Top -> Applications (Contacts, Browser, Phone, etc)
Below Applications -> Application Framework(Activity Manager, Window Manager, Content Providers, View
System, Package manager,
Telephony manager, Resource, Notification, Location managers)
Below Application Framework -> System Libraries(Like Sqlite, webkit, SSL, OpenGL, Media Framework etc)
& Android Runtime( Core Libraries and DVM).
Atlast Last -> Linux Kernel (which composed of drivers like display, camera etc.)

10. What is an activity? 
 A. A single screen in an application, with supporting Java code.
An activity presents a visual user interface for one focused endeavor the user can undertake.
For example, an activity might present a list of menu items users can choose from or it might display
photographs along with their captions.

11. What is a service? 
 A.A service doesn’t have a visual user interface, but rather runs in the background for an indefinite period of
time.
For example, a service might play background music as the user attends to other matters, or it might fetch data
over the network or calculate something and provide the result to activities that need it.Each service extends the
Service base class.
12. How to Remove Desktop icons and Widgets? 
A. Press and Hold the icon or widget. The phone will vibrate and on the bottom of the phone you will see 
anoption to remove. While still holding the icon or widget drag it to the remove button. Once remove turns red 
drop the item and it is gone 
 13. Describe a real time scenario where android can be used? 
 A .Imagine 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. 
 14. How to select more than one option from list in android xml file? ******** 
 A. Give an example. 
Specify android id, layout height and width as depicted in the following example. 
 15. What languages does Android support for application development? 
 A.Android applications are written using the Java programming language. 
16. Describe Android Application Architecture? 
 A.Android Application Architecture has the following components: 
 • Services – like N 
 • Intent – To perform inter-communication network Operation between activities or services 
 • Resource Externalization – such as strings and graphics 
 • Notification signaling users – light, sound, icon, notification, dialog etc 
 17. What is the Android Open Source Project? 
A. We use the phrase “Android Open Source Project” or “AOSP” to refer to the people, the processes, and the 
source code that make up Android.
18. Why did we open the Android source code? 
 A .Google started the Android project in response to our own experiences launching mobile apps. We wanted 
to make sure that there would always be an open platform available for carriers, OEMs, and developers to use to 
make their innovative ideas a reality. We also wanted to make sure that there was no central point of failure, so 
that no single industry player could restrict or control the innovations of any other. The single most important 
goal of the Android Open-Source Project (AOSP) is to make sure that the open-source Android software is 
implemented as widely and compatibly as possible, to everyone’s benefit. 

19. What is the Guardian app for Android? 
 A.The Guardian app for Android delivers all the best content from guardian.co.uk to your phone or tablet. Read 
the latest news, sport, comment and reviews, watch video, listen to brodcasts and browse stunning picture 
galleries while on the move. 

20. What features does it have? 
 A .- Navigate by section, topic or contributor 
 - Download your homepage and favourites for offline reading with the touch of a button, or schedule a 
daily download for a time that suits you 
- Browse our award-winning audio and video content 
- Save contributors, topics and sections to your favourites folder 
- Add favourites to your home screen with an expanded view or link 
- Swipe through stunning full-screen picture galleries 
- Share articles and galleries via the Android share function 
- View content in portrait or landscape orientation 
21. Will it work on my phone? 
 A.The app will work on all phones and tablets running Android version 1.6 and above. 
 22. How much does it cost? 
 A.The app is free and ad-supported. 
 23. How do I save the app to my SD card? 
 A. From the device's Settings menu, go to Applications > Manage applications > The Guardian. Under the data 
header, choose "Move to SD card". 
 24. How do I add sections to my favourites? 
 A. It is possible to add sections, topics and contributors to your favourites. You can add to favourites by 
tapping the star icon in the top right hand corner of the relevant screens, or on the right hand side of the headers 
in the all sections menu. 

25. How do I remove sections from my favourites? 
 A. From the favourites menu, tap the red icons to the left hand side of the items. Alternatively, tap the star icon 
in the top right hand corner of the relevant screen so that it returns to its white state. 
 26. What is Mono for Android? 
 A. Mono for Android is a software development kit that allows developers to use the C# language to create 
mobile applications for Android-based devices.Mono for Android exposes two sets of APIs, the core .NET APIs 
that C# developers are familiar with as well as a C# binding to Android's native APIs exposed through the 
Mono.Android.* namespace.You can use Mono for Android to develop applications that are distributed through 
the Android Application Stores or to deploy software to your personal hardware or the Android simulator. 

27. What is included in Mono for Android? 
 A. Mono for Android consists of the core Mono runtime, the Mono for Android bindings to the native Android 
APIs, a Visual Studio 2010 plugin to develop Android applications and an SDK that contains the tools to build, 
debug and deploy your applicationsOur Visual Studio 2010 plugin allows developers to use Visual Studio 2010 
to develop, debug and deploy their applications to an Android simulator, an Android device, or the Android 
Application Store. 
Our MonoDevelop IDE also ships an addin to support Mono for Android development. 

28. What do I need to develop Mono for Android applications? 
 A. Mono for Android on Windows provides a plugin for Visual Studio 2010 Professional or better. We also 
support Mono for Android development using MonoDevelop on Windows for users that do not own a copy of 
Visual Studio 2010 Professional or better.Mono for Android on Mac developers can use MonoDevelop.On all 
platforms, Mono for Android requires the Android SDK (which requires Java JDK). 
29. Will my users need to install Mono? 
 A. No, When you deploy your application to the app store the Mono mobile runtime is statically linked to your 
application. No additional dependancies are needed. From the users point of view, there is no difference 
between an application created in Java and an application created using Mono for Android, other than a slightly 
larger (~4.4MB) application size. 

30. Where is the UI Designer? 
 A. Mono for Android does not bundle a UI designer to create the UI XML files We do not provide an 
integrated UI designer in Mono for Android 1.0. No decisions past that have been made. We will be listening 
to user feedback to decide where to put resources for the future versions. 

31. How is Mono for Android licensed? 
A. Mono for Android is a commercial/proprietary offering that is built on top of the open source Mono project 
and is licensed on a per-developer basis. 
32. What is the API profile exposed by Mono for Android? 
A. Mono for Android uses the same API profile for the core libraries as MonoTouch.Specifically, MonoTouch 
and Mono for Android both support a Silverlight-based API, without Silverlight's UI libraries (e.g. no XML, no 
WindowsBase.dll, etc.), and free of the sandboxing limitations of Silverlight. 
33. Are the Android releases available in a ROM? 
A. 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 
initialization that isn't documented, but is needed before Android can run. 

34. When will it be available in a ROM? 
 A. No time soon. Folks are working on it, but you'll need a lot of patience before it (if ever) arrives 
 35. How do I turn off, or reboot Android? 
 A. In earlier releases, you had to pull the battery or press the reset button, in newer releases, you can hold down 
the 'end call' button and see a menu. 
36. Should we jump in to Android? What’s the guarantee that’s what I will see on a phone? Will service 
providers turn off things? 
A. Keep in mind it hasn’t shipped yet, this is the most interesting time. Once it is open source, it could be 
locked down… they could create a derivative work. 
We’re going to provide a piece of technology that tests the APIs. No time frame yet. The script will exercise the 
system. It’s a compatibility test suite, to make sure nothing got disabled or broken by accident, and also ensure 
that apps will work across OEMs. 
 
37. What if my app uses location API, and service provider shuts that off, can they? 
A. They can do that… it’s not a perfect world. Rather than having us dictate what carriers and OEMs support, 
we let developers develop killer apps that will require it. 
We want to ensure all the application development that goes on for Android… we want to give OEMs an 
incentive to keep things open. It’s a positive, self fulfilling vision.