Following are some of the most common Android interview questions and answers
What is Android?
Android is an operating system for mobile devices.It is based on the Linux kernel.It consists of four layers:
Android is Open-source which means there is no license fee to use and develop applications for Android.It supports all the platforms, windows, mac and linux platforms.
What is Android SDK?
Android SDK is software development kit which developers can use to develop and test android applications on any device.It provides an emulator which
provides same environment as the mobile devices.So develpers can test and debug application as if it were running on the actual device.
In which language you can develop Android application?
Android applications can be developed in any of these languages:
- Java Official language of Android development
- C/C+ using using NDK
- C# using Xamarin
How Android application is packaged?
Android application is pacakged using the AAPT or Android Asset Packaging Tool.AAPT takes resource files and compiles them into APKs.
How Android applications are distributed?
Android applications are distributed using the Android Package Kit (APK).This is the format of packages used by Android for distribution of apps.
What are the options to store data in Android?
- Shared Preferences: private primitive data in key-value pairs.
- Internal Storage: private data in device memory
- External Storage: public data
- SQLite Databases: private data in SQLite database
- Network Connection: netweork server
What are some of the recent versions of Android?
|4.0||Ice Cream Sandwitch|
|4.1 to 4.3||Jelly Bean|
|5.0 to 5.1||Lollipop|
Describe lifecycle of android application?
Activity is the building block of Android application.Activity class has several different states such as Start,Stop and Destroy.These states raises different
calbacks which se can utilize to handle the state.Activity class provides six callbacks representing the different state of the activity class:
|onCreate||executed when the activity is first created|
|onStart||executed when the activity becomes visible to the user|
|onResume||When a user navigates back to the activity|
|onPause||When a user navigates to a different activity|
|onStop||When the activity is not visible|
|onDestroy||Executed before the activity is destroyed|
What is Activity?
Activity is a screen which user interacts with.Application is composed using activities.It is subclass of ContextThemeWrapper class.
What is an intent?
Intent describes an action to be performed.Intent consists of a pair of action and data.Action represents the action to be performed while data is the actual data on which the action needs to be performed.Some examples of intents are:
What is content provider?
It acts as an interface to a central repository of data.If you want to share data in your application with other applications then you will create new content provider.Content provider provides access to the data layer of the application.
What is the difference between an implicit intent and explicit intent?
Implicit: Implicit intent is used for calling the intents provided by the system.
Explicit intent for calling one activity from another activity
What is a Service?
Service is a component which is used for performing long running operations.It doesn’t have UI.A component can interact with a service through inter process communication.there are three different types of services:
What is ANR?
ANR stands for Application Not Responding and represents a dialog which is shown to the user.When a Android application is running in the foreground and it is not responding then ANR dialog is shown.User can select either wait or close app option in the dialog.
What is the AndroidManifest.xml?
Manifest file needs to be present in the root directory of every application.It helps Android to know details about your application.
What are the main components of any Android application?
Android application is developed using the following main components:
- Content Provider