Android Apps developer

Given below are some of the important interview questions in Android Apps Development asked by the interviewers. Checkout them if you are looking for a job as Android Apps Developer.

Q.1 What is the key difference with regard to distribution of apps for android based devices than other mobile device platform applications?
Applications are distributed by multiple vendors with different policies on applications
Q.2 What is contained within the layout xml file?
The layout xml file contains orienations and layouts that specify what the display looks like.
Q.3 How is a simulator different from an emulator?
The emulator can virtualize sensors and other hardware features,while the simulator cannot.
Q.4 What is the name of the program that converts java byte code into dalvik byte code?
Dex compiler converts java byte code into dalvik byte code.
Q.5 Why Android is based on linux ?

Android is based on linux for the following reasons :

1. SECURITY

2. PORTABILITY

3. NETWORKING

Q.6 What do you understand about Android?
Android can be considered as an open-source and Linux-based operating system used in devices like mobiles, tablets, televisions.
Q.7 Describe some components of Android application architecture.

Some of the elements of Android application architecture are:

  • Firstly, Services for performing background functionalities.
  • Secon, Intent for performing the interconnection between activities and the data passing mechanism.
  • Thirdly, Resource Externalization covers strings and graphics.
  • Then, Notification which includes light, sound, icon, notification, dialog box, and toast.
  • Lastly, Content Providers help in sharing the data between applications.
Q.8 Define Activity in Android. Explain the methods implemented by subclasses of an Activity.

An Activity refers to the screen representation of an application in Android. This acts as the starting point for the user’s interaction. However, every activity consists of a layout file where you can store your UI. Further, an application can have various activities like a Facebook start page where you enter your email/phone and password for logging in can be considered as an activity. The methods which almost all subclasses of Activity will implement:

  • Firstly, onCreate(Bundle). This method performs initialization. Here you will callsetContentView(int) with a layout resource that specifies your UI.
  • Secondly, onPause(). This method interacts with the user whenever it leaves the activity. So any modifications made by the user should be carried out by the ContentProvider that holds the data.
Q.9 Explain some of the features of Android?

By introducing Android, Google has changed the lives of everyone by improving the mobile experience. Some of the major features include:

  • Firstly, it provides customizable operating System
  • There are a variety of apps that can be developed.
  • Then, it lowers down overall complexity
  • Also, it has the support of messaging services, web browser, storage(SQLite), connectivity, media, and more.
Q.10 Can we use the Java programming language for Android App development?
Yes, Java is the official programming language for Android App development. However, we can also use C/ c++ language using NDK (Android Native Development). But, the main parts of Android are written in Java programming language and the APIs are also planned primarily from Java.
Q.11 Define APK format.
The APK file or Android application package is the compacted file format that is used for distributing and installing application software and middleware onto Google’s Android operating system. The file contains .apk extension and all the application code, resource files, certificates, and other files, compressed in it.
Q.12 Describe the life cycle of android activity.
The user navigates between multiple screens or apps, it goes via different stages in their lifecycle. An activity lifecycle contains seven methods android application activity, class. This include: Firstly, onCreate(). Here, the activity is created. Secondly, onStart(). This callback method is called when the activity becomes visible to the user. Thirdly, onResume(). The activity is in the front and the user can interact with it. Next, onPause(). This activity is partially covered by another activity. Another activity that’s in the front is semi-transparent. Then, onStop(). The activity is completely hidden from the user. Lastly, onDestroy(). Activity is destroyed and eliminated from the memory.
Q.13 What are the intents in the Android?

An Intent can be defined as an “intention” for doing an action. This is basically a messaging object you can use for requesting action from another app component. However, methods are used for delivering intents to different components. They are:

  • Firstly, for starting an activity, context.startActivity().
  • Then, for starting a service, context.startService().
  • Lastly, for delivering a broadcast, context.sendBroadcast().
Q.14 Explain the various types of Intent.

There are two types of intent:

1. Implicit Intent This can be stated as to when the target component is not specified in the intent and the android system has to examine the registered components depending on the intent data.

2. Explicit Intent This can be stated as to when an application-specific the target component directly in the intent.

Q.15 Can you provide the major difference between an implicit intent and explicit intent?
Implicit Intent is used whenever you are executing an action. For example, sending an email, SMS, dialing a number or you can use a Uri for specifying the data type. And, Explicit helps you to move from one activity to another activity and can be considered as the target activity. Moreover, it is also used for passing data using the putExtra method and recovered by other activity by getIntent().getExtras() methods.
Q.16 Define File, Class, and Activity in android.
  • A file refers to a block of arbitrary information or resources for storing information.
  • A class can be considered as a compiled form of the .Java file which Android uses for producing an executable apk.
  • Lastly, activity refers to an equivalent of a Frame/Window in GUI toolkits. This cannot be considered as a file or a file type but just a class that can be expanded in Android for loading UI elements on view.
Q.17 Define Google Android SDK and tools placed in Android SDK.

The Google Android SDK refers to a toolset that provides a developer the API libraries and tools needed for building, testing, and debugging apps for Android in Windows, Mac, or Linux. However, some of the tools placed in Android SDK are:

  • Firstly, Android Emulator
  • Secondly, Dalvik Debug Monitoring Services (DDMS)
  • Thirdly, the Android Asset Packaging tool (AAPT)
  • Lastly, the Android debug bridge (ADB)
Q.18 Define Toast with syntax.
A toast notification can be considered as a message that appears on the window. This only surrounds the area of space needed for the message and here, the user’s recent activity remains visible and interactive. Further, the notification automatically fades in and out and does not accept interaction events. Basic Syntax: Toast.makeText(ProjectActivity.this, "Your message here", Toast.LENGTH_LONG).show();
Q.19 Name the various storage offered by Android.
The various storage offered by android are: External Storage Shared Preferences Internal Storage SQLite Databases Network Connection
Q.20 Define Android Framework.

Android Framework is an important part of Android Architecture. This is a set of APIs that provides developers access to write apps. This includes components like:

  • Firstly, Services for performing background functionalities. This conducts log-running operations.
  • Secondly, Intent for performing the interconnection between activities and the data passing mechanism. In this, the objects take actions from app components inside the program.
  • Thirdly, Activities include components used for providing users with screens on which they can interact with objects and perform actions.
  • Lastly, Content Providers help in sharing the data between applications. This enables users to access data inside an application like audio, video, or images.
Q.21 Name some of the languages used for building Android.
The most popular programming languages that can be used for developing applications in Android are: Java, Kotlin, C#, Python. Some other languages include C++, HTML 5. C4droid, CppDroid, AIDE, etc.
Q.22 Define a service in Android.
Service refers to an application component that allows an application to smoothly run in the background in order for performing long-running operations without user interaction. This can run continuously in the background even if the application is closed or even after the user switches to another application.
Q.23 What do you understand about Adapters in Android?
An adapter in Android acts as a bridge between an AdapterView and the underlying data for that view. The adapter grabs the data and sends the data to the adapter view. After that, the view can take the data from the adapter view and displayed the data on different views such as a spinner, list view, grid view, etc.
Q.24 Define AAPT.
AAPT stands for Android Asset Packaging Tool which is used for building tools that give the ability to developers for viewing, creating, and updating ZIP-compatible archives (zip, jar, and apk). This parses, indexes, and compiles the resources into a binary format that is optimized for the platform of Android.
Q.25 What do you understand about Android Debug Bridge(ADB)?
Android Debug Bridge can be considered as a command-line tool used for allowing and controlling the communication with an emulator instance. This provides the power for developers to perform remote shell commands for running applications on an emulator.
Q.26 Define DDMS and its features.

DDMS stands for Dalvik Debug Monitor Server which is a debugging tool in the Android platform. The features include:

  • Port forwarding services.
  • Thread and heap information.
  • Logcat.
  • Screen capture on the device.
  • Network traffic tracking.
  • Incoming calls and SMS spoofing.
  • Location data spoofing.
Q.27 Define AIDL and its data types.
AIDL stands for Android Interface Definition Language which is a tool that controls the interface requirements between a client and a service for interprocess communication(IPC) for communicating at the same level. This process involves splitting an object into primitives that are understood by the Android operating system. However, the AIDL data types are: Map CharSequence String List Java data types (int, long, char, and boolean)
Q.28 What do you understand about sensors in Android?
Android-based devices have a group of built-in sensors in them, which helps in measuring certain parameters such as motion, orientation, etc via their high accuracy. The sensors can be both hardware and software depending on nature.
Q.29 How many types of sensors are there in Android?

There are three categories of sensors in Android devices.

  • Firstly, Position Sensor - This is used for measuring the physical position of the Android device. This contains orientation sensors and magnetometers.
  • Secondly, Motion Sensors - These sensors contain gravity, rotational activity, and acceleration sensors which help in measuring the rotation of the device or the acceleration, etc.
  • Lastly, Environmental Sensor - This contains sensors that help in measuring temperature, humidity, pressure, and other environmental factors.
Q.30 Define AlertDialog and DataPickerDialog boxes on Android.
The AlertDialog supports 0-3 buttons, along with a list of selectable items like checkboxes and radio buttons. This is used when we want to ask the user about making a decision between yes or no in response to any particular action taken by the user. This process is executed while remaining in the same activity and without changing the screen. And, DatePickerDialog is used for selecting the date by the user.
Q.31 What do you understand by TimePickerDialog and ProgressDialog boxes in Android?
TimePickerDialog is used for selecting the time by the user. And, ProgressDialog can be considered as an extension of the AlertDialog which is used for displaying a progress bar. This also has the support of the addition of buttons.
Q.32 Define the AndroidManifest.xml file.

The AndroidManifest.xml file consists of information with reference to the application that the Android system must know before the codes can be executed. Further, this file is essential in every Android application and is declared in the root directory. However, it performs various tasks like:

  • Firstly, providing a unique name to the java package.
  • Secondly, explaining various elements of the application such as activity, services, etc.
  • Lastly, specifying the classes which will implement these elements.
Q.33 Why WebView is used in Android?
WebView refers to a view that displays web pages within your application. However, this class is based upon which you can roll your own web browser or simply show some online content inside your Activity. This uses the WebKit rendering engine for displaying web pages and contains methods for navigating forward and backward through a history, zoom in and out, perform text searches, and more. However, for adding WebView to your application, you have to insert the element to your XML layout file.
Q.34 What do you understand about the term context in Android?
Context specifies the present state of an Application. This provides access to build new activity instances, access databases, start a service, etc. However, there is a base class ApplicationContext, and subclasses for components: Activity and Service.
Q.35 List out the essential files and folders that are used while creating a new app.

1. App This explains the fundamental characteristics of the app and defines each of its components.

2. Java This consists of the .java source files for your project. By default, it contains a MainActivity.java source file. Under this, you create all the activities which have .java extensions and all the code behind the application. MainActivity.java is the actual file that gets transformed to a Dalvik executable and runs your app.

3. Res This is referred to as a directory for files that define your app’s user interface. You can add TextView, buttons, etc for building the GUI and using its various attributes like android:layout_width, android:layout_height, etc which are used to set its width and height.

4. Scripts This can be considered as an auto-generated file that consists of compileSdkVersion, buildToolsVersion, applicationId, minSdkVersion, targetSdkVersion, versionCode, and versionName

Q.36 When is the onStop() method call on?
A call to onStop method occurs when an activity is no longer visible to the user, either due to another activity taking over or if in front of that activity.
Q.37 Define a portable Wi-Fi hotspot.
Portable Wi-Fi Hotspot allows you to share your mobile internet connection with other wireless devices. For example, using your Android phone as a Wi-Fi hotspot, you can use your laptop for connecting to the internet using that access point.
Q.38 Define ANR in Android.
ANR stands for Application is Not Responding which can be defined as a dialog box that appears when the application is not responding. This ANR dialogue is shown whenever the main thread within an application has been unresponsive for a long time under the conditions like: Firstly, when there is no response to an input event even after 5 seconds. Secondly, when a broadcast receiver has not completed its execution within 10 seconds.
Q.39 List out some of the methods to avoid ANR.

The measures can be taken to avoid ANR:

  • Firstly, an application should execute lengthy database or networking operations in different threads to avoid ANR.
  • Secondly, for background task-intensive applications, you can minimize the pressure from the UI thread by using the IntentService.
Q.40 Explain the troubleshooting methods to perform if an application is frequently crashing.

You can perform techniques like:

1. Compatibility Check -  It is difficult to test an application for all kinds of devices and operating systems. There might be a possibility that an application is not compatible with your OS.

2. Memory Management - Some apps execute perfectly on one mobile device but might crash on other devices. Processing power, memory management, and CPU speed are considered to be an issue.

  • If there is a limited amount of memory space on mobile devices, you can free up memory space for the application for functioning properly.
  • If still an application is frequently crashing, then can delete the application’s data, which will clear its cache memory and allow some free space on your device for boosting the application’s performance.
Q.41 Name the types of launch modes in Android.

1. Standard This launch mode creates an activity’s new instance in the task from which it originated. This can create several instances for the same activity.

2. SingleTop This launch mode is the same as the Standard launch mode except if there exists an activity’s previous instance on the top of the stack, then a new instance will not be built. However, the intent will be sent to the activity’s existing instance.

3. SingleTask This launch mode will build a new task and push a new instance to the task as the root.

4. SingleInstance This launch mode is the same as the SingleTask launch mode. But the system doesn’t support launching any new activities in the same task.

Q.42 Define containers?
Containers perform operations like carrying objects and widgets together, depending on which specific items are needed and in what particular arrangement is required. They hold labels, buttons, fields, or even child containers, etc. For example, if you want a form with fields on the left and labels on the right, you will require a container. However, if you want the OK and Cancel buttons to be below the rest of the form, next to one another, and send up to the right side of the screen, you will require a container. Further, Android offers a group of view classes that act as containers for views. These container classes are known as layouts, which are defined in the form of XML files that cannot be changed by our code during execution.
Q.43 What do you understand about Dalvik in Android development?
Dalvik can be considered as a virtual machine that is responsible for running every Android application. Dalvik provides a device the ability for executing multiple instances of virtual machines efficiently via better memory management.
Q.44 Name the latest version of Android?
The latest version is Android 11.0 which was released in September 2020. Most Android versions are named after either sweet or desserts. The features in this version are: Increase in touch sensitivity. Native screen recording. Auto revokes app permission. Mute notifications during the video. Notification history.
Q.45 Define broadcast receivers with their implementation example.
A broadcast receiver refers to a mechanism used for listening to system-level events like listening for incoming calls, SMS, etc. by the host application. This is implemented as a subclass of BroadcastReceiver class and every message is broadcasted as an intent object. public class MyReceiver extends BroadcastReceiver { public void onReceive(context,intent){} }
Q.46 Differentiate between Serializable and Parcelable.

While developing applications commonly it is required for transferring data from one activity to another. This data needs to be added to a corresponding intent object. Some additional actions are needed for making the data suitable for transfer. For this, the object should be either serializable or parcelable.

  • Firstly, Serializable refers to a standard Java interface in which you simply mark a class Serializable by implementing the interface and java will automatically serialize it. In this, there is the use of reflection and many additional objects are created. This leads to many garbage collections and poor performance.
  • Secondly, Parcelable is an Android-specific interface in which you implement the serialization yourself. This does not use reflection during this process and hence no garbage is created.
  • Further, this is more efficient than Serializable since it gets around some problems with the default Java serialization scheme. And, it is faster because it is optimized for usage on the development of Android, and shows the best results.
Q.47 Define a database is used in Android?
SQLite can be considered as the open-source relational database used in Android. The SQLite engine is serverless, transactional, and also self-contained. Rather than the client-server relationship of most database management systems, the SQLite engine is integrally associated with the application. The library can be said dynamically and it can make use of simple function calls that lowers the latency in database access.
Q.48 Define Service and Thread.
Service refers to an application component that facilitates an application to run in the background in order for executing long-running operations without user interaction. However, when the application is killed, there is no effect on service. Further, it shows few functionalities to other applications by calling Context.bindService() And, a Thread is a concurrent unit of execution. When the application is killed, the thread also gets killed. Further, Google has brought in handlers and loopers into threads.
Q.49 What do you understand about the content provider?
The content provider is one of the primary building blocks of Android applications, which controls access to a central repository of data. This can be considered as a standard interface that connects data in one process with code running in another process. So it can be used for sharing the data between different applications. Further, they are responsible for encapsulating the data and providing mechanisms for defining data security. This is implemented as a subclass of ContentProviderclass and must implement a set of APIs that will allow other applications for performing transactions. public class MyContentprovider extends ContentProvider { public void onCreate(){} }
Q.50 Explain the importance of the .dex file.
Android programs are compiled into a .dex file (Dalvik Executable file) by DVM, which are then zipped into a .apk file on the device. However, .dex files are created by translating compiled applications written in java. This refers to a format that is optimized for effective storage and memory-mappable executions.
Q.51 Define compileSdkVersion and targetSdkVersion.
The compileSdkVersion is the version of API the application is compiled against. You can use the Android API features involved in that version of the API. And, the targetSdkVersion indicates that you have tested your app on (presumably up to and including) the version you define. This can be considered as a certification or sign-off you are giving the Android OS as a hint to how it should control your application in terms of OS features.
Q.52 Define JobScheduler.
The JobSchedular API is used for scheduling different types of jobs against the framework that will be executed in your app’s own process. This enables your application to execute the given task while being considerate of the device’s battery at the cost of timing control. Further, it supports batch scheduling of jobs. The Android system can join jobs for lowering battery consumption. JobManager automatically controls the network unreliability so it makes handling uploads easier. For example, Tasks that should be completed when the device is connected to a power supply. Tasks that need a Wi-Fi connection or network access. Lastly, the tasks that should execute on a regular basis as batch where the timing is not critical.
Q.53 Is it possible to change the name of an application after its deployment?
No, it is not recommended to change the application after its deployment. This may break some functionality.
Q.54 Is there any disadvantages of Android?
Android is an open-source platform and considering that different Android operating systems have been released on different mobile devices. However, there is no accurate policy on how applications can adapt to various OS versions and upgrades. An app that runs on one version of Android OS may or may not run on another version. Moreover, 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.
Q.55 Define NDK.
NDK stands for Native Development Kit which helps in developing a part of an app using native language such as C/C++ for boosting performance.
Get Govt. Certified Take Test