Thursday 14 March 2013

Frequently asked Android Interview Questions

Q.1 What is an activity?
An activity is a single screen in an application which supports Java code.

Q.2 Explain different phases of Activity Life Cycle.
Whole life cycle consist of Activity launched, Activity Running and Activity shutdown.
onCreate()
onStart()
onResume()
onPause()
onStop()
onDestroy()

Q.3 Is it true that android applications can only be programmed in Java?
No. android applications can also be programmed in C++ and C#.

Q.4 What is the architecture of Android?
On Top, Applications (Contact, Browser and phone)
Application framework (Activity Manager, Content providers, view system and package manager)
Below Application Frame work > System libraries like, webkit, SSL and OpenGL.
On Bottom, Linux Kernel (includes display and camera)

Q.5 What is APK format?
The APK file is compressed form of an elongated version which is AndroidManifest.xml, .dex files, resource files etc.

Q.6 Which virtual machine does Android runs on?
Android runs on Dalvik Virtual Machine(DVM).



Q.7 How is the nine patch image different from a regular bitmap?
Regular bitmaps are not re-sizable while nine patch allows drawing a bitmap image in nine sections.

Q.8 How to test and run android application during development?
Android app can be tested and run on emulator and/or real android phone during development. 

Q.9 Java compiled code also runs on android? Yes, how? No, Why?
No, java code compiled into bytecode by jvm but anroid code compiled into .dex format by dvm.

Q.10 What is a service in Android?
A service doesn’t have a visual user interface, instead it runs in the background for an indefinite period of time. For example, a service might play background.

Q.11 How many ways used to create the user interface in android?
There are two ways to create user interface, One is by xml and the other one is by coding.

Q.12 How does Android system track the applications on android phone?
Android system assigns each application a unique ID that is called Linux user ID. This ID is used to track each application.

Q.13 What is an Intent?
An Intent is basically a message to say something to happen. Depending on the type of intent, you can start another activity, you can make call through intent etc.

Q. 14 How many types of Intents?
There are two types of Intents. 
1. Implicit Intents
2. Explicit Intents

Q.15 What is a resource?
All Android applications contains some sort of resources,they often have the user interface layouts in the form of XML files, app related icons, strings etc are all Android resources.

Q.16 What is the difference between startActivity() and startActivityforResult()?
startActivity() is used to start another activity while startActivityforResult() starts another activity and also returns some data to the activity from which it was called.

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. This comment has been removed by a blog administrator.

    ReplyDelete