Interview Questions Basic Level-1

Q) What is Android?

A) Android is a stack of software for mobile devices which includes a Linux kernel, middleware and some key applications. The application executes within its own process and its own instance of Dalvik Virtual Machine or ART.

It supports many devices like mobile phone, Tv, watches, wearable devices and many electronic gadgets.

Android is an open source platform mainly managed by Google.

What are the advantages of Android?

Open-source:-Development, Distribution, Licensing fee is not required.

Platform-independent:- supporting varios platform including Linux, Mac Os, Windows

Supports various technologies(having number of native application like: camera, bluetooth, wifi, speech, EDGE)

Highly Optimized Virtual Machine

 Q) Android Architecture
 

Who is the founder of Android?

A) Andy Rubin 

Name different Android Version and API levels

Code name                  Version            API level

Oreo                              8.1                           27

Oreo                                             8.0                                       26

Nougat                           7.1                          25

Nougat                           7.0                          24

Marshmallow                   6.0                         23

Lollipop                           5.1                         22

Lollipop                           5.0                         21

KitKat                             4.4 – 4.4.4              19

Jelly Bean                       4.3.x                       18

Jelly Bean                       4.2.x                       17

Jelly Bean                       4.1.x                       16

Ice Cream Sandwich        4.0.3 – 4.0.4            15, NDK 8

Ice Cream Sandwich       4.0.1 – 4.0.2             14, NDK 7

Honeycomb                    3.2.x                        13

Honeycomb                    3.1                           12, NDK 6

Honeycomb                    3.0                           11

Gingerbread                   2.3.3 – 2.3.7             10

Gingerbread                   2.3 – 2.3.2                 9, NDK 5

Froyo                             2.2.x                         8, NDK 4

Eclair                             2.1                            7, NDK 3

Eclair                             2.0.1                         6

Eclair                             2.0                            5

Donut                            1.6                            4, NDK 2

Cupcake                         1.5                            3, NDK 1

Blender                          1.1                            2

Aestro                             1.0                            1

Main Components of Android

Activity

Services

Broadcast Receiver

Content Provider

Intent

What is an activity?

Activity is the single screen with a user interface. Every other view are embedded in an activity.

For Example,

An email app might have one activity that shows a list of new emails, another activity to compose an email, and another activity for reading emails.

What is Activity Life Cycle?

Android system provides a series of call back method for an App which is triggered on different stages of an App.

Example when an App is going to close, callback method onStop() will be called, and App can perform the desired action.

Various Call methods are

onCreate(), onStart(), onResume()

onStop(), onDestroy()

onRestart()

Read More

What is Launch Mode?

Launch mode is an instruction which specifies how the activity should be launched.

It defines a way how a new activity will associate with the current task.

What are various Launch modes?

Standard

Single Top

Single Task

Single Instance

Read More

What is Intent?

Intent is an abstract description of an operation to be performed.

It is a message passing mechanism between components (such as service, broadcast receiver, and activity) of Android, except for Content Provider.

It can be used with startActivity to launch an Activity, broadcastIntent to send it to any interested BroadcastReceiver components, and startService(Intent) or bindService(Intent, ServiceConnection, int) to communicate with a background Service.

What are the types of intent?

Implicit

Explicit

An application can define the target component directly in the intent (explicit intent) or ask the Android system to evaluate registered components based on the intent data(implicit intents).

What is an Intent filter?

The intent filter specifies the type of intent that an activity, service, broadcast receiver can respond to.

What is an Intent Resolution?

The intent resolution mechanism revolves around matching an intent against all of the <intent -filter> description in the installed application packages.

What is PendingIntent?

A pending intent is token that you give to any 3rd party App, and it allows the 3rd party App to use your app’s permission to execute a predefined piece of code.

3rd party App like AlarmManager, NotificationManager, Home Screen, WidgetManager or any other App.

What is sticky Intent?

Sticky Intents are Intents that are stick to Android System for future broadcast events. It is associated with sticky broadcasts.

For example:-
If BATTERY_LOW event occurs then that intent will be stick with android so that if any future user requested for BATTER_LOW, it will be fired.

How we can avoid this  “runtime error with: Caused by: android.content.ActivityNotFoundException: No Activity found to handle Intent”?

App crash with this exception , when there is no App to respond to given intent. This can be easily avoided by using

createChooser().

Read More about Intents

What is Bundle?

It is generally used for passing data between various activities.
It can hold any types of values.

Read more

 

What is content Provider?

Content Provider provides a way to share data with its self and to other Apps. Content providers are the standard interface that connects data in one process with code running in another process.
It provides a robust and secure data sharing model among the Apps.

Example:
Enable an App to access contacts, media files, calendar etc.

What is the Content Resolver?

It is the single, global instance of an App which provides access to your and other App’s content provider

It accepts the request from an App and resolves these requests by directing them to the content provider.

for more info

Broadcast receiver

A BroadcastReceiver is an Android component that responds to broadcast messages from the system or other applications. All registered receivers for an event are notified by the Android runtime once an event happens.

few system generated Broadcast messages are:-
charger connected, charger disconnected
Battery low, Battery Full
SMS broadcast receiver: SMS received
bluetooth broadcast receiver: Bluetooth connected/disconnected
Screen Off etc.

Read more

Q)

Q)

Q)

Q)

 

Level-2

Posted in Android and tagged , .