A Linux-based open-source OS, Android was created by Andy Rubin and became one of the most popular smartphone operating systems. With 71 percent of the market share worldwide, Android is on top. Because it is on top in the smartphone OS, Android development is always in demand.
If you are seeking a job in Android development, then this interview preparation guide is the right place for you. Here we have listed the top 50 50 Android interview questions and answers for beginners, as well as SDE I to SDE III.
For a complete roadmap to mastering Android development with Kotlin and acing your interviews, the Android Mastery with Kotlin: Beginner to Advanced course provides detailed lessons and practical projects to showcase your skills.
Most Asked Android Interview Questions in 2024
1. What is Android and the latest version of Android?
Android is an operating system that is built basically for Mobile phones. It is based on the Linux Kernel and other open-source software and is developed by Google. It is used for touchscreen mobile devices such as smartphones and tablets. But nowadays these are used in Android Auto cars, TV, watches, cameras, etc. It has been one of the best-selling OS for smartphones. Android OS was developed by Android Inc.
The latest version of Android is Android 14 (API level 34) and the initial stable release date is October 4, 2023.
To read more, refer to the article: Introduction to Android
2. What’s Activity in Android?
Activity class is one of the very important parts of the Android component. Any app, no matter how small it is (in terms of code and scalability), has at least one Activity class. Unlike most programming languages, in which the main() method is the entry point for that program or application to start its execution, the Android operating system initiates the code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle. So it can be said that An activity is the entry point for interacting with the user.
To read more, refer to the article: Introduction to Activities in Android
3. Why is XML used for frontend development in Android?
XML stands for Extensible Markup Language. XML is a markup language much like HTML used to describe data. XML itself is well readable both by humans and machines. Also, it is scalable and simple to develop. In Android, we use XML for designing our layouts because XML is a lightweight language, so it doesn’t make our layout heavy.
4. What are the components of the Android Application?
There are some necessary building blocks that an Android application consists of. These loosely coupled components are bound by the application manifest file which contains the description of each component and how they interact. The four main components of Android applications are:
- Activities
- Services
- Content Providers
- Broadcast Receiver
- Intents
To read more, refer to the article: Components of an Android Application
5. What is the Dalvik Virtual Machine?
DVM is a virtual machine to execute Android applications. The Java bytecode(.class file) generated by the javac compiler is converted into Dalvik bytecode to make the application source files executable on the DVM. Since Android devices have a definite processing capacity, memory, and battery life, the DVM design principle aims to optimize itself so that it can load fastly and run smoothly even on low memory/powered devices. This virtual machine is very efficient in running multiple instances on the same device.
To read more, refer to the article: DVM
6. What are the differences between Dalvik and ART?
|
Dalvik Virtual Machine
|
Android Run Time
|
| Faster Booting time |
Rebooting is significantly longer |
| Cache builds up overtime |
The cache is built during the first boot |
| Occupies less space due to JIT |
Consumes a lot of storage space internally due to AOT |
| Works best for small storage devices |
Works best for Large storage devices |
| Stable and tested virtual machine |
Experimental and new – not much app support comparatively |
| Longer app loading time |
Extremely Faster and smoother Faster and app loading time and lower processor usage |
Uses JIT compiler (JIT: Just-In-Time) Thereby resulting in lower storage space consumption |
Uses AOT compiler(Ahead-Of-Time) thereby compiling apps when installed |
| Application lagging due to garbage collector pauses and JIT |
Reduced application lagging and better user experience |
| App installation time is comparatively lower as the compilation is performed later |
App installation time is longer as compilation is done during installation |
| DVM converts bytecode every time you launch a specific app. |
ART converts it just once at the time of app installation. That makes CPU execution easier.
Improved battery life due to faster execution.
|
To read more, refer to the article: Difference Between Dalvik and ART in Android
7. How does an Android App Work?
Developing an Android application involves several processes that happen sequentially. After writing the source code files, when developers click the Run button on the Android studio, plenty of operations and processes start at the backend.
- Building the APK File
- Code Compilation
- Conversion into Dalvik bytecodes
- Generating .apk file
- App Distribution
- Deploy the Application
- Establish the ADB Server
- Transfer .apk file to the Device
- Run the Application
- App launch request
- Conversion of the .dex code to native OAT format
To read more, refer to the article: How Does Android App Work?

Android Interview Questions and Answers
8. What is Toast in Android?
A Toast is a short alert message shown on the Android screen for a short interval of time. Android Toast is a short popup notification that is used to display information when we perform any operation in our app. It disappears automatically. If the user wants a permanently visible message, then a notification can be used.
To read more, refer to the article: Toast
9. What’s Service in Android?
Services in Android are a special component that facilitates an application to run in the background in order to perform long-running operation tasks. The prime aim of a service is to ensure that the application remains active in the background so that the user can operate multiple applications at the same time. A user interface is not desirable for Android services as it is designed to operate long-running processes without any user intervention. A service can run continuously in the background even if the application is closed or the user switches to another application.
To read more, refer to the article: Services in Android
10. What’s Content Provider in Android?
In Android, Content Providers are a very important component that serves the purpose of a relational database to store the data of applications. The role of the content provider in the Android system is like a central repository in which data of the applications are stored, and it facilitates other applications to securely access and modify that data based on the user requirements. The Android system allows the content provider to store the application data in several ways. Users can manage to store the application data like images, audio, videos, and personal contact information by storing them in SQLite Database, in files, or even on a network.
To read more, refer to the article: Content Providers in Android
11. What’s Broadcast Receiver in Android?
Broadcast in Android is the system-wide event that can occur when the device starts, when a message is received on the device, when incoming calls are received, or when a device goes to airplane mode, etc. Broadcast Receivers are used to respond to these system-wide events. Broadcast Receivers allow us to register for the system and application events, and when that event happens, then the registered receivers get notified. There are mainly two types of Broadcast Receivers:
- Static Broadcast Receivers: These types of Receivers are declared in the manifest file and work even if the app is closed.
- Dynamic Broadcast Receivers: These types of receivers work only if the app is active or minimized.
To read more, refer to the article: Broadcast Receiver in Android
12. What’s Gradle and write down its usage in Android?
Gradle is a build system (open source) that is used to automate building, testing, deployment, etc. “Build.gradle” are scripts where one can automate the tasks. For example, the simple task to copy some files from one directory to another can be performed by Gradle build script before the actual build process happens.
Usage: Every Android project needs a Gradle for generating an apk from the .java and .xml files in the project. Simply put, a Gradle takes all the source files (java and XML) and applies appropriate tools, e.g., converts the java files into dex files and compresses all of them into a single file known as apk that is actually used.
To read more, refer to the articles: build.gradle file, Introduction to Gradle
13. What’s Fragment in Android?
In Android, the fragment is the part of Activity that represents a portion of the User Interface(UI) on the screen. It is the modular section of the Android activity that is very helpful in creating UI designs that are flexible in nature and auto-adjustable based on the device screen size. There are mainly 3 types of fragments:
- Single Fragment
- List Fragment
- Fragment Transaction
To read more, refer to the article: Introduction to Fragments
14. What’s RecyclerView in Android & How it works?
RecyclerView is a ViewGroup added to the Android Studio as a successor of the GridView and ListView. It is an improvement on both of them. It has been created to make possible construction of any lists with XML layouts as an item that can be customized vastly while improving the efficiency of ListViews and GridViews. This improvement is achieved by recycling the views which are out of the visibility of the user. For example, if a user scrolled down to a position where items 4 and 5 are visible; items 1, 2, and 3 would be cleared from the memory to reduce memory consumption.
To read more, refer to the article: RecyclerView in Android with Example
15. What’s the Difference Between Intent and Intent filters?
An Intent is an object passed to Context.startActivity(), Context.startService() or Activity.startActivityForResult() etc. to launch an activity or get an existing activity to do something new. On the other hand, an Intent filter describes the capability of the component(like activities, services, and broadcast receivers).
To read more, refer to the article: Difference Between Implicit Intent and Explicit Intent in Android
16. What is the AndroidManifest.xml?
Every project in Android includes a manifest file, which is AndroidManifest.xml, stored in the root directory of its project hierarchy. The manifest file is an important part of our app because it defines the structure and metadata of our application, its components, and its requirements. This file includes nodes for each of the Activities, Services, Content Providers, and Broadcast Receivers that make the application and using Intent Filters and Permissions determines how they coordinate with each other and other applications. The manifest file also specifies the application metadata, which includes its icon, version number, themes, etc., and additional top-level nodes can specify any required permissions, unit tests, and define hardware, screen, or platform requirements.
To read more, refer to the article: The Application Manifest File
17. What’s Android SDK and its Components?
Android SDK stands for Android Software Development Kit which is developed by Google for Android Platform. With the help of Android SDK, we can create Android Apps easily. Android SDK is a collection of libraries and Software Development tools that are essential for Developing Android Applications. Whenever Google releases a new version or update of Android Software, a corresponding SDK also releases with it. In the updated or new version of SDK, some more features are included which are not present in the previous version. Android SDK consists of some tools which are very essential for the development of Android Application. These tools provide a smooth flow of the development process from developing and debugging. Android SDK is compatible with all operating systems such as Windows, Linux, macOS, etc.
Components:
- Android SDK Build tool.
- Android Emulator.
- Android SDK Platform-tools.
- Android SDK Tools.
To read more, refer to the article: Android SDK and its Components
18. Disadvantages of Android
- Fragmentation provides a very intuitive approach for user experience, but it has some drawbacks, where the development team needs time to adjust with the various screen sizes of mobile smartphones that are now available in the market and invoke the particular features in the application.
- The Android devices might vary broadly. So the testing of the application becomes more difficult.
- As the development and testing consume more time, the cost of the application may increase, depending on the application’s complexity and features.
19. Explain the Activity Lifecycle in brief.
These are the different stages of the Activity Lifecycle:

- onCreate(): It is called when the activity is first created. This is where all the static work is done like creating views, binding data to lists, etc.
- onStart(): It is invoked when the activity is visible to the user. It is followed by onResume() if the activity is invoked from the background.
- onRestart(): It is invoked after the activity has been stopped and prior to its starting stage and thus is always followed by onStart() when any activity is revived from background to on the screen.
- onResume(): It is invoked when the activity starts interacting with the user. At this point, the activity is at the top of the activity stack, with a user interacting with it.
- onPause(): It is invoked when an activity is going into the background but has not yet been killed. It is a counterpart to onResume()
- onStop(): It is invoked when the activity is not visible to the user. It is followed by onRestart() when the activity is revoked from the background, followed by onDestroy() when the activity is closed or finished, and nothing when the activity remains on the background only.
- onDestroy(): The final call received before the activity is destroyed. This can happen either because the activity is finished (when finish() is invoked) or because the system is temporarily destroying this instance of the activity to save space.
To read more, refer to the article: Activity Lifecycle in Android with Demo App
20. Why do we need to call setContentView() in onCreate() of Activity class?
The reason for doingso is that the activity life cycle onCreate() method is called only once. And this is the big reason we need to call the setContentView() in onCreate(). And it will be inefficient to call this function in onResume(), onStart(), and somewhere else because those methods are called more than once.
21. Explain the Fragment Lifecycle in Brief.
These are the different stages of the Activity Lifecycle:
| Methods |
Description
|
| onAttach() |
The very first method to be called when the fragment has been associated with the activity. This method executes only once during the lifetime of a fragment. |
| onCreate() |
This method initializes the fragment by adding all the required attributes and components. |
| onCreateView() |
System calls this method to create the user interface of the fragment. The root of the fragment’s layout is returned as the View component by this method to draw the UI. |
| onActivityCreated() |
It indicates that the activity has been created in which the fragment exists. View hierarchy of the fragment also instantiated before this function call. |
| onStart() |
The system invokes this method to make the fragment visible on the user’s device. |
| onResume() |
This method is called to make the visible fragment interactive. |
| onPause() |
It indicates that the user is leaving the fragment. System calls this method to commit the changes made to the fragment. |
| onStop() |
Method to terminate the functioning and visibility of fragments from the user’s screen. |
| onDestroyView() |
System calls this method to clean up all kinds of resources as well as view hierarchy associated with the fragment. |
| onDestroy() |
It is called to perform the final clean-up of the fragment’s state and its lifecycle. |
| onDetach() |
The system executes this method to disassociate the fragment from its host activity. |
To read more, refer to the article: Fragment Lifecycle in Android
22. What is the difference between a Fragment and an Activity?
|
Activity
|
Fragment
|
| Activity is an application component that gives a user interface where the user can interact. |
The fragment is only part of an activity, it basically contributes its UI to that activity. |
| Activity is not dependent on fragment |
Fragment is dependent on activity. It can’t exist independently. |
| we need to mention all activity it in the manifest.xml file |
Fragment is not required to mention in the manifest file |
| We can’t create multi-screen UI without using fragment in an activity, |
After using multiple fragments in a single activity, we can create a multi-screen UI. |
| Activity can exist without a Fragment |
Fragment cannot be used without an Activity. |
| Creating a project using only Activity then it’s difficult to manage |
While Using fragments in the project, the project structure will be good and we can handle it easily. |
| Lifecycle methods are hosted by the OS. The activity has its own life cycle. |
Lifecycle methods in fragments are hosted by hosting the activity. |
| Activity is not light weight. |
The fragment is the lite weight. |
To read more, refer to the article: Difference Between a Fragment and an Activity in Android
23. What’s Context in Android?
The context in Android can be understood as something which gives us the context of the current state of our application. We can break the context and its use into three major points:
- It allows us to access resources.
- It allows us to interact with other Android components by sending messages.
- It gives you information about your app environment.
There are mainly two types of context available in Android.
- Application Context and
- Activity Context
To read more, refer to the article: What is Context in Android?
24. Top Image Loading Libraries in Android.
- Picasso
- Glide
- Fresco
- COIL (Coroutine Image Loader)
- UIL (Universal Image Loader)
To read more, refer to the article: Top Image Loading Libraries in Android
25. What is View in Android?
The view is a class that represents the basic building block for UI components. A View occupies a rectangular area on the screen and is responsible for drawing and event handling. It is a superclass for all the UI components. The most common UI components are:
- TextView
- EditText
- ImageView
- Button
- ProgressBar
- CheckBox, etc.
26. Difference Between View and ViewGroup in Android
|
View
|
ViewGroup
|
| View is a simple rectangle box that responds to the user’s actions. |
ViewGroup is the invisible container. It holds View and ViewGroup |
| View is the SuperClass of All component like TextView, EditText, ListView, etc |
ViewGroup is a collection of Views(TextView, EditText, ListView, etc..), somewhat like a container. |
| A View object is a component of the user interface (UI) like a button or a text box, and it’s also called a widget. |
A ViewGroup object is a layout, that is, a container of other ViewGroup objects (layouts) and View objects (widgets) |
| Examples are EditText, Button, CheckBox, etc. |
For example, LinearLayout is the ViewGroup that contains Button(View), and other Layouts also. |
| View refers to the android.view.View class |
ViewGroup refers to the android.view.ViewGroup class |
| android.view.View which is the base class of all UI classes. |
ViewGroup is the base class for Layouts. |
To read more, refer to the article: Difference Between View and ViewGroup in Android
27. What is Kotlin Coroutine on Android?
The Kotlin team defines coroutines as “lightweight threads”. They are sort of tasks that the actual threads can execute. Kotlin coroutines introduce a new style of concurrency that can be used on Android to simplify async code. The official documentation says that coroutines are lightweight threads. By lightweight, it means that creating coroutines doesn’t allocate new threads. Instead, they use predefined thread pools and smart scheduling for the purpose of which task to execute next and which tasks later.
To read more, refer to the article: Kotlin Coroutines on Android
28. How Garbage Collector Works in Android?
Garbage Collector in Android has no compacting. This means the address of objects in the heap never changed after their creation. So garbage collection can be triggered when an allocation fails when an
- OutOfMemoryError is about to be triggered,
- When the size of the heap hits some soft limit, and
- When a GC was explicitly requested.
29. Describe the architecture of your last app.
When developers work on a real mobile application whose nature is dynamic and will expand its features according to the user’s need, then it is not possible to write core logic in activities or fragments. To structure the project’s code and to give it a modular design(separated code parts), architecture patterns are applied to separate the concerns. The most popular Android architectures used by developers are the following:
- MVC (Model — View — Controller)
- MVP (Model — View — Presenter)
- MVVM (Model — View — ViewModel)
So you have to tell the architecture of the last app you have developed during the college time project or in a real industry project.
To read more, refer to the article: Android Architecture Patterns
30. MVC vs MVP vs MVVM architecture and which one we should choose?
|
MVC(MODEL VIEW CONTROLLER)
|
MVP(MODEL VIEW PRESENTER)
|
MVVM(MODEL VIEW VIEWMODEL)
|
| One of the oldest software architecture |
Developed as the second iteration of software architecture which is advanced from MVC. |
Industry-recognized architecture pattern for applications. |
| UI(View) and data-access mechanism(Model) are tightly coupled. |
It resolves the problem of having a dependent View by using Presenter as a communication channel between Model and View. |
This architecture pattern is more event-driven as it uses data binding and thus makes easy separation of core business logic from the View. |
| Controller and View exist with the one-to-many relationship. One Controller can select a different view based upon the required operation. |
A one-to-one relationship exists between Presenter and View as one Presenter class manages one View at a time. |
Multiple View can be mapped with a single ViewModel and thus, the one-to-many relationship exists between View and ViewModel. |
Which one should we choose?
- MVC: Ideal for small-scale projects only.
- MVP: Ideal for simple and complex applications.
- MVVM: Ideal for big-scale projects. But not ideal for small-scale projects.
To read more, refer to the article: Difference Between MVC, MVP and MVVM Architecture Pattern in Android
31. How to Reduce APK size in Android?
- Remove unused sources
- Use of Vector Drawables
- Reuse your code
- Compress PNG and JPEG files
- Use of Lint
- Use images in WebP file format
- Use of proguard
- Use of ShrinkResources
- Limit the usage of external libraries
- Use the Android Size Analyzer tool
- Generate App Bundles instead of APK
- Use of Resconfigs
To read more, refer to the article: How to Reduce APK Size in Android?
32. What’s the Android jetpack and its Key Benefits?
Jetpack is nothing but a set of software components, libraries, tools, and guidance to help in developing great Android apps. Google launched Android Jetpack in 2018. Key Benefits of Android Jetpack
- Forms a recommended way for app architecture through its components
- Eliminate boilerplate code
- Simplify complex task
- Provide backward compatibility as libraries like support are unbundled from Android API and are re-packaged to androidx.* package
- Inbuilt productivity feature of the Kotlin Integration
To read more, refer to the article: Introduction to Android Jetpack
33. What are the different software components of Android Jetpack?
The software components of Android Jetpack has been divided into 4 categories:
- Foundation Components: AppCompat, Android KTX, Test, Multidex
- Architecture Components: Room, WorkManager, Lifecycle, ViewModel, Paging, Navigation
- Behavior Components: DownloadManager, Permissions, Sharing, Slices
- UI Components: Animation & Transition, Auto, Fragment, Palette, Layout
34. What’s Jetpack Compose and its Benefits?
Jetpack Compose is a modern UI toolkit recently launched by Google which is used for building native Android UI. It simplifies and accelerates the UI development with less code, Kotlin APIs, and powerful tools.
- Declarative
- Compatible
- Increase development speed
- Concise and Idiomatic Kotlin
- Easy to maintain
- Written in Kotlin
To read more, refer to the article: Jetpack Compose in Android
35. What are the Architecture Components of Android?
Architecture Components could be classified as follows:
- Room
- WorkManager
- Lifecycle
- ViewModel
- LiveData
- Navigation
- Paging
- Data Binding
To read more, refer to the article: Jetpack Architecture Components in Android
36. How to Improve RecyclerView Scrolling Performance in Android?
- Set a specific width and height to ImageView in RecyclerView items
- Avoid using NestedView
- Use the setHasFixedsize method
- Use the image loading library for loading images
- Do less work in the OnBindViewHolder method
- Use the NotifyItem method for your RecyclerView
To read more, refer to the article: How to Improve RecyclerView Scrolling Performance in Android?
37. Volley Library in Android
Volley is an HTTP library that makes networking very easy and fast, for Android apps. It was developed by Google and introduced during Google I/O 2013. It was developed because there is an absence in Android SDK, of a networking class capable of working without interfering with the user experience. Although Volley is a part of the Android Open Source Project(AOSP), Google announced in January 2017 that Volley will move to a standalone library. It manages the processing and caching of network requests, and it saves developers valuable time from writing the same network call/cache code again and again.
To read more, refer to the article: Volley Library in Android
38. What’s Retrofit in Android?
Retrofit is a type-safe REST client built by square for Android and Java which intends to make it simpler to expand RESTful web services. Retrofit uses OkHttp as the system’s administration layer and is based on it. Retrofit naturally serializes the JSON reaction utilizing a POJO (PlainOldJavaObject) which must be characterized as cutting edge for the JSON Structure. To serialize JSON we require a converter to change it into Gson first. Retrofit is much simpler than other libraries; we don’t have to parse our JSON. It directly returns objects but there is one disadvantage: it doesn’t provide support to load images from the server, but we can use Picasso for the same.
To read more, refer to the article: Introduction to Retrofit
39. Describe MVVM
Model — View — ViewModel (MVVM) is the industry-recognized software architecture pattern that overcomes all drawbacks of MVP and MVC design patterns. MVVM suggests separating the data presentation logic(Views or UI) from the core business logic part of the application.
The separate code layers of MVVM are:
- Model: This layer is responsible for the abstraction of the data sources. Model and ViewModel work together to get and save the data.
- View: The purpose of this layer is to inform the ViewModel about the user’s action. This layer observes the ViewModel and does not contain any kind of application logic.
- ViewModel: It exposes those data streams which are relevant to the View. Moreover, it serves as a link between the Model and the View.
To read more, refer to the article: MVVM (Model View ViewModel) Architecture Pattern in Android
40. What are the reasons your Android app is legging?
- You are doing too much on the main thread
- Your asset files are huge
- You are using an outdated SDK version
- You are using bad libraries
- The speed of the network
- Chatty conversations
- Your code is inefficient
To read more, refer to the article: What are the reasons your android app is legging?
41. What is AIDL?
On Android what happens with the processors is one process can’t normally access the memory of another process. So in order to interact they need to decompose their objects into primitives that the OS can understand and gather the objects across that boundary. The code to do that gathering is very complex to write, so Android handles it with AIDL. So generally AIDL is similar to the other IDLs and it allows to define the programming interface that both the client and service agree upon in order to interact with each other using interprocess communication (IPC).
42. What is ANR and How can it be Prevented in Android?
ANR stands for Application Not Responding. An ANR will occur if you’re running a process on the UI thread which takes an extended time, usually around 5 seconds. During this point, the GUI (Graphical User Interface) will lock up which can end in anything the user presses won’t be actioned. After the 5 seconds approx. has occurred, if the thread still hasn’t recovered then an ANR dialogue box is shown informing the user that the appliance isn’t responding and can give the user the choice to either wait, in the hope that the app will eventually recover, or to force close the app.
Stop doing heavy tasks on the main thread. Instead, use worker threads such as IntentService, AsyncTask Handler, or another Thread simply. Detecting where ANRs happen is straightforward if it’s a permanent block (deadlock acquiring some locks for instance), but harder if it’s just a short-lived delay. First, re-evaluate your code and appearance for vulnerable spots and long-running operations.
To read more, refer to the article: What is ANR and How it Can be Prevented in Android?
43. What is Android NDK and why is it useful?
The NDK (Native Development Kit) is a tool that allows you to program in C/C++ for Android devices. It provides platform libraries one can use to manage native activities and access physical device components, such as sensors and touch input. NDK can be useful for cases in which you need to do one or more of the following:
- Squeeze extra performance out of a device to achieve low latency or run computationally intensive applications, such as games or physics simulations.
- Reuse your own or other developers’ C or C++ libraries.
44. Explain the JUnit test in brief.
JUnit is a “Unit Testing” framework for Java Applications which is already included by default in Android studio. It is an automation framework for Unit as well as UI Testing. It contains annotations such as @Test, @Before, @After, etc. Here we will be using only @Test annotation to keep the article easy to understand.
To read more, refer to the article: Unit Testing in Android using JUnit
45. What’s Dagger and When to use Dagger?
Dagger is a Dependency Injection framework that will generate a lot of boilerplate code for you to achieve the goal of Dependency injection in Android development. Not that one must have a good understanding of Dependency Injection before answering this question.
When to use a dagger?
|
Project Size
|
Small
|
Medium
|
Large
|
|
Tool to use
|
Manual DI Service Locator Dagger
|
Dagger
|
Dagger
|
46. What’s LiveData in Android Architecture Component and its Advantages?
LiveData component is an observable data holder class i.e, the contained value can be observed. LiveData is a lifecycle-aware component and thus it performs its functions according to the lifecycle state of other application components. Further, if the observer’s lifecycle state is active i.e., either STARTED or RESUMED, only then LiveData updates the app component. LiveData always checks the observer’s state before making any update to ensure that the observer must be active to receive it. If the observer’s lifecycle state is destroyed, LiveData is capable of removing it, and thus it avoids memory leaks. It makes the task of data synchronization easier.
Advantages of LiveData component:
- UI is updated as per the appropriate change in the data
- It removes the stopped or destroyed activities which reduce the chance of app crash
- No memory leaks as LiveData is a lifecycle-aware component.
To read more, refer to the article: Jetpack Architecture Components in Android
47. What’s Data Binding in Android?
Data Binding library is a support library that provides the feature of binding UI components in an activity/fragment to the data sources of the application. The library carries out this binding task in a declarative format and not in a programmatic way. Below is an example to understand the working of this library accurately:
To find a TextView widget and bind it to the userName property of the ViewModel variable, the findViewById() method is called:
TextView textView = findViewById(R.id.sample_text);
textView.setText(viewModel.getUserName());
After using the Data Binding library, the above code changes by using the assignment expression as follows:
<TextView
android:text=”@{viewmodel.userName}” />
Advantages of Data Binding Component:
- Make code simpler and easy to maintain by removing UI frameworks called in the activity.
- Allows classes and methods to observe changes in data
- Allows to make objects and fill which works as collection observables.
To read more, refer to the article: Jetpack Architecture Components in Android
48. Room in Android Architecture Component.
The requirement of a database in Android is fulfilled by SQLite from the very beginning. However, it comes with some severe drawbacks like not checking the queries at compile-time, it does not save plain-old-Java Objects(commonly referred to as POJOs). Developers also need to write a lot of boilerplate code to make the SQLite database work in the Android OS environment. The Room component comes into the picture as an SQLite Object Mapping Library which overcomes all the mentioned challenges. Room converts queries directly into objects, checks errors in queries at the compile-time, and is also capable of persisting the Java POJOs.
Moreover, it produces LiveData results/observables from the given query result. Because of this versatile nature of the Room component, Google officially supports and recommends developers to use it. The Room consists of the following sub-components:
- Entity: It is the annotated class for which the Room creates a table within the database. The field of the class represents columns in the table.
- DAO(Data Access Object): It is responsible for defining the methods to access the database and to perform operations.
- Database: It is an abstract class that extends RoomDatabase class and it serves as the main access point to the underlying app’s relational data.
To read more, refer to the article: Jetpack Architecture Components in Android
49. ViewModel in Android.
ViewModel is one of the most critical classes of the Android Jetpack Architecture Component that support data for UI components. Its purpose is to hold and manage the UI-related data. Moreover, its main function is to maintain the integrity and allows data to be serviced during configuration changes like screen rotations. Any kind of configuration change in Android devices tends to recreate the whole activity of the application. It means the data will be lost if it has not been saved and restored properly from the activity which was destroyed. To avoid these issues, it is recommended to store all UI data in the ViewModel instead of an activity.
To read more, refer to the article: Jetpack Architecture Components in Android
50. What’s Android KTX?
KTX library is the only one among the foundation components which was introduced for the first time with the release of the Jetpack. Android KTX is a collection of Kotlin extensions that are designed to facilitate developers to remove boilerplate code as well as to write concise code while developing Android applications with Kotlin language. Here KTX in the name stands for Kotlin Extensions. Below is an example of a piece of code without using and after using the Android KTX library:
Code snippet of SQLite without using KTX library:
db.beginTransaction()
try {
// insert data
db.setTransactionSuccessful()
}
finally {
db.endTransaction()
}
Above code after using KTX library:
db.transaction {
// insert data
}
To read more, refer to the article: Foundation Components of Android Jetpack
Conclusion
Android development is in high demand as the platform leads the global smartphone market. Preparing for interviews is key to success, and this guide of 50 essential Android interview questions covers everything you need. Whether you’re a beginner or experienced developer, this resource will help you confidently tackle interviews and secure your dream role.
Get 90% fee refund on completing 90% course in 90 days! Take the Three 90 Challenge today.
After successfully processing refunds worth over INR 5 Cr, GeeksforGeeks is back with the Three 90 challenge and this is your chance to upskill and get 90% refund. What more motivation do you need? Start the challenge right away!
Similar Reads
Android Tutorial
In this Android Tutorial, we cover both basic and advanced concepts. So whether you are a fresher (graduate) or an experienced candidate with several years of Android Development experience, you can follow this Android tutorial to kick-start your journey in Android app development. Our Android Tutor
15+ min read
Basics
Introduction to Android Development
Android operating system is the largest installed base among various mobile platforms across the globe. Hundreds of millions of mobile devices are powered by Android in more than 190 countries of the world. It conquered around 71% of the global market share by the end of 2021, and this trend is grow
5 min read
History of Android
Android devices form a very essential part of a huge section of mobile phone users in today's world. With the global turmoil in the COVID-19 eras, the population has now entered a digital sphere. Android is the most used OS in smartphones during these days of transformation. But when did something l
15+ min read
Best Way to Become Android Developer – A Complete Roadmap
Android is an open-source operating system, based on the Linux kernel and used in mobile devices like smartphones, tablets, etc. Further, it was developed for smartwatches and Android TV. Each of them has a specialized interface. Android has been one of the best-selling OS for smartphones. Android O
7 min read
Basic Prerequisites of Learning Android App Development
This day's craze of learning any technology is very high among students and Android development is one of the technologies. Nowadays almost everyone has a smartphone so the percentage of people using apps is high these days. So Android app development is an OnDemand technology. Students are also sho
7 min read
Android App Development Fundamentals for Beginners
Android is an operating system that is built basically for Mobile phones. It is based on the Linux Kernel and other open-source software and is developed by Google. It is used for touchscreen mobile devices such as smartphones and tablets. But nowadays these are used in Android Auto cars, TV, watche
6 min read
Android Architecture
Android architecture contains a different number of components to support any Android device's needs. Android software contains an open-source Linux Kernel having a collection of a number of C/C++ libraries which are exposed through application framework services. Among all the components Linux Kern
5 min read
Android System Architecture
The Android software stack generally consists of a Linux kernel and a collection of C/C++ libraries that are exposed through an application framework that provides services, and management of the applications and run time. Linux KernelAndroid was created on the open-source kernel of Linux. One main
3 min read
Android Boot Process
Booting Process In computing, booting is starting up a computer or computer appliance until it can be used. It can be initiated by hardware such as a button press, or by software command. After the power is switched on the computer is relatively dumb, and can read only part of its storage called Rea
4 min read
Difference between Java and Kotlin in Android with Examples
Kotlin KOTLIN is a cross platform, statically types, general purpose programming language with type inference. KOTLIN is designed to interoperate fully with java but type inference allows its syntax to be more concise.KOTLIN is sponsored by JetBrains and Google through the Kotlin Foundation. Java JA
3 min read
Interesting Facts About Android
Android is a Mobile Operating System that was released on 23, September 2008. Android is free, open-source operating system and is based on modified version of Linux kernel. Open Handset Alliance (OHA) developed the Android and Google commercially sponsored it. It is mainly designed for touchscreen
3 min read
Software Setup and Configuration
Android Studio Tutorial
It is stated that "If you give me six hours to chop down a tree then I will spend the first four hours in sharpening the axe". So in the Android Development World if we consider Android Development as the tree then Android Studio should be the axe. Yes, if you are starting Android Development then y
9 min read
File Structure & Components
Core Topics
How Does Android App Work?
Developing an android application involves several processes that happen in a sequential manner. After writing the source code files, when developers click the Run button on the Android studio, plenty of operations and process starts at the backend. Every operation happening in the background is a c
7 min read
Activity Lifecycle in Android with Demo App
In Android, an activity is referred to as one screen in an application. It is very similar to a single window of any desktop application. An Android app consists of one or more screens or activities. Each activity goes through various stages or a lifecycle and is managed by activity stacks. So when
9 min read
Introduction to Gradle
Gradle is an excellent open-source construction tool that is capable of the development of any kind of software. This tool was developed by a gaggle of developers named Hans Dockter, Szczepan Faber Adam Murdoch, Luke Daley, Peter Niederwieser, Daz DeBoer, and Rene Gröschkebefore 13 years before. It
8 min read
What is Context in Android?
Android Applications are popular for a long time and it is evolving to a greater level as users' expectations are that they need to view the data that they want in an easier smoother view. Hence, the android developers must know the important terminologies before developing the app. In Android Progr
9 min read
Bundle in Android with Example
It is known that Intents are used in Android to pass to the data from one activity to another. But there is one another way, that can be used to pass the data from one activity to another in a better way and less code space ie by using Bundles in Android. Android Bundles are generally used for passi
6 min read
Activity State Changes In Android with Example
Prerequisites: Activity lifecycle in android As it is known that every Android app has at least one activity associated with it. When the application begins to execute and runs, there are various state changes that activity goes through. Different events some user-triggered and some system triggered
6 min read
Processes and Application Lifecycle in Android
As an android developer, if one does not know the application lifecycle of android application or does not have in-depth knowledge about it, there are very high chances that the application will not have a good user experience. Not having proper knowledge of the application lifecycle will not affect
7 min read
Desugaring in Android
Google has officially announced Kotlin as a recommended language for Android Development and that's why so many developers are switching from Java to Kotlin for Android development. So day by day new APIs are been introduced in Android by the Google Team and which are available in newer versions of
4 min read
Difference Between AndroidX and Android Support Libraries
Support library packages in Android are a set of code libraries whose prime purpose is to provide backward-compatibility to the code and Android API framework. In the real world, there is a strong possibility that an application that is developed on the latest Android version is used on an older ver
3 min read
Memory Leaks in Android
A memory leak is basically a failure of releasing unused objects from the memory. As a developer one does not need to think about memory allocation, memory deallocation, and garbage collection. All of these are the automatic process that the garbage collector does by itself, but the situation become
7 min read
Layout & View
Layouts in Android UI Design
Layout Managers (or simply layouts) are said to be extensions of the ViewGroup class. They are used to set the position of child Views within the UI we are building. We can nest the layouts, and therefore we can create arbitrarily complex UIs using a combination of layouts. There is a number of layo
2 min read
Android UI Layouts
Layouts in Android is used to define the user interface that holds the UI controls or widgets that will appear on the screen of an android application or activity screen. Generally, every application is a combination of View and ViewGroup. As we know, an android application contains a large number o
5 min read
LinearLayout and its Important Attributes with Examples in Android
LinearLayout is the most basic layout in android studio, that aligns all the children sequentially either in a horizontal manner or a vertical manner by specifying the android:orientation attribute. If one applies android:orientation="vertical" then elements will be arranged one after another in a v
3 min read
Android LinearLayout in Kotlin
Android LinearLayout is a ViewGroup subclass, used to provide child View elements one by one either in a particular direction either horizontally or vertically based on the orientation property. We can specify the linear layout orientation using the android:orientation attribute. All the child eleme
2 min read
Android RelativeLayout in Kotlin
Android RelativeLayout is a ViewGroup subclass, used to specify the position of child View elements relative to each other like (A to the right of B) or relative to the parent (fixed to the top of the parent). Instead of using LinearLayout, we have to use RelativeLayout to design the user interface
4 min read
ConstraintLayout in Android
ConstraintLayout is similar to that of other View Groups which we have seen in Android such as RelativeLayout, LinearLayout, and many more. In this article, we will take a look at using ConstraintLayout in Android. Important Attributes of ConstraintLayout Attributes Description android:id This is u
5 min read
TextView widget in Android using Java with Examples
Widget refers to the elements of the UI (User Interface) that help the user interact with the Android App. TextView is one of many such widgets which can be used to improve the UI of the app. TextView refers to the widget which displays some text on the screen based on the layout, size, colour, etc
4 min read
TextView in Kotlin
Android TextView is simply a view that are used to display the text to the user and optionally allow us to modify or edit it. First of all, open Kotlin project in Android Studio. Following steps are used to create TextView in Kotlin: Add a TextView in activity_main.xml file inside LinearLayout. Add
4 min read
Working With the TextView in Android
TextView in Android is one of the basic and important UI elements. This plays a very important role in the UI experience and depends on how the information is displayed to the user. This TextView widget in Android can be dynamized in various contexts. For example, if the important part of the inform
7 min read
Autosizing TextView in Android
If the user is giving the input and the input needs to be shown as TextView and if the user inputs the stuff which can go out of the screen, then in this case the font TextView should be decreased gradually. So, in this article, it has been discussed how the developer can reduce the size of TextView
6 min read
Intent and Intent Filters
What is Intent in Android?
In Android, it is quite usual for users to witness a jump from one application to another as a part of the whole process, for example, searching for a location on the browser and witnessing a direct jump into Google Maps or receiving payment links in Messages Application (SMS) and on clicking jumpin
4 min read
Implicit and Explicit Intents in Android with Examples
Pre-requisites: Android App Development Fundamentals for Beginners Guide to Install and Set up Android Studio Android | Starting with the first app/android project Android | Running your first Android app This article aims to tell about the Implicit and Explicit intents and how to use them in an and
7 min read
How to Send Data From One Activity to Second Activity in Android?
This article aims to tell and show how to "Send the data from one activity to second activity using Intent" . In this example, we have two activities, activity_first which are the source activity, and activity_second which is the destination activity. We can send the data using the putExtra() method
7 min read
How to open dialer in Android through Intent?
The phone dialer is an activity available with the Android operating system to call a number. Usually, such activity may or may not have an EditText, for taking the number as input, and a Call button. When the user presses the Call button, it invokes the dialer app activity. Use of 'tel:' prefix is
4 min read
Creating Multiple Screen Applications in Android
This article shows how to create an android application to move from one activity to another. Below are the steps for Creating a Simple Android Application to move from one activity to another activity. Step By Step ImplementationStep 1: Create a New Project in Android StudioTo create a new project
9 min read
How to Open Camera Through Intent and Display Captured Image in Android?
Pre-requisites: Android App Development Fundamentals for Beginners Guide to Install and Set up Android Studio Android | Starting with first app/android project Android | Running your first Android app The purpose of this article is to show how to open a Camera from inside an App and click the image
5 min read
Toast & RecyclerView
Toasts for Android Studio
A toast provides a simple popup message that is displayed on the current activity UI screen (e.g. Main Activity). Example: Syntax: // to get Context Context context = getApplicationContext(); // message to display String text = "Toast message"; // toast time duration, can also set manual value in
2 min read
What is Toast and How to Use it in Android with Examples?
Pre-requisites: Android App Development Fundamentals for BeginnersGuide to Install and Set up Android StudioAndroid | Starting with the first app/android projectAndroid | Running your first Android appWhat is Toast in Android? A Toast is a feedback message. It takes a very little space for displayin
6 min read
Android Toast in Kotlin
A Toast is a short alert message shown on the Android screen for a short interval of time. Android Toast is a short popup notification which is used to display information when we perform any operation in our app. In this tutorial, we shall not just limit ourselves by creating a lame toast but also
4 min read
Android | How to Change Toast font?
A Toast is a feedback message. It takes a very little space for displaying while overall activity is interactive and visible to the user. It disappears after a few seconds. It disappears automatically. If user wants permanent visible message, Notification can be used. Toast disappears automatically
3 min read
How to add a custom styled Toast in Android
A Toast is a feedback message. It takes very little space for displaying and it is displayed on top of the main content of an activity, and only remains visible for a short time period. This article explains how to create Custom Toast messages, which has custom background, image, icon, etc, which ar
3 min read
RecyclerView in Android with Example
RecyclerView is a ViewGroup added to the android studio as a successor of the GridView and ListView. It is an improvement on both of them and can be found in the latest v-7 support packages. It has been created to make possible construction of any lists with XML layouts as an item which can be custo
5 min read
Android | Horizontal RecyclerView with Examples
Recycler View is a ViewGroup added to Android Studio as a successor of the GridView and ListView. It is an improvement on both of them and can be found in the latest v-7 support packages. It has been created to make possible construction of any lists with XML layouts as an item which can be customiz
4 min read
How to create a nested RecyclerView in Android
A nested RecyclerView is an implementation of a RecyclerView within a RecyclerView. An example of such a layout can be seen in a variety of apps such as the Play Store, where the outer (parent) RecyclerView is of vertical orientation, whereas the inner (child) RecyclerViews are of horizontal orienta
6 min read
How to Create RecyclerView with Multiple ViewType in Android?
RecyclerView forms a crucial part of the UI in Android app development. It is especially important to optimize memory consumption when displaying a long list of items. A RecyclerView inflates a customized list of items, which can have either similar layouts or multiple distinct layouts. Here, we dev
6 min read
RecyclerView using ListView in Android With Example
RecyclerView is a more flexible and advanced version of ListView and GridView. RecyclerView is used for providing a limited window to a large data set, which means it is used to display a large amount of data that can be scrolled very efficiently by maintaining a limited number of Views. In Recycler
6 min read
Fragments & Adapters
Introduction to Fragments | Android
Fragment is a piece of an activity that enables a more modular activity design. A fragment encapsulates functionality so that it is easier to reuse within activities and layouts. Android devices exist in a variety of screen sizes and densities. Fragments simplify the reuse of components in different
5 min read
Fragment Lifecycle in Android
In Android, the fragment is the part of the Activity that represents a portion of the User Interface(UI) on the screen. It is the modular section of the Android activity that is very helpful in creating UI designs that are flexible in nature and auto-adjustable based on the device screen size. The U
8 min read
How to Create a New Fragment in Android Studio?
Android Studio is the official integrated development environment for Google's Android operating system, built on JetBrains' IntelliJ IDEA software and designed specifically for Android development. You can Develop Android App using this. Here, We are going to learn how to create a new Fragment in A
2 min read
How to Create Swipe Navigation in Android?
When talking about Android Apps, the first thing that comes to mind is variety. There are so many varieties of Android apps providing the user with a beautiful dynamic UI. One such feature is to navigate our Android Apps using left and right swipes as opposed to clicking on buttons. Not only does it
6 min read
ViewPager Using Fragments in Android with Example
ViewPager is a layout manager that allows the user to flip left and right through pages of data. It is mostly found in apps like Youtube, Snapchat where the user shifts right - left to switch to a screen. Instead of using activities fragments are used. It is also used to guide the user through the a
7 min read
ArrayAdapter in Android with Example
The Adapter acts as a bridge between the UI Component and the Data Source. It converts data from the data sources into view items that can be displayed into the UI Component. Data Source can be Arrays, HashMap, Database, etc. and UI Components can be ListView, GridView, Spinner, etc. ArrayAdapter is
3 min read
SimpleAdapter in Android with Example
In Android, whenever we want to bind some data which we get from any data source (e.g. ArrayList, HashMap, SQLite, etc.) with a UI component(e.g. ListView, GridView, etc.) then Adapter comes into the picture. Basically Adapter acts as a bridge between the UI component and data sources. Here Simple A
7 min read
SimpleExpandableListAdapter in Android with Example
Android ExpandableListView is a view that shows items as a vertically scrolling two-level list. The basic difference with ListView is that it allows two levels of the display, which can be easily expanded and collapsed by touching to view and their respective children's items. To show the view, Expa
8 min read
AdapterViewFlipper in Android with Example
The AdapterViewFlipper class is a subclass of the ViewAnimator class and is used to flip between 2 or more views, such that only one view is displayed at a time. It is commonly used in slides. It is an element of the transition widget which helps to add transitions on the views. It is mainly useful
4 min read
BaseExpandableListAdapter in Android with Example
In many android apps, the developer may need to show multi-data for huge main data items. i.e. as per our example, under "Programming languages", we need to show "Python", "Java" etc., and under "Relational database" we need to show "Oracle", "MySQL' etc., For that purpose, we can use "BaseExpandabl
9 min read
UI Component & Image Loading Libraries
Spinner in Android with Example
Android Spinner is a view similar to the dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it. The default value of the android spinner will be the c
4 min read
Spinner in Kotlin
Android Spinner is a view similar to a dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it. The default value of the android spinner will be the cur
3 min read
Dynamic Spinner in Kotlin
Android Spinner is a view similar to dropdown list which is used to select one option from the list of options. It provides an easy way to select one item from the list of items and it shows a dropdown list of all values when we click on it. Default value of the android spinner will be currently sel
3 min read
How to add Custom Spinner in android?
Spinner is a widget that is used to select an item from a list of items. When the user tap on a spinner a drop-down menu is visible to the user. In this article, we will learn how to add custom spinner in the app. If you want to know more about spinner in detail then click on this link. Approach: Cr
4 min read
How to Create an Alert Dialog Box in Android?
Alert Dialog shows the Alert message and gives the answer in the form of yes or no. Alert Dialog displays the message to warn you and then according to your response, the next step is processed. Android Alert Dialog is built with the use of three fields: Title, Message area, and Action Button. Alert
4 min read
How to Create a Custom AlertDialog in Android?
Sometimes in AlertDialog, there is a need to get input from the user or customize it according to our requirements. So we create custom AlertDialogs. This post will show how to customize the AlertDialogs and take input from it. Below is the step-by-step implementation of the above approach: Step 1:
2 min read
Top 5 Image Loading Libraries in Android
Android is an operating system which is built basically for Mobile phones. It is based on the Linux Kernel and other open-source software and is developed by Google. It is used for touchscreen mobile devices like smartphones and tablets. But nowadays these are utilized in Android Auto cars, TV, watc
5 min read
How to Use Picasso Image Loader Library in Android?
Picasso is open source and one of the widely used image download libraries in Android. It is created and maintained by Square. It is among the powerful image download and caching library for Android. Picasso simplifies the process of loading images from external URLs and displays them on your applic
6 min read
How to Use Glide Image Loader Library in Android Apps?
Glide, like Picasso, can load and display images from many sources, while also taking care of caching and keeping a low memory impact when doing image manipulations. Official Google apps (like the app for Google I/O 2015) are using Glide. In this article, we're going to explore the functionalities o
4 min read
Fresco Image Loading Library in Android with Example
Fresco is one of the famous image loading libraries from URLs in Android. It is a powerful library for displaying and managing images from URLs. This library can load images from Users' devices, servers, and other local sources. The most important feature of this library is to show a placeholder ima
3 min read
Material Design & Bars
Introduction to Material Design in Android
Material Design Components (MDC Android) offers designers and developers a way to implement Material Design in their Android application. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Androi
5 min read
Responsive UI Design in Android
Nowadays every Android UI designer is very serious about his UI design. The path of every project goes through UI design. UI design is the face of every project and every website, app & desktop application. UI is the wall between the User & Back-end where users can interact with the server t
4 min read
Material Design EditText in Android with Example
EditText is one of the important UI elements. Edittext refers to the widget that displays an empty text field in which a user can enter the required text and this text is further used inside the application. In this article it has been discussed to implement the special type of text fields, those ar
5 min read
Theming of Material Design EditText in Android with Example
Prerequisite: Material Design EditText in Android with Examples In the previous article Material Design EditText in Android with Examples Material design Text Fields offers more customization and makes the user experience better than the normal text fields. For example, Icon to clear the entire Edit
4 min read
Key Properties of Material Design EditText in Android
In the previous article Material Design EditText in Android with Examples its been discussed how to implement the Material design EditText and how they differ from the normal EditText. In this article its been discussed on how to customize MDC edit text fields with their key properties. Have a look
4 min read
How to Use Material Text Input Layout in Android?
Material Design Components (MDC Android) offers designers and developers a way to implement Material Design in their Android application. Developed by a core team of engineers and UX designers at Google, these components enable a reliable development workflow to build beautiful and functional Androi
3 min read
What Are the Different Types of Bars Available in Android?
Android is an open-source operating system, based on the Linux kernel and used in mobile devices like smartphones, tablets, etc. Further, it was developed for smartwatches and Android TV. Each of them has a specialized interface. Android has been one of the best-selling OS for smartphones. Android O
6 min read
ActionBar in Android with Example
In Android applications, ActionBar is the element present at the top of the activity screen. It is a salient feature of a mobile application that has a consistent presence over all its activities. It provides a visual structure to the app and contains some of the frequently used elements for the use
8 min read
ToolBar in Android with Example
In Android applications, Toolbar is a kind of ViewGroup that can be placed in the XML layouts of an activity. It was introduced by the Google Android team during the release of Android Lollipop(API 21). The Toolbar is basically the advanced successor of the ActionBar. It is much more flexible and cu
9 min read
Difference Between ActionBar and Toolbar in Android
ActionBar ActionBar is the element present at the top of the activity screen. It is a salient feature of an android application that has a consistent presence over all its activities. It provides a visual structure to the app and contains some of the frequently used elements for the users. Android A
3 min read
Working with Google Maps
How to Generate API Key for Using Google Maps in Android?
For using any Google services in Android, we have to generate an API key or we have to generate some unique key for using that service provided by Google. So Maps is one of the famous and most used services provided by Google. Maps can be seen in each and every app provided by Google and we also can
3 min read
How to Add Custom Marker to Google Maps in Android?
Google Maps is used in many apps for displaying a location and indicating a specific location on a map. We have seen the use of maps in many apps that provides services such as Ola, Uber, and many more. In these apps, you will get to see How we can add Custom Marker to Google Maps in Android. What w
5 min read
How to Add Multiple Markers on Google Maps in Android?
Google Map is used in most of the apps which are used to represent many locations and markers on Google Maps. We have seen markers on Google maps for multiple locations. In this article, we will take a look at the implementation of Multiple Markers on Google Maps in Android. What we are going to bui
4 min read
How to Use Different Types of Google Maps in Android?
When we use the default application of Google Maps we will get to see different types of Maps present inside this application. We will get to see satellite maps, terrain maps, and many more. We have seen adding Google Maps in the Android application. In this article, we will take a look at the imple
4 min read
How to Add SearchView in Google Maps in Android?
We have seen the implementation of Google Maps in Android along with markers on it. But many apps provide features so that users can specify the location on which they have to place markers. So in this article, we will implement a SearchView in our Android app so that we can search a location name a
4 min read
How to Add OnClickListener to Marker on Google Maps in Android?
We have seen implementing Marker on Google Maps in Android. Now we will see adding OnClickListener for that marker on our Google Maps. In this article, we will take a look at adding OnClickListener to Google Maps marker in Android. What we are going to build in this article? We will be building a si
3 min read
How to Draw Polyline in Google Maps in Android?
Google Maps is used in many Android applications. While using Google Maps there are many modifications which you will get to see while using Maps in this apps. When we have used Google Maps in different apps such as OLA and Uber we will get to see lines and routes drawn on our Maps. In this article,
4 min read
How to Calculate Distance Between two Locations in Android?
We have seen many apps that use Google Maps. These maps are used to indicate places on Google Maps and also we can use this to calculate the distance between two locations. In this article, we will take a look at calculating the distance between two locations in Android. What we are going to build i
4 min read
How to Draw a Track on Google Maps in Android?
In many android apps, we have seen that there is a route marker from a source location to the destination location. In this article, we will take a look at How we can draw a track on Google Maps in Android. What we are going to build in this article? We will be building a simple application in which
3 min read
How to Add Dynamic Markers in Google Maps with Firebase Firstore?
We have seen adding markers to Google Maps in Android. Along with that, we have also added multiple markers on Google Maps in Android. Many apps use a dynamic feature to add a marker on the Google Maps and update them according to requirements. In this article, we will take a look at adding markers
6 min read
Database
Firebase - Introduction
Firebase is a product of Google which helps developers to build, manage, and grow their apps easily. It helps developers to build their apps faster and in a more secure way. No programming is required on the firebase side which makes it easy to use its features more efficiently. It provides services
5 min read
Adding Firebase to Android App
There are various services offered online such as storage, online processing, realtime database, authorisation of user etc. Google developed a platform called Firebase that provide all these online services. It also gives a daily analysis of usage of these services along with the details of user usi
3 min read
How to use Firebase UI Authentication Library in Android?
Firebase UI is a library provided by Firebase for Android apps which makes or so many tasks easy while integrating Firebase in Android. This library provides so many extra features that we can integrate into our Android very easily. In this article, we will take a look at using this library for addi
10 min read
User authentication using Firebase in Android
Firebase is a mobile and web application development platform. It provides services that a web application or mobile application might require. Firebase provides email and password authentication without any overhead of building backend for user authentication. Steps for firebase user authentication
7 min read
Firebase Authentication with Phone Number OTP in Android
Many apps require their users to be authenticated. So for the purpose of authenticating the apps uses phone number authentication inside their apps. In phone authentication, the user has to verify his identity with his phone number. Inside the app user has to enter his phone number after that he wil
9 min read
How to Use Firebase Firestore as a Realtime Database in Android?
Firebase Firestore is the backend database that is used to add, read, update and delete data from Android. But in Firebase Firestore there is a separate method that is used to read data from Firebase Firestore in Realtime Database. In this article, we will read data from Firebase Firestore in Realti
6 min read
How to Create Dynamic Auto Image Slider in Android with Firebase?
We have seen many apps that display images in the slider format as that of banners which slide automatically. This type of feature of the auto image slider is seen in many E-commerce sites. This feature is seen in many apps which are having images in them. In this article, we will take a look at How
9 min read
How to Create Dynamic WebView in Android with Firebase?
Converting a website into an application seems like a basic task to do on Android. With the help of WebView, we can show any webpage in our Android Application. We just have to implement the widget of WebView and add the URL inside the WebView which we have to load. So if you are looking for loading
6 min read
How to Create Dynamic PDF Viewer in Android with Firebase?
If you are creating apps for students or for educational purposes then you need to add some PDF files for displaying some data inside our app. These PDF files are updated on regular basis. For loading this PDF from the server we prefer to use PDF Viewer which will load the PDF from the URL in Androi
8 min read
Advance Android
Shared Preferences in Android with Example
One of the most Interesting Data Storage options Android provides its users is Shared Preferences. Shared Preferences is the way in which one can store and retrieve small amounts of primitive data as key/value pairs to a file on the device storage such as String, int, float, Boolean that make up you
8 min read
Internal Storage in Android with Example
The aim of this article is to show users how to use internal storage. In this article will be creating an application that can write data to a file and store it in internal storage and read data from the file and display it on the main activity using TextView. Saving and loading data on the internal
5 min read
External Storage in Android with Example
Android gives various options for storing apps data which uses a file system similar to the disk-based system on computer platforms App-Specific storage: Store data files within internal volume directories or external. These data files are meant only for the app's use. It uses internal storage direc
9 min read
How to Save ArrayList to SharedPreferences in Android?
SharedPreferences in Android is local storage that is used to store strings, integers, and variables in phone storage so that we can manage the state of the app. We have seen storing simple variables in shared prefs with key and value pair. In this article, we will see How we can store ArrayList to
7 min read
Preferences DataStore in Android
Preference Data Store is used to store data permanently in android. Earlier we had to Shared Preferences for the same but since it is deprecated we are using Data Store now. A sample video is given below to get an idea about what we are going to do in this article. Note that we are going to implemen
4 min read
How to Add Views Dynamically and Store Data in Arraylist in Android?
Dynamic Views are created when we don't want to have repeating XML code. In this article we will create a separate layout and inflate them inside a LinearLayout after that we will store the user data in an ArrayList as then display them as toast. A sample video is given below to get an idea about wh
4 min read
Volley Library in Android
Volley is an HTTP library that makes networking very easy and fast, for Android apps. It was developed by Google and introduced during Google I/O 2013. It was developed because there is an absence in Android SDK, of a networking class capable of working without interfering with the user experience.
5 min read
JSON Parsing in Android
JSON (JavaScript Object Notation) is a straightforward data exchange format to interchange the server's data, and it is a better alternative for XML. This is because JSON is a lightweight and structured language. Android supports all the JSON classes such as JSONStringer, JSONObject, JSONArray, and
4 min read
JSON Parsing in Android using Volley Library
JSON is also known as (JavaScript Object Notation) is a format to exchange the data from the server. The data stored in JSON format is lightweight and easy to handle. With the help of JSON, we can access the data in the form of JsonArray, JsonObject, and JsonStringer. In this article, we will specif
6 min read
Jetpack & Architecture
Introduction to Android Jetpack
The Android support libraries are used in almost all android applications to overcome the compatibility issues across different Android OS versions and devices. These libraries also facilitate users to add various kinds of updated widgets in the application. Over time, these libraries are updated ac
6 min read
Foundation Components of Android Jetpack
Android Jetpack is a set of software components, libraries, tools, and guidance to help in developing robust Android applications. Launched by Google in 2018, Jetpack comprises existing android support libraries, android architecture components with an addition of the Android KTX library as a single
7 min read
Jetpack Architecture Components in Android
Android Jetpack is a set of software components, libraries, tools, and guidance to help in developing robust Android applications. Launched by Google in 2018, Jetpack comprises existing android support libraries, android architecture components with an addition of the Android KTX library as a single
10 min read
Behaviour Components of Android Jetpack
Android Jetpack is a set of software components, libraries, tools, and guidance to help in developing robust Android applications. Launched by Google in 2018, Jetpack comprises existing android support libraries, android architecture components with an addition of the Android KTX library as a single
10 min read
UI Components of Android Jetpack
Android Jetpack is a set of software components, libraries, tools, and guidance to help in developing robust Android applications. Launched by Google in 2018, Jetpack comprises existing android support libraries, android architecture components with an addition of the Android KTX library as a single
14 min read
How to Install Android Studio Canary Version?
Android Studio is an official development environment for building Android apps which is provided by Google. This IDE is built on JetBrains IntelliJ IDEA software which is designed for Android development. This version of Android Studio comes with a modern UI toolkit for building native Android UI.
4 min read
Android Architecture Patterns
When developers work on a real mobile application whose nature is dynamic and will expand its features according to the user's need, then it is not possible to write core logic in activities or fragments. To structure the project's code and to give it a modular design(separated code parts), architec
5 min read
MVC (Model View Controller) Architecture Pattern in Android with Example
Developing an android application by applying a software architecture pattern is always preferred by the developers. An architecture pattern gives modularity to the project files and assures that all the codes get covered in Unit testing. It makes the task easy for developers to maintain the softwar
8 min read
MVP (Model View Presenter) Architecture Pattern in Android with Example
In the initial stages of Android development, learners do write codes in such a manner that eventually creates a MainActivity class which contains all the implementation logic(real-world business logic) of the application. This approach of app development leads to Android activity gets closely coupl
12 min read
MVVM (Model View ViewModel) Architecture Pattern in Android
Developers always prefer clean and structured code for projects. Organizing the codes according to a design pattern helps in the maintenance of the software. By having knowledge of all crucial logic parts of the android application, it is easier to add and remove app features. Further, design patter
7 min read
App Publish & App Monetization
How to Publish Your Android App on Google Play Store?
Nowadays smartphones are among the most essential gadgets for users. Over 60% of people sleep with their phones by their side and check it first thing in the morning. Almost all businesses, including retail stores, have mobile apps to keep their audience engaged. Various applications like games, mus
5 min read
How to Publish Your Android App on Amazon App Store for Free?
To publish your android application on the play store, you need to pay some particular amount to Google, and only then google will let you publish your application. Here, the big question is, what if you don't have money to publish your application? what will you do in that situation? The best solut
3 min read
Overview of Google Admob
In order to earn money from the Android app or game, there are several ways such as in-App Purchases, Sponsorship, Advertisements, and many more. But there is another conventional approach to earn money from the Android app is by integrating an advertisement which is known as Google AdMob. Google Ad
4 min read
Android | AdMob Banner Ads for Android Studio
Banner ads are a rectangular image or text ads that occupy a spot within an app's layout. If you're new to mobile advertising, banner ads are the easiest to implement. This article shows you how to integrate banner ads from AdMob into an Android app.Example: First, create a new project in Android St
2 min read
Android | AdMob Interstitial Ads for Android Studio
Interstitial ads are full-screen ads that cover the whole UI of the app. This article shows you how to integrate Interstitial ads from AdMob into an Android app. Example - First Create a new Project in Android Studio and add the following codes to import the google Mobile Ads SDK. In the project-lev
2 min read
How to Integrate Google Admob Rewarded Video Ads in Android?
In order to earn money from the Android app or game, there are many ways such as in-app purchases, Sponsorship, Advertisements, and many more. But there is another popular method to earn money from the Android app is by integrating an advertisement e.g. known as Google AdMob. Google AdMob is designe
7 min read
Overview of Facebook Audience Network
In order to earn money from the Android or iOS app or game, there are many ways such as in-App Purchases, Sponsorship, Advertisements, and many more. But there is another popular method to earn money from the Android or iOS app is by integrating a third party advertisement e.g known as Facebook Audi
4 min read
How to Integrate Facebook Audience Network (FAN) Banner Ads in Android?
In order to earn money from the Android app or game, there are many ways such as in-App Purchases, Sponsorship, Advertisements, and many more. But there is another popular method to earn money from the Android app is by integrating a third party advertisement e.g known as Facebook Audience Network (
7 min read
How to Integrate Facebook Audience Network (FAN) Native Ads in Android?
In order to earn money from the Android app or game, there are many ways such as in-App Purchases, Sponsorship, Advertisements, and many more. But there is another popular method to earn money from the Android app is by integrating a third-party advertisement e.g known as Facebook Audience Network (
9 min read
How to Integrate Facebook Audience Network (FAN) Interstitial Ads in Android?
In order to earn money from the Android app or game, there are many ways such as in-App Purchases, Sponsorship, Advertisements, and many more. But there is another popular method to earn money from the Android app is by integrating a third party advertisement e.g known as Facebook Audience Network (
6 min read
Projects
How to Build a Tic Tac Toe Game in Android?
In this article, we will be building a Tic Tac Toe Game Project using Java and XML in Android. The Tic Tac Toe Game is based on a two-player game. Each player chooses between X and O. The Player plays one move at a time simultaneously. In a move, a player can choose any position from a 3x3 grid. The
9 min read
How to create a Face Detection Android App using Machine Learning KIT on Firebase
Pre-requisites: Firebase Machine Learning kitAdding Firebase to Android AppFirebase ML KIT aims to make machine learning more accessible, by providing a range of pre-trained models that can use in the iOS and Android apps. Let's use ML Kit’s Face Detection API which will identify faces in photos. By
9 min read
How to Build a Simple Augmented Reality Android App?
Augmented Reality has crossed a long way from Sci-fi Stories to Scientific reality. With this speed of technical advancement, it's probably not very far when we can also manipulate digital data in this real physical world as Tony Stark did in his lab. When we superimpose information like sound, text
11 min read
How to Build a Grocery Android App using MVVM and Room Database?
In this article, we are going to build a grocery application in android using android studio. Many times we forget to purchase things that we want to buy, after all, we can’t remember all the items, so with the help of this app, you can note down your grocery items that you are going to purchase, by
15+ min read
Android Projects - From Basic to Advanced Level
Android, built on a modified version of the Linux kernel, is the go-to operating system for touchscreen mobile devices like smartphones and tablets. For anyone aspiring to become an Android developer, diving into Android projects is essential. Engaging in a variety of projects, from simple apps to c
11 min read
Top 25 Android Interview Questions and Answers For Experienced
The need for new technologies and their developers is increasing as the world is dynamically transforming digitally. Everyone nowadays relies on apps for a variety of functions, including acquiring information and keeping in touch with one another as well as daily activities like shopping, commuting
15+ min read
Top 50 Android Interview Questions and Answers - SDE I to SDE III
A Linux-based open-source OS, Android was created by Andy Rubin and became one of the most popular smartphone operating systems. With 71 percent of the market share worldwide, Android is on top. Because it is on top in the smartphone OS, Android development is always in demand. If you are seeking a
15+ min read