Android Interview Questions and Answers
1. What is Android?
ANS: Android is a software stack for mobile devices that includes an operating system, middleware and key applications.
2. Why to use Android?
ANS: Android OS allows us to most electronics including laptops, head phones, Google TV etc. And also 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
3. What are the features of 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.
4. 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.
5. 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
6. Explain about the exceptions of Android ?
ANS: The following are the exceptions that are supported by Android
* Inflate Exception: 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 lock Canvas () 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.
7. How does the AOSP relate to the Android Compatibility Program?
ANS: The Android Compatibility Program is how we separate “Android compatible devices” from devices that merely run derivatives of the source code.
The function of the Android Compatibility Program is to define a baseline implementation of Android that is compatible with third-party apps written by developers. Devices that are “Android compatible” may participate in the Android ecosystem, including Android Market; devices that don’t meet the compatibility requirements exist outside that ecosystem.
8. 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 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.
9. 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.
10. What is an action?
ANS: A description of something that an Intent sender desires.
11. What is activity?
ANS: A single screen in an application, with supporting Java code.
12. What is intent?
ANS: 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.
13. What is the Android Open Source Project?
ANS: 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.
The people oversee the project and develop the actual source code. The processes refer to the tools and procedures we use to manage the development of the software. The net result is the source code that you can use to build cell phone and other devices.
14. What kind of open-source project is Android?
ANS: Google oversees the development of the core Android open-source platform, and works to create robust developer and user communities. For the most part the Android source code is licensed under the permissive Apache Software License 2.0, rather than a “copyleft” license. The main reason for this is because our most important goal is widespread adoption of the software, and we believe that the ASL2.0 license best achieves that goal.
15. 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.
16. What dialog boxes are supported in android?
ANS: Android supports 4 dialog boxes:
Alert Dialog: 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.
Progress Dialog: This dialog box displays a progress wheel or a progress bar. It is an extension of AlertDialog and supports adding buttons.
Date Picker Dialog: This dialog box is used for selecting a date by the user.
Time Picker Dialog: This dialog box is used for selecting time by the user.
17. Does Android support the Bluetooth serial port profile?
18. How does Android system track the applications?
ANS: Android system assigns each application a unique ID that is called Linux user ID. This ID is used to track each application.
19. How can two Android applications share same Linux user ID and share same VM?
ANS: The applications must sign with the same certificate in order to share same Linux user ID and share same VM.
20. Can an Android application access files or resources of another Android application?
ANS: The system sets permission on all the files/resources of an application so that they are only accessible by their own application. Other applications cannot access resources belonging to other applications unless applications sign the same certificate.