Android interview questions
Hi Everyone in the Article we Learn Android interview questions for Android Developer. Android question for Fresher and Experience to help to get a job. As an Android interview question.
1) What is Android?
Android is an open-sourced operating system that is used primarily on mobile devices, such as cell phones and tablets. It is a Linux kernel-based OS that’s been equipped with rich components that allow developers to create and run apps that can perform both basic and advanced functions.
2) What Is the Google Android SDK?
The Google Android SDK is a toolset that developers need in order to write apps on Android enabled devices. It contains a graphical interface that emulates an Android driven handheld environment, allowing them to test and debug their codes.
3) What is the Android Architecture?
Android Architecture is made up of 4 key components:
- Linux Kernel
- Libraries
- Android Framework
- Android Applications
4) Describe the Android Framework.
The Android Framework is an important aspect of Android Architecture. Here you can find all the classes and methods that developers would need in order to write applications on the Android environment.
5) What is AAPT?
AAPT is short for Android Asset Packaging Tool. This tool provides developers with the ability to deal with zip-compatible archives, which includes creating, extracting as well as viewing its contents.
6) What is the importance of having an emulator within the Android environment?
The emulator lets developers “play” around an interface that acts as if it were an actual mobile device. They can write and test codes, and even debug. Emulators are a safe place for testing codes especially if it is in the early design phase.
7) What is the use of an activityCreator?
An activityCreator is the first step towards the creation of a new Android project. It is made up of a shell script that will be used to create a new file system structure necessary for writing codes within the Android IDE.
8 ) Describe Activities.
Activities are what you refer to as the window to a user interface. Just as you create windows in order to display output or to ask for an input in the form of dialog boxes, activities play the same role, though it may not always be in the form of a user interface.
9) What are Intents?
Intents display notification messages to the user from within the Android enabled device. It can be used to alert the user of a particular state that occurred. Users can be made to respond to intents.
10) Differentiate Activities from Services.
Activities can be closed, or terminated anytime the user wishes. On the other hand, services are designed to run behind the scenes, and can act independently. Most services run continuously, regardless of whether there are certain or no activities being executed.
11) What items are important in every Android project?
These are the essential items that are present each time an Android project is created:
- AndroidManifest.xml
- build.xml
- bin/
- src/
- res/
- assets/
12) What is the importance of XML-based layouts?
The use of XML-based layouts provides a consistent and somewhat standard means of setting GUI definition format. In common practice, layout details are placed in XML files while other items are placed in source files.
13) What are containers?
Containers, as the name itself implies, holds objects and widgets together, depending on which specific items are needed and in what particular arrangement that is wanted. Containers may hold labels, fields, buttons, or even child containers, as examples.
14) What is Orientation?
Orientation, which can be set using setOrientation(), dictates if the LinearLayout is represented as a row or as a column. Values are set as either HORIZONTAL or VERTICAL
15) What is ADB?
ADB is short for Android Debug Bridge. It allows developers the power to execute remote shell commands. Its basic function is to allow and control communication towards and from the emulator port.
16) What are the four essential states of an activity?
- Active – if the activity is in the foreground
- Paused – if the activity is in the background and still visible
- Stopped – if the activity is not visible and therefore is hidden or obscured by another activity
- Destroyed – when the activity process is killed or completed terminated
17) What is ANR?
ANR is short for Application Not Responding. This is actually a dialog that appears to the user whenever an application has been unresponsive for a long period of time.
18) What are the advantages of Android?
Open-source: It means no license, distribution, and development fee.
Platform-independent: It supports Windows, Mac, and Linux platforms.
Supports various technologies: It supports camera, Bluetooth, wifi, speech, EDGE etc. technologies.
Highly optimized Virtual Machine: Android uses a highly optimized virtual machine for mobile devices, called DVM (Dalvik Virtual Machine).
19) Does android support other languages than java?
Yes, an android app can be developed in C/C++ also using android NDK (Native Development Kit). It makes performance faster. It should be used with the Android SDK.
20) What are the core building blocks of android?
The core building blocks of Android are:
- Activity
- View
- Intent
- Service
- Content Provider
- Fragment etc.
21) What is an activity in Android?
Activity is like a frame or window in java that represents GUI. It represents one screen of android.
22) What are the life cycle methods of android activity?
There are 7 life-cycle methods of activity. They are as follows:
- onCreate()
- onStart()
- onResume()
- onPause()
- onStop()
- onRestart()
- onDestroy()
23) What is intent?
It is a kind of message or information that is passed to the components. It is used to launch an activity, display a web page, send SMS, send emails, etc. There are two types of intents in android:
- Implicit Intent
- Explicit Intent
24) How are view elements identified in the android program?
View elements can be identified using the keyword findViewById.
25) Define Android toast.
An android toast provides feedback to the users about the operation being performed by them. It displays the message regarding the status of the operation initiated by the user.
26) Explain the use of ‘bundle’ in android?
We use bundles to pass the required data to various subfolders.
27) What is an application resource file?
The files which can be injected for the building up of a process are called an application resource file.
28) What is the use of LINUX ID in android?
A unique Linux ID is assigned to each application in android. It is used for the tracking of a process.
29) Can the bytecode be written in java be run on android?
No
30) List the various storages that are provided by Android.
The various storage provided by android are:
- Shared Preferences
- Internal Storage
- External Storage
- SQLite Databases
- Network Connection
31) How are layouts placed in Android?
Layouts in Android are placed as XML files.
32) What is the implicit intent in android?
The Implicit intent is used to invoke the system components.
33) What is explicit intent in android?
An explicit intent is used to invoke the activity class.
34) How to call another activity in android?
- Intent i = new Intent(getApplicationContext(), ActivityTwo.class);
- startActivity(i);
35) What is service in android?
A service is a component that runs in the background. It is used to play music, handle network transactions, etc.
36) What is the name of the database used in android?
SQLite: An opensource and lightweight relational database for mobile devices.
37) What is a content provider?
A content provider is used to share information between Android applications.
38) What is a fragment?
The fragment is a part of Activity by which we can display multiple screens on one activity.
39) What is NDK?
NDK stands for the Native Development Kit. By using NDK, you can develop a part of an app using a native language such as C/C++ to boost the performance.
40) What is ANR?
ANR stands for Application Not Responding. It is a dialog box that appears if the application is no longer responding.
41) What is an APK format?
APK is a short form that stands for Android Packaging Key. It is a compressed key with classes, UI’s, supportive assets, and manifest. All files are compressed to a single file is called APK.
42) Which language does Android support to develop an application?
Android applications are written by using the java (Android SDK) and C/C++ (Android NDK).
43) What is ADT in Android?
ADT stands for Android Development Tool. It is used to develop the applications and test the applications.
44) What is View Group in Android?
View Group is a collection of views and other child views. It is an invisible part and the base class for layouts.
45) What is the Adapter in Android?
An adapter is used to create a child view to present the parent view items.
46) What is the nine-patch images tool in Android?
We can change bitmap images into nine sections with four corners, four edges, and an axis.
47) Which kernel is used in Android?
Android is a customized Linux 3.6 kernel.
48) What is application Widgets in Android?
Application widgets are miniature application views that can be embedded in other applications and receive periodic updates.
49) Which types of flags are used to run an application on Android?
Following are two types of flags to run an application in Android:
- FLAG_ACTIVITY_NEW_TASK
- FLAG_ACTIVITY_CLEAR_TOP
50) What is a singleton class in Android?
A singleton class is a class that can create only an object that can be shared by all other classes.
51) What is sleep mode in Android?
In sleep mode, the CPU is slept and doesn’t accept any commands from the android device except the Radio interface layer and alarm.
52) What do you mean by a drawable folder in Android?
In Android, a drawable folder is compiled a visual resource that can use as a background, banners, icons, splash screen, etc
53) What is DDMS?
DDMS stands for Dalvik Debug Monitor Server. It gives a wide array of debugging features:
- Port forwarding services
- Screen capture
- Thread and heap information
- Network traffic tracking
- Location data spoofing
54) Define Android Architecture?
The Android architecture consists of 4 components:
- Linux Kernal
- Libraries
- Android Framework
- Android Applications
55) What is a portable wi-fi hotspot?
The portable wi-fi hotspot is used to share the internet connection with other wireless devices.
56) Name the dialog box which is supported by Android?
- Alert Dialog
- Progress Dialog
- Date Picker Dialog
- Time picker Dialog
57) Name some exceptions in Android?
- Inflate Exception
- Surface.OutOfResourceException
- SurfaceHolder.BadSurfaceTypeException
- WindowManager.BadTokenException
58) What are the basic tools used to develop an Android app?
- JDK
- Eclipse+ADT plugin
- SDK Tools