All Basic of Android
1. What is Android?
Android is an open-sourced operating system that is used on mobile devices, such as mobiles and tablets.
Android is a mobile operating system developed by Google. It's the software that runs on smartphones, tablets, and other devices, providing a user interface and enabling various applications. Android is known for its flexibility, allowing developers like you to create diverse and customizable applications using programming languages like Java or Kotlin.
2. What are the features of Android architecture?
Android architecture refers to the various layers in the Android stack. It consists of operating systems, middleware, and applications. Each layer in the Android architecture gives different services to the layer just above it.
The five layers present in the Android stack are:
Linux Kernel - It is responsible for device drivers, device management, memory management, power management, and resource access.
Libraries - There are a set of libraries having open-source Web browser engine WebKit, well-known library libc, libraries to play and record audio and video, SQLite database for sharing of application data and storage, SSL libraries for internet security, etc.
Android Runtime - There are core libraries along with DVM (Dalvik Virtual Machine) or ART(Android RunTime) as runtime which is helpful for running an Android application. DVM is optimized for mobile devices. DVM provides fast performance and consumes less memory. Replacing DVM, ART(Android RunTime) virtual machine was introduced to execute android apps from Android lollipop 5.0 version (API level 21).
Android Framework - It consists of Android APIs like UI (User Interface), resources, content providers (data), locations, telephony, and package managers. It provides interfaces and classes for the development of Android applications.
Android Applications - Applications like home, games, contacts, settings, browsers, etc. uses the Android framework that will make use of Android runtime and libraries.
3. List the languages used to build Android.
The most popular programming languages that can be used to develop applications in Android are:
Java: It has always been a starting point for new developers and used by the majority of people who work with Android development. Eclipse, NetBeans, and IntelliJ IDE are the most popular IDE’s(Integrated Development Environment) used for developing an Android application using java.
Kotlin: Kotlin is a relatively new, modern, safe, and object-oriented cross-platform programming language used in developing an Android application. IDE’s used with kotlin are Android studio, Eclipse IDE, etc.
C#: Developers can build native iOS and Android mobile applications by using the C# language. Visual Studio is the best tool for developing an Android application using C#.
Python: It is a dynamic and object-oriented programming language. It is very popular in machine learning. Pydroid 3, Dcoder, spck code editor is some of the code editors for Python.
Other languages which can be used in Android development are C++, HTML 5. C4droid, CppDroid, AIDE, etc. are IDE’s for C++. Acode, spck code editor, etc. are examples of IDE’s used with HTML.
4. What is an activity?
Activity in java is a single screen that represents GUI(Graphical User Interface) with which users can interact in order to do something like dial the phone, view email, etc.
For example, the Facebook start page where you enter your email/phone number and password to log in acts as an activity.
5. What is a service in Android?
Service is an application component that facilitates an application to run in the background in order to perform long-running operations without user interaction. A service can run continuously in the background even if the application is closed or even after the user switches to another application.
6. Differentiate Activities from Services.
Activities
They are designed to run in the foreground.
Used when the user interface is necessary.
They are dependent.
Services
These are mainly designed to run in the background.
Foreground services are also available.
Used when the user interface is not necessary.
They are dependent.
7. What is Google Android SDK? Which are the tools placed in Android SDK?
The Google Android SDK is a toolset used by developers to write applications on Android-enabled devices.
The tools placed in Android SDK are given below:
Android Emulator - Android Emulator is a software application that simulates Android devices on your computer so that you can test the application on a variety of devices and Android API levels without having each physical device.
DDMS(Dalvik Debug Monitoring Services) - It is a debugging tool from the Android software development kit (SDK) which provides services like message formation, call spoofing, capturing screenshots, etc.
ADB(Android Debug Bridge) - It is a command-line tool used to allow and control communication with the emulator instance.
AAPT(Android Asset Packaging Tool) - It is a build tool that gives the ability to developers to view, create, and update ZIP-compatible archives (zip, jar, and apk).
8. What is the use of Bundle in Android?
Bundles are used to pass the required data between various Android activities. These are like HashMap that can take trivial data types. Below code shows how to transfer a piece of data by using bundle:
Bundle b=new Bundle(); b.putString("Email","abc@xyz.com"); i.putExtras(b); // where i is intent
9. What is an Adapter in Android?
An adapter in Android acts as a bridge between an AdapterView and the underlying data for that view. The adapter holds the data and sends the data to the adapter view, the view can take the data from the adapter view and shows the data on different views like a spinner, list view, grid view, etc.
10. What is AAPT?
AAPT stands for Android Asset Packaging Tool. It is a build tool that gives the ability to developers to view, create, and update ZIP-compatible archives (zip, jar, and apk). It parses, indexes, and compiles the resources into a binary format that is optimized for the platform of Android.
11. What is portable Wi-Fi hotspot?
Portable Wi-Fi Hotspot permits 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 to connect to the internet using that access point.
12. What is Android Debug Bridge(ADB)?
Android Debug Bridge is a command-line tool used to allow and control communication with an emulator instance. It gives the power for developers to execute remote shell commands to run applications on an emulator.
14. What is AIDL? Which data types are supported by AIDL?
AIDL(Android Interface Definition Language) is a tool that handles the interface requirements between a client and a service for interprocess communication(IPC) to communicate at the same level.
The process involves dividing an object into primitives that are understood by the Android operating system. Data Types supported by AIDL is as follows:
String
List
Map
CharSequence
Java data types (int, long, char, and boolean)
📚 Android Developer Interview - 100 Questions + Humanized Answers
✨ Core Android Basics
1. What is Android?
Android is an open-source operating system mainly for mobile devices like phones and tablets. Google manages it, and it's built on Linux.
2. What is an Activity?
An Activity is like a screen/page the user interacts with. Each app usually has many activities (like LoginActivity, HomeActivity).
3. What is the Activity Lifecycle?
Activities have different stages like onCreate(), onStart(), onResume(), etc. Think of it like a human life: born, living, paused, dying.
4. What is a Fragment?
A Fragment is like a mini-Activity. It's a piece of a UI that can be reused in multiple screens.
5. Difference between Activity and Fragment?
Activity = whole screen. Fragment = part of a screen.
6. What is a Service?
A Service runs stuff in the background without showing any UI. Like music playing in the background.
7. Types of Services?
Foreground Service: keeps running even when app is closed (like downloading).
Background Service: stops if app is killed.
Bound Service: connects with other components.
8. What is BroadcastReceiver?
It listens to events happening outside your app (like low battery or incoming SMS).
9. What is ContentProvider?
It shares data between apps safely, like Contacts app sharing numbers with WhatsApp.
10. What is an Intent?
Intent = message that says "Hey Android, I want to do something!" (like opening another screen).
⚡ UI and UX in Android
11. What is View and ViewGroup?
View = single UI element (Button, TextView).
ViewGroup = container that holds multiple Views (LinearLayout, RelativeLayout).
12. Difference between ConstraintLayout and LinearLayout?
LinearLayout arranges elements in one direction (vertical/horizontal).
ConstraintLayout is flexible, lets you position elements relative to each other.
13. What is RecyclerView?
RecyclerView is a super efficient way to show big lists of items. It reuses views instead of creating new ones every time.
14. What is Adapter in RecyclerView?
Adapter tells RecyclerView what data to show and how to show it.
15. What is ViewHolder?
ViewHolder holds the layout of each item. It avoids finding views again and again (boosts performance).
16. What is Data Binding?
Data Binding connects UI components directly to data sources. Less findViewById(), more magic.
17. What is View Binding?
View Binding auto-generates a binding class for each XML. It gives you direct access to views without boilerplate code.
18. What is Jetpack Compose?
Jetpack Compose is Android's modern UI toolkit where you build UIs using Kotlin code instead of XML.
19. Difference between XML and Jetpack Compose?
XML: Old school, separate UI files.
Compose: Code-driven, much cleaner and faster.
20. What is State in Jetpack Compose?
State = data that controls UI. If state changes, UI automatically updates.
🚀 App Architecture
21. What is MVVM Architecture?
Model: data layer.
View: UI layer.
ViewModel: manages UI-related data.
Keeps code clean and organized.
22. What is LiveData?
LiveData is an observable data holder. When data changes, the UI updates automatically.
23. What is ViewModel?
ViewModel survives screen rotations and stores UI data safely.
24. What is Repository Pattern?
Repository acts as a middleman between ViewModel and data sources (API, Database).
25. What is Room Database?
Room is Android’s library to work easily with SQLite database using simple annotations.
26. What is DAO in Room?
DAO (Data Access Object) = interface that defines how to read/write data in Room.
27. What is Entity in Room?
Entity = table in the database.
28. What is Retrofit?
Retrofit makes API calls super easy. You write a simple interface and it handles everything.
29. What is Coroutine in Kotlin?
Coroutines = lightweight threads. You can do long-running tasks without freezing the app.
30. What is Flow in Kotlin?
Flow is a stream of data that can emit multiple values over time (great for live updates).
🔥 Advanced Android Topics
31. What is Dependency Injection?
It's a fancy way to give an object everything it needs without creating it inside. Example: Dagger-Hilt provides dependencies.
32. What is Dagger-Hilt?
Dagger-Hilt is a library for Dependency Injection made simpler for Android.
33. What is WorkManager?
WorkManager handles background tasks that must be completed, even if app closes.
34. Difference between WorkManager, AlarmManager, and JobScheduler?
WorkManager is modern and recommended for most cases. AlarmManager and JobScheduler are older and less flexible.
35. What is Paging 3 library?
It helps you load large lists of data smoothly by loading a few items at a time.
36. What is Navigation Component?
It simplifies navigation between screens using a visual graph (no manual FragmentTransaction needed).
37. What is Jetpack?
Jetpack = collection of Android libraries that makes development faster and more robust.
38. What is ProGuard?
ProGuard shrinks, obfuscates, and optimizes your code to make your APK smaller and safer.
39. What is ViewModelScope?
ViewModelScope automatically cancels coroutines when ViewModel is destroyed (safe from memory leaks).
40. What is SavedStateHandle?
It helps ViewModel survive small process deaths and restore small bits of data.
🛠 Android Core Concepts
41. What is the difference between Parcelable and Serializable?
Parcelable = faster, Android specific.
Serializable = slower, Java native.
42. What is ANR?
ANR = App Not Responding. Happens if main thread is stuck for too long (over 5 seconds).
43. How to avoid ANR?
Move heavy work to background threads using Coroutines or AsyncTask (in old apps).
44. What is the difference between Handler, Looper, and MessageQueue?
Handler: sends and processes messages.
Looper: runs the message loop.
MessageQueue: stores the messages.
45. What is the Application class?
It's the first class that runs when app starts. You can use it to set up stuff globally.
46. What are Launch Modes of Activity?
Standard
SingleTop
SingleTask
SingleInstance
Controls how activities are launched and stacked.
47. What is IntentService?
IntentService handles async tasks in background automatically and stops itself after completion.
48. What is a PendingIntent?
PendingIntent = a token that lets another app (like AlarmManager) perform an action on your app's behalf.
49. What is AIDL?
Android Interface Definition Language - allows two apps to communicate via IPC (rarely used today).
50. What are Permissions in Android?
Permissions protect user privacy. You must ask the user if you want sensitive data like camera, location.
🌐 Networking
51. How does Retrofit work internally?
It uses OkHttp to make network calls, converts JSON responses into Kotlin objects.
52. What is OkHttp?
OkHttp is a networking library. Retrofit uses it under the hood to make HTTP calls.
53. What is Moshi/Gson?
Libraries that convert JSON data into Kotlin/Java objects and vice-versa.
54. How to handle API errors in Retrofit?
Use try-catch or onFailure callbacks. Always show user-friendly messages.
55. What is HTTPS and why is it important?
HTTPS encrypts data between your app and server. Always use HTTPS for user safety.
🧠 Kotlin Concepts (because you’ll be asked!)
56. What are Higher-Order Functions?
Functions that take other functions as parameters or return a function.
57. What is Extension Function?
Add new functions to existing classes without modifying them. (Magic, right?)
58. What is Sealed Class?
Sealed class restricts class hierarchy. Great for when you have limited types (like Success/Error/Loading states).
59. What is a Lambda Expression?
A shortcut way to create anonymous functions. Clean and compact.
60. What are Coroutines Scopes?
Scopes decide the lifecycle of coroutines:
GlobalScope: app lifetime.
ViewModelScope: till ViewModel lives.
LifecycleScope: tied to Activity/Fragment lifecycle.
🧩 Android Jetpack Libraries
61. What is Android Jetpack?
Jetpack is a big bunch of Android libraries created by Google to make our lives easier. It covers everything: UI, architecture, background tasks, and testing.
Example: Room, ViewModel, Navigation, WorkManager — all are part of Jetpack.
62. What is Lifecycle-aware Component?
These are classes (like ViewModel, LiveData) that know when your app’s screen is active or dead, and they automatically behave smartly — like stopping tasks when the screen is closed.
63. What is LiveData used for?
LiveData is like a magical data holder. When the data changes, it tells your UI to update automatically. You don’t have to manually refresh anything.
64. Difference between LiveData and Flow?
LiveData = UI-focused, lifecycle-aware (best for activities/fragments).
Flow = more powerful, works with streams of data (like many API responses), needs a coroutine.
65. What is WorkManager used for?
WorkManager is used when you want to do some background task later even if the app is closed — like uploading a file when internet is available.
66. What is Navigation Component?
It’s a tool that helps us move from one screen to another very easily — no more manual FragmentTransaction! You also get a visual graph to manage your app flow.
67. What is Room Database?
Room is a smart library that gives a simple way to save data on the device. Instead of writing confusing SQL queries, you just use annotations (@Entity, @Dao).
68. What is Paging 3 library?
Paging 3 helps load large lists piece-by-piece (paging), so your app doesn’t get slow when showing thousands of items.
69. What is ViewModel? Why is it important?
ViewModel stores UI data safely. Imagine you rotate your phone — without ViewModel, data would be lost. With ViewModel, data survives.
70. How do you handle offline-first apps?
You save API responses locally (using Room or SharedPreferences) and show that data when internet isn’t available.
🚀 App Performance & Optimization
71. How to make Android app faster?
Use RecyclerView smartly.
Optimize images (small size).
Avoid blocking the main thread.
Use coroutines for background tasks.
Use ProGuard to shrink the app.
72. What is memory leak?
When your app holds memory that it doesn’t need anymore. Like keeping reference to an Activity after it's closed — wastes RAM and may crash app.
73. How to avoid memory leaks?
Use weak references.
Don’t keep heavy objects in static fields.
Cancel background tasks properly.
74. How to improve app battery usage?
Avoid unnecessary background work.
Use WorkManager for smart scheduling.
Stop GPS/location updates when not needed.
75. What is StrictMode?
StrictMode shows you when you're doing something wrong (like long tasks on the main thread) by throwing warnings during development.
🛡️ Security in Android
76. How to secure user data in Android?
Use EncryptedSharedPreferences.
Never store passwords as plain text.
Always use HTTPS for network calls.
77. What is ProGuard / R8?
They make your code hard to read (obfuscate) and shrink your APK size — making your app safer and faster.
78. How to prevent reverse engineering of APK?
Use ProGuard/R8.
Add encryption in sensitive parts.
Use Play Store App Signing.
79. What is App Signing?
It’s a digital certificate (like your app’s ID card) that proves you are the real creator of the app.
80. What is SSL Pinning?
It’s a technique where your app only trusts a specific server certificate. Helps prevent hackers from faking your server.
🧪 Testing
81. What is Unit Testing?
Testing small pieces of code (like a function) to make sure they work perfectly.
82. What is UI Testing?
Testing the app's screens (UI) — making sure buttons, lists, etc. behave properly — like an automatic robot using the app.
83. What is Espresso?
Espresso is a UI testing tool that simulates user actions like clicks, scrolls, typing.
84. What is Mockito?
Mockito helps you create fake objects (mocks) to test your code easily without depending on real things like server or database.
85. Difference between Unit Test and Instrumented Test?
Unit Test = runs on computer (local test).
Instrumented Test = runs on actual Android device/emulator.
🔥 Firebase and Cloud
86. What is Firebase?
Firebase is a platform by Google that gives backend services like database, authentication, storage, notifications without writing backend code.
87. What is Firebase Realtime Database?
A database that updates instantly when data changes — perfect for chat apps, live apps.
88. What is Firestore?
Firestore is a more powerful and flexible version of Firebase Database — supports complex queries and offline sync.
89. How to authenticate users with Firebase?
Use Firebase Authentication — supports email, phone, Google, Facebook login in a few lines of code.
90. What is Firebase Cloud Messaging (FCM)?
It lets you send notifications to your app users — free and reliable.
🎯 Tricky and HR Type Android Questions
91. Why did you choose Android development?
(Tip: Be honest + passionate. Example: "Because I love building things people use daily, and Android gives me so much creative freedom.")
92. How do you keep yourself updated in Android world?
Mention reading blogs (like Android Developers Blog, Medium articles), watching conferences (Google I/O), and trying new libraries.
93. What challenges have you faced while developing apps?
Talk about real struggles — like handling API errors, optimizing UI for different screen sizes — and how you solved them.
94. What would you do if your app keeps crashing randomly?
First check crash logs (Logcat, Crashlytics), understand the reason, reproduce the crash, and fix it carefully.
95. How would you handle different screen sizes and resolutions?
Use ConstraintLayout, flexible layouts, and provide multiple versions of images (drawable-mdpi, hdpi, xhdpi, etc.).
96. Difference between MVP, MVC, and MVVM?
MVC = Model View Controller (oldest, View and Controller mix a lot).
MVP = Model View Presenter (View talks to Presenter).
MVVM = Model View ViewModel (ViewModel holds data, View just observes).
97. What is Clean Architecture?
It’s about organizing code into layers (UI -> Domain -> Data) so that the app is easier to test and maintain.
98. What is Repository Pattern?
Repository acts like a middle guy between ViewModel and actual data sources. ViewModel doesn’t need to know if the data is coming from Room, API, or cache.
99. How to manage large Android projects?
Use modular architecture.
Follow SOLID principles.
Maintain clean code.
Regular code reviews and testing.
100. What is your favorite part of Android development?
Pick what you really love: UI design? Problem-solving? Playing with latest APIs? Tell it passionately!