Today(23 July 2013) i attended android interview and following were the questions.
ans: 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. Explain about the exceptions of Android?
ans: The following are the exceptions that are supported by Android
i. InflateException : When an error conditions are occurred, this exception is thrown
ii. Surface.OutOfResourceException: When a surface is not created or resized, this exception is thrown
iii. SurfaceHolder.BadSurfaceTypeException: This exception is thrown from the lockCanvas() method, when invoked on a Surface whose is SURFACE_TYPE_PUSH_BUFFERS
iv. WindowManager.BadTokenException: This exception is thrown at the time of trying to add view an invalid WindowManager.LayoutParamstoken.
3. Describe the APK format.
ans: 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.
4. What is .dex extension?
ans: 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.
5. Explain the Architecture of Android ?
ans: Android Architecture is made up of 4 key components:
- Linux Kernel
- Libraries
- Android Framework
- Android Applications
- Libraries
- Android Framework
- Android Applications
6. what is services ?
ans: services is a background process it can't provide any user interaction screen . service run an long time process. even the application is switched but service can run.
7. what is an indent ?
ans: BroadcastReceiver can be registered to receive system messages and Intents. A BroadcastReceiver will get notified by the Android system, if the specified situation happens. For example a BroadcastReceiver could get called once the Android system completed the boot process or if a phone call is received.ans: services is a background process it can't provide any user interaction screen . service run an long time process. even the application is switched but service can run.
7. what is an indent ?
ans: indents are asynchronous messages, running around the inside of the device, notifying applications of various events. communication between the three core components in android activity ,services and broadcast receiver in made possible using indents .
8. what is Broadcast Receiver ?
9. What is an activity?
ans: 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.
10. What is an DDMS ?
ans: Dalvik Debug Monitor Service, a GUI debugging application shipped with the SDK. It provides screen capture, log dump, and process examination capabilities.
11. What dialog boxes are supported in android?
ans: Android supports 4 dialog boxes:
1. Alert dialog
2. Progress dialog
3.Date picker dialog
4. Time picker dialog
12. How the nine-patch Image different from a regular bitmap?
ans: A.It is one of a resizable bitmap resource which is being used as backgrounds or other images on the device. The NinePatch class allows drawing a bitmap in nine sections. The four corners are unscaled; the middle of the image is scaled in both axes, the four edges are scaled into one axis.
13. What is a resource?
ans: user defined JSON, XML, bitmap, or other file, injected into the application build process, which can later be loaded from code.
14. How will you record a phone 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.
15. Does Android support the Bluetooth serial port profile?
ans: Yes.
16. Can an application be started on powerup?
ans: Yes.
17, How many ways data stored in Android?
ans: Android supports 5 way to store data:
1.SharedPreferences
2.Internal Storage
3.External Storage
4.SQLite Database
5.Network connection
18. Types of Android applications?
ans: 1.Foreground
2.Background
3.Intermittent
4.Widget
19. Why cannot you run standard Java bytecode on Android?
ans: Android uses Dalvik Virtual Machine (DVM) which requires a special bytecode. We need 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.
20. Can you deploy executable JARs on Android? Which packaging is supported by Android?
ans: No. Android platform does not support JAR deployments. Applications are packed into Android Package (.apk) using Android Asset Packaging Tool (aapt) and then deployed on to Android platform. Google provides Android Development Tools for Eclipse that can be used to generate Android Package.
21. Android application can only be programmed in Java?
ans: False. You can program Android apps in C/C++ using NDK .