Android Certification Training Course
- 64k Enrolled Learners
- Weekend
- Live Class
While both iOS and Android skills are in high demand, employers are hiring Android developers much faster and more often than any other professionals in mobile tech. In the fourth quarter of last year, Android retained its position as the largest mobile operating system worldwide, controlling the mobile OS industry with a nearly 71 percent share, while iOS accounted for approximately 28 percent of the mobile operating system market. With these numbers only expected to rise in the coming years, Android App Development Certification has emerged as one of the hottest skills in the market today!
The demand for Android developers is on a meteoric rise and the time is right to break into a career in Android development. To help you get started, we have compiled a list of frequently asked Android interview questions to help you ace the Android interviews that come your way. In case you have attended Android interviews yourself or have any questions that you want us to answer for you, do feel free to add them as comments below.
The most recent version, Android 13, was published on August 15, 2022, while the recently released Android 12.1/12L offers advancements for foldable phones, tablets, desktop-sized screens, and Chromebooks. Android is a mobile operating system developed by Google. It is based on the Linux kernel and designed primarily for touchscreen mobile devices such as smartphones and tablets. Every other Android version has been named after either sweet or desserts. The following table represents the Android name, version and the year of release.
Android Name | Version | Year of Release |
Android 1.5 | Android Cupcake | 2009 |
1.6 | Donut | 2009 |
2.0-2.1 | Eclair | 2009 |
2.2 – 2.2.3 | Froyo | 2010 |
2.3 – 2.3.7 | Gingerbread | 2010 |
3.0 – 3.2.6 | Honeycomb | 2011 |
4.0 – 4.0.4 | Ice Cream Sandwich | 2011 |
4.1 – 4.3.1 | Jelly Bean | 2012 |
4.4 – 4.4.4 | KitKat | 2013 |
5.0 – 5.1.1 | Lollipop | 2014 |
6.0 – 6.0.1 | Marshmallow | 2015 |
7.0 – 7.1.2 | Nougat | 2016 |
8.0 – 8.1 | Oreo | 2017 |
9.0 | Pie | 2018 |
An Activity is the screen representation of an application in Android.
It serves as an entry point for the user’s interaction. Each activity has a layout file where you can place your UI. An application can have different activities. For example, facebook start page where you enter your email/phone and password to login acts as an activity.
Below are the two methods which almost all subclasses of Activity will implement:
An activity is implemented as a subclass of Activity class as follows:
public class MainActivity extends Activity { }
Q3. What are the features of Android?
Google has changed the lives of everyone by launching a product that improves the mobile experience for everyone. Android helps in understanding your tastes and needs, by giving various features such as having wallpapers, themes, and launchers which completely change the look of your device’s interface.
Android has plenty of features. Some of the features are listed below:
Android architecture refers to the different layers in the Android stack. It includes your operating system, middleware, and important applications. Each layer in the architecture provides different services to the layer just above it. The four layers in the Android stack are:
For more information about Android layers, Stack and their functions in the blog post – Android Tutorial.
Java is the official programming language for Android App development. It is also possible to develop in C/ c++ language using NDK (Android Native Development). However, the major parts of Android are written in Java programming language and the APIs are also designed primarily from Java.
The APK file or Android application package is the compressed file format that is used to distribute and install application software and middleware onto Google’s Android operating system. The file has .apk extension and has all the application code, resource files, certificates, and other files, compressed in it.
User navigates between different screen or app, it goes through different states in their lifecycle. So an activity lifecycle consists of 7 different methods of android.app.Activity class i.e :
onCreate() : In this state, the activity is created.
onStart(): This callback method is called when the activity becomes visible to the user.
onResume(): The activity is in the foreground and the user can interact with it.
onPause(): Activity is partially obscured by another activity. Other activity that’s in the foreground is semi-transparent.
onStop(): The activity is completely hidden and not visible to the user.
onDestroy(): Activity is destroyed and removed from the memory.
An Intent is an “intention” to do an action. An intent is a messaging object you can use to request an action from another app component.
Methods are used to deliver intents to different components:
Implicit Intent: Implicit intent is when the target component is not defined in the intent and the android system has to evaluate the registered components based on the intent data.
Explicit Intent: Explicit intent is when an application defines the target component directly in the intent.
Implicit Intent is used whenever you are performing an action. For example, send email, SMS, dial number or you can use a Uri to specify the data type. For example:
Intent i = new Intent(ACTION_VIEW,Uri.parse("http://www.edureka.co")); startActivity(i);
Explicit, on the other hand, helps you to switch from one activity to another activity(often known as the target activity). It is also used to pass data using putExtra method and retrieved by other activity by getIntent().getExtras() methods.
For example:
Intent i = new Intent(this, Activitytwo.class); #ActivityTwo is the target component i.putExtra("Value1","This is ActivityTwo"); i.putExtra("Value2","This Value two for ActivityTwo"); startactivity(i);
Android Framework is an essential part of the Android Architecture. It is a set of APIs that allows developers to write apps and has the following components:
Services | Components that conduct long-running operations in the background, without the inclusion of a user interface. |
Intent | Objects that initiate actions from other app components, either within your program (explicit intents) or through another piece of software on the device (implicit intents). |
Activities | Components that provide users with screens on which they can interact with objects and perform actions. This is the base from which Intents can be deployed. |
Content Providers | Components that enable users to access data within an app such as audio, video, images, contact information, etc. |
Others | App widgets and Processes and Threads |
The difference between them are as follows:
The Google Android SDK is a toolset that provides a developer the API libraries and tools required to build, test, and debug apps for Android in Windows, Mac or Linux. The tools placed in Android SDk are:
Syntax:
Toast.makeText(ProjectActivity.this, "Your message here", Toast.LENGTH_LONG).show();
Android Framework is an essential part of the Android Architecture. It is a set of APIs that allows developers to write apps and has the following components:
ANR stands for ‘Application Not Responding’. This dialogue is displayed if the main thread in the application has been unresponsive for a long time and in the following conditions:
Following measures can be taken to avoid ANR:
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.
It is implemented as a subclass of BroadcastReceiver class and each message is broadcaster as an Intent object.
public class MyReceiver extends BroadcastReceiver { Public void onReceive(context,intent){} }
Bundle b=new Bundle(); b.putString("Email","[email protected]"); i.putExtras(b); // where I is intent
WebView is a view that display web pages inside your application. According to Android, “this class is the basis upon which you can roll your own web browser or simply display some online content within your Activity. It uses the WebKit rendering engine to display web pages and includes methods to navigate forward and backward through a history, zoom in and out, perform text searches and more. In order to add WebView to your application, you have to add <WebView>element to your XML layout file.
Context defines the current state of an App. Context provides access to creating new activity instance, access databases, start a service, etc. There is a base class ApplicationContext, and subclasses for components: Activity, Service.
Android offers several options to see persistent application data. They are:
No, Android does not support JAR deployments. Applications are packed into Android Package(.apk) using Android Asset Packaging Tool (APT) and then deployed on to the Android platform.
A service in android is a background process which is used to perform long-running operations. Let’s say, a service of location is active in the background while the user is in a different application. So it does not disturb the user interaction with an activity. Now, services are classified into two types, namely:
It is implemented as a subclass of Service class as follows :
public class MyService extends Service { }
A Sticky Intent is a broadcast from sendStickyBroadcast() method which floats around even after the broadcast, allowing others to collect data from it.
Manifest file plays an integral role as it provides the essential information about your app to the Android system, which the system must have before it can run any of the app’s code. Manifest file performs various tasks such as:
Structure of a manifest file: The structure of a manifest file consists of various elements such as action, activity, activity-alias and many more. Refer to the below screenshot which shows the general structure of the manifest file.
<?xml version="1.0" encoding="utf-8"?> cmanifest xmlns:android="<a class="Xx" rel="nofollow noreferrer noopener" href="https://www.google.com/url?q=http://schemas.android.com/apk/res/android&sa=D&source=hangouts&ust=1556291767429000&usg=AFQjCNH7OW4Zi9NULaQDs71WDEo-67ZouA" target="_blank" tabindex="-1" data-display="http://schemas.android.com/apk/res/android" data-sanitized="https://www.google.com/url?q=http://schemas.android.com/apk/res/android&sa=D&source=hangouts&ust=1556291767429000&usg=AFQjCNH7OW4Zi9NULaQDs71WDEo-67ZouA">http://schemas.android.com/apk/res/android" package="com.example.aayushi.myapplication"> <application android:allowBackup-"true" android:icon="@mipmap/ic_launcher android:label="My Application android: roundIcon="@mipmap/ic launcher round" android:supportsRtl="true android:theme="style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN > <category android:name="android.intent.category. LAUNCHER" /> </intent-filter> </activity> </applications </manifest>
Activity is typically a single, focused operation that a user can perform such as dial a number, take a picture, send an email, view a map etc.
Fragment is a modular section of an activity, with its own lifecycle and input events, and which can be added or removed at will. Also, a fragment’s lifecycle is directly affected by its host activity’s lifecycle i.e. when the activity is paused, so are all fragments in it, and when the activity is destroyed, so are all of its fragments.
It is not recommended to change the application after its deployment. This may break some functionality.
SQLite is the open-source relational database. The SQLite engine is serverless, transactional, and self-contained.
Instead of the typical client-server relationship of most database management systems, the SQLite engine is integrally linked with the application. The library can also be called dynamically and makes use of simple function calls that reduce latency in database access.
DDMS stands for Dalvik Debug Monitor Server. It gives the following array of debugging features:
Service | Thread |
Service is like an Activity but has no interface. | A Thread is a concurrent unit of execution. |
A Service is not a separate process. It works in background until the service or someone else explicitly stop it. | By default, all components of the same application run in the same process and thread (called the “main” thread). |
Service is not killed when an application is killed. | Thread is killed when an Application is killed. |
It expose some of its functionality to other applications by calling Context.bindService(). | GOOGLE has brought in Handlers and loopers into android threads. |
Containers, 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.
Android being an open-source platform, and considering that different Android operating systems have been released on different mobile devices, there’s no clear cut policy to how applications can adapt with various OS versions and upgrades. An app that runs on one version of Android OS may or may not run on another version.
Another disadvantage is that it can be challenging for developers to create apps that can adjust correctly to the right screen size and other varying features and specs of various Android devices.
The four essential states of activity are:
A nine-patch image, unlike bitmap, can be resized and used as background or other image sizes for the target device. The Nine-patch refers to the way you can resize the image: 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes. This is what differentiates a nine-patch image from a regular bitmap.
Android supports four dialog boxes:
APK stands for Android Packaging Kit. The Android packaging key is compressed with classes, UI’s, supportive assets and manifest. All these files are compressed to a single file which is called APK.
A sticky broadcast is used for communicating between applications. These broadcasts happen without the user being notified. The Android OS normally treats each application as if it were a separate user. Here’s an example: When you call registerReceiver() for that action — even with a null BroadcastReceiver — you get the Intent that was last broadcast for that action. Hence, you can use this to find the state of the battery without necessarily registering for all future state changes in the battery.
It is implemented as a subclass of ContentProviderclass and must implement a standard set of APIs that enable other applications to perform transactions.
public class MyContentprovider extends ContentProvider { public void onCreate(){} }
Escape characters are preceded by double backslashes. For example – a newline character is created using ‘n’.
ADB stands for Android Debug Bridge. It is a command line tool that is used to communicate with the emulator instance. ADB can control your device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.
It is a client-server program that includes three components:
• Client – which runs on your development machine. You can invoke a client from a shell by issuing an ADB command. Other Android tools such as DDMS also create ADB clients.
• Server, which runs as a background process on your development machine. The server manages communication between the client and the ADB daemon running on an emulator or device.
• Daemon, which runs as a background process on each emulator or device instance.
Sensor Manager: This class provides methods regarding the registration of sensor event listeners, the management of data acquisition, and calibration. It also provides methods for accessing and listing sensors.
Sensor: This class creates an instance of a specific sensor, providing methods that allow you to determine its capabilities.
SensorEvent: This class provides information on a sensor event by creating a sensor event object.
SensorEventListener: This interface provides two callback methods that can receive notifications of sensor events.
Orientation helps to represent the layout in a row or column.
Syntax:
<activity android name=".activity" android: screenOrientation="portrait">
AIDL stands for Android Interface Definition Language.
– It handles the interface requirements between a client and a service to communicate at the same level through interprocess communication.
– The process involves breaking down objects into primitives that are Android understandable.
Data Types:
So this brings us to the end of the Android interview questions blog. The topics that you learnt in this Android Interview Questions article are the most sought-after skill sets that recruiters look for in an Android developer. These set of Android Interview Questions will definitely help you ace your job interview. Good luck with your interview!
In case you are facing any challenges with these Android interview questions, please comment your problems in the section below. Apart from this Android Interview Questions, if you want to get trained from professionals on this technology, you can opt for a structured training from edureka!
Got a question for us? Please mention it in the comments section of “Android Interview Questions” and we will get back to you.
Course Name | Date | |
---|---|---|
Android Certification Training Course | Class Starts on 4th March,2023 4th March SAT&SUN (Weekend Batch) | View Details |
Android Certification Training Course | Class Starts on 6th May,2023 6th May SAT&SUN (Weekend Batch) | View Details |
edureka.co