Android Interview Questions and Answers Set 2

11.Which dialog boxes can you use in you Android application?

AlertDialog: an alert dialog box and supports 0 to 3 buttons and a list of selectable elements. ProgressDialog: an extension of AlertDialog and you may add buttons to it. It shows a progress wheel or a progress bar. DatePickerDialog: used for selecting a date by the user. TimePickerDialog: used for selecting time by the user.

12.What are Dalvik Executable files?

Dalvik Executable files have .dex extension and are zipped into a single .apk file on the device.

13.Define Activity application component.

It is used to provide interactive screen to the users. It can contain many user interface components. A typical Android application consists of multiple activities that are loosely bound to each other. Android developer has to define a main activity that is launched on the application startup.

14.How does Android system track the applications?

Android system assigns each application a unique ID that is called Linux user ID. This ID is used to track each application.

15.An Android application needs to access device data e.g SMS messages, camera etc. At what stage user needs to grant the permissions?

Application permission must be granted by the user at install time.

16.What does ADT stand for?

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

17.How to get screen dimensions in pixels in Andorid Devices?

intscreenHeight = getResources().getDisplayMetrics().heightPixels;

intscreenWidth = getResources().getDisplayMetrics().widthPixels;

18.What is a Toast Notification?

toast notification is a message that pops up on the surface of the window. It only fills the amount of space required for the message and the user’s current activity remains visible and interactive. The notification automatically fades in and out, and does not accept interaction events.

19.What is the difference between Service and Thread?

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.

20.Which dialog boxes are supported by android?

Android supports 4 dialog boxes:

a.) AlertDialog: It supports 0 to 3 buttons and a list of selectable elements which includes radio buttons and check boxes.

b.) ProgressDialog: This dialog box is an extension of AlertDialog and supports adding buttons. It displays a progress wheel or bar.

c.) DatePickerDialog: The user can select the date using this dialog box.

d.) TimePickerDialog: The user can select the time using this dialog box.