Md Mominul Islam | Software and Data Enginnering | SQL Server, .NET, Power BI, Azure Blog

while(!(succeed=try()));

LinkedIn Portfolio Banner

Latest

Home Top Ad

Responsive Ads Here

Post Top Ad

Responsive Ads Here

Sunday, September 7, 2025

Top 150+ Android Mobile App Development Interview Questions

 

Introduction

Android, Google’s open-source platform, powers billions of devices and remains a cornerstone of mobile app development. Mastering Android development is essential for roles like Android Developer, Mobile Engineer, or App Architect in 2025. This blog presents 150+ meticulously curated interview questions on Android Mobile App Development, categorized by complexity (Beginner, Intermediate, Expert). These questions are competitive, real-life centric, scenario-based, and include coding examples, IQ challenges, and data-oriented problems to prepare you for exams and real-world applications. Optimized for SEO and designed for all readers, this guide includes detailed explanations and practical examples for clarity. Dive into the ultimate Android interview prep guide for 2025!


Table of Contents

  1. Beginner-Level Questions

  2. Intermediate-Level Questions

  3. Expert-Level Questions

  4. Conclusion


Beginner-Level Questions

These questions cover foundational Android concepts, Kotlin/Java basics, and core principles for entry-level candidates.

Android Mobile App Development (Beginner)

  1. What is Android, and why is it used for mobile app development?

    • Type: Basic Understanding

    • Expected Answer: Android is Google’s open-source OS for mobile devices, offering flexibility and a large ecosystem.

    • Example: Apps like Gmail use Android SDK for development.

  2. What is the Android SDK, and what are its key components?

    • Type: Conceptual

    • Expected Answer: The Android SDK provides tools and APIs for app development, including libraries, emulator, and ADB.

  3. What is an Activity in Android?

    • Type: Basic Understanding

    • Expected Answer: An Activity represents a single screen with a user interface.

    • Example:

      class MainActivity : AppCompatActivity() {
          override fun onCreate(savedInstanceState: Bundle?) {
              super.onCreate(savedInstanceState)
              setContentView(R.layout.activity_main)
          }
      }
  4. What is the role of the AndroidManifest.xml file?

    • Type: Conceptual

    • Expected Answer: Declares app components, permissions, and metadata.

    • Example:

      <activity android:name=".MainActivity">
          <intent-filter>
              <action android:name="android.intent.action.MAIN" />
              <category android:name="android.intent.category.LAUNCHER" />
          </intent-filter>
      </activity>
  5. What is the difference between a Fragment and an Activity?

    • Type: Conceptual

    • Expected Answer: An Activity is a full screen, while a Fragment is a modular UI component within an Activity.

  6. What is Kotlin, and why is it preferred for Android development?

    • Type: Basic Understanding

    • Expected Answer: Kotlin is a modern, concise language with null safety, endorsed by Google for Android.

  7. What is the purpose of the res folder in an Android project?

    • Type: Conceptual

    • Expected Answer: The res folder stores resources like layouts, drawables, and strings.

    • Example:

      <string name="app_name">MyApp</string>
  8. What is an Intent in Android?

    • Type: Basic Understanding

    • Expected Answer: Intents facilitate communication between components, like starting an Activity.

    • Example:

      val intent = Intent(this, SecondActivity::class.java)
      startActivity(intent)
  9. What is the role of the build.gradle file?

    • Type: Conceptual

    • Expected Answer: Configures app dependencies, build types, and SDK versions.

    • Example:

      dependencies {
          implementation 'androidx.core:core-ktx:1.12.0'
      }
  10. What is the Android Activity lifecycle?

    • Type: Conceptual

    • Expected Answer: Includes onCreate, onStart, onResume, onPause, onStop, onDestroy.

  11. What is a View in Android?

    • Type: Basic Understanding

    • Expected Answer: A View is a UI element like a button or text field.

    • Example:

      <Button android:id="@+id/myButton" android:text="Click Me" />
  12. What is the difference between dp, sp, and px in Android?

    • Type: Conceptual

    • Expected Answer: dp is density-independent, sp is for fonts, px is raw pixels.

  13. What is the purpose of the RecyclerView in Android?

    • Type: Basic Understanding

    • Expected Answer: RecyclerView displays large lists efficiently with view recycling.

    • Example:

      <androidx.recyclerview.widget.RecyclerView
          android:id="@+id/recyclerView"
          android:layout_width="match_parent"
          android:layout_height="match_parent" />
  14. What is the role of the onCreate method in an Activity?

    • Type: Conceptual

    • Expected Answer: Initializes the Activity, sets the layout, and binds views.

    • Example:

      override fun onCreate(savedInstanceState: Bundle?) {
          super.onCreate(savedInstanceState)
          setContentView(R.layout.activity_main)
      }
  15. What is the difference between LinearLayout and ConstraintLayout?

    • Type: Conceptual

    • Expected Answer: LinearLayout arranges views linearly, ConstraintLayout uses constraints for flexibility.

  16. What is the purpose of the R class in Android?

    • Type: Basic Understanding

    • Expected Answer: The R class provides access to resources like layouts and strings.

    • Example:

      setContentView(R.layout.activity_main)
  17. What is an Android Service?

    • Type: Conceptual

    • Expected Answer: A Service runs background tasks without a UI.

    • Example:

      class MyService : Service() {
          override fun onBind(intent: Intent?): IBinder? = null
      }
  18. What is the role of SharedPreferences in Android?

    • Type: Basic Understanding

    • Expected Answer: Stores small key-value pairs for app settings.

    • Example:

      val prefs = getSharedPreferences("myPrefs", MODE_PRIVATE)
      prefs.edit().putString("key", "value").apply()
  19. What is the difference between startActivity and startActivityForResult?

    • Type: Conceptual

    • Expected Answer: startActivityForResult expects a result from the launched Activity.

  20. What is the purpose of the minSdkVersion in build.gradle?

    • Type: Conceptual

    • Expected Answer: Specifies the minimum Android version the app supports.


Intermediate-Level Questions

These questions target candidates with 2–5 years of experience, focusing on practical scenarios, architecture, and advanced Android features.

Android Mobile App Development (Intermediate)

  1. How do you implement a RecyclerView in Android?

    • Type: Coding Challenge

    • Expected Answer:

      class MyAdapter(val items: List<String>) : RecyclerView.Adapter<MyViewHolder>() {
          override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): MyViewHolder {
              val view = LayoutInflater.from(parent.context).inflate(R.layout.item_layout, parent, false)
              return MyViewHolder(view)
          }
          override fun onBindViewHolder(holder: MyViewHolder, position: Int) {
              holder.bind(items[position])
          }
          override fun getItemCount(): Int = items.size
      }
      class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
          fun bind(item: String) {
              itemView.findViewById<TextView>(R.id.textView).text = item
          }
      }
  2. What is the MVVM architecture, and how is it implemented in Android?

    • Type: Conceptual

    • Expected Answer: MVVM separates UI, logic, and data using ViewModel and LiveData.

    • Example:

      class MyViewModel : ViewModel() {
          private val _data = MutableLiveData<String>()
          val data: LiveData<String> = _data
          fun updateData(value: String) {
              _data.value = value
          }
      }
  3. How do you handle HTTP requests in Android?

    • Type: Practical

    • Expected Answer: Use Retrofit or OkHttp for API calls.

    • Example:

      interface ApiService {
          @GET("data")
          suspend fun getData(): Response<Data>
      }
      val retrofit = Retrofit.Builder().baseUrl("https://api.example.com").build()
  4. What is the role of LiveData in Android?

    • Type: Conceptual

    • Expected Answer: LiveData is an observable data holder for lifecycle-aware updates.

    • Example:

      val data: LiveData<String> = MutableLiveData("Hello")
  5. How do you implement navigation in Android using Jetpack Navigation?

    • Type: Practical

    • Expected Answer: Use NavGraph and NavController for navigation.

    • Example:

      <navigation android:id="@+id/nav_graph">
          <fragment android:id="@+id/firstFragment" android:name=".FirstFragment">
              <action android:id="@+id/action_to_second" destination="@id/secondFragment" />
          </fragment>
      </navigation>
  6. What is the difference between Coroutines and RxJava in Android?

    • Type: Conceptual

    • Expected Answer: Coroutines are simpler and native to Kotlin, RxJava is for reactive programming.

  7. How do you handle background tasks in Android?

    • Type: Scenario-Based

    • Expected Answer: Use WorkManager for persistent tasks.

    • Example:

      val workRequest = OneTimeWorkRequestBuilder<MyWorker>().build()
      WorkManager.getInstance(context).enqueue(workRequest)
  8. What is the role of Room in Android?

    • Type: Conceptual

    • Expected Answer: Room is a persistence library for SQLite database access.

    • Example:

      @Entity
      data class User(@PrimaryKey val id: Int, val name: String)
      @Dao
      interface UserDao {
          @Query("SELECT * FROM user")
          fun getAll(): List<User>
      }
  9. How do you implement dependency injection in Android?

    • Type: Practical

    • Expected Answer: Use Dagger or Hilt for dependency injection.

    • Example:

      @Module
      @InstallIn(SingletonComponent::class)
      object AppModule {
          @Provides
          fun provideApiService(): ApiService = Retrofit.Builder().build().create(ApiService::class.java)
      }
  10. What is the difference between Service and IntentService?

    • Type: Conceptual

    • Expected Answer: IntentService handles intents sequentially on a worker thread.

  11. How do you implement a ViewModel in Android?

    • Type: Coding Challenge

    • Expected Answer:

      class MyViewModel : ViewModel() {
          private val _counter = MutableLiveData<Int>(0)
          val counter: LiveData<Int> = _counter
          fun increment() {
              _counter.value = (_counter.value ?: 0) + 1
          }
      }
  12. What is the role of the onSaveInstanceState method?

    • Type: Conceptual

    • Expected Answer: Saves UI state during configuration changes.

    • Example:

      override fun onSaveInstanceState(outState: Bundle) {
          outState.putInt("counter", counter)
          super.onSaveInstanceState(outState)
      }
  13. How do you handle permissions in Android?

    • Type: Practical

    • Expected Answer: Use ActivityCompat for runtime permissions.

    • Example:

      ActivityCompat.requestPermissions(this, arrayOf(Manifest.permission.CAMERA), 1)
  14. What is the difference between ViewBinding and findViewById?

    • Type: Conceptual

    • Expected Answer: ViewBinding generates type-safe binding classes, reducing boilerplate.

  15. How do you implement a custom view in Android?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomView(context: Context) : View(context) {
          override fun onDraw(canvas: Canvas) {
              canvas.drawCircle(50f, 50f, 30f, Paint())
          }
      }
  16. What is the role of the BroadcastReceiver in Android?

    • Type: Conceptual

    • Expected Answer: Receives system or app broadcasts for event handling.

    • Example:

      class MyReceiver : BroadcastReceiver() {
          override fun onReceive(context: Context, intent: Intent) {
              Log.d("Receiver", "Broadcast received")
          }
      }
  17. How do you handle configuration changes in Android?

    • Type: Scenario-Based

    • Expected Answer: Use ViewModel or onSaveInstanceState.

    • Example:

      val viewModel: MyViewModel by viewModels()
  18. What is the difference between AsyncTask and Coroutines?

    • Type: Conceptual

    • Expected Answer: AsyncTask is deprecated, Coroutines are modern and lightweight.

  19. How do you implement a notification in Android?

    • Type: Practical

    • Expected Answer: Use NotificationCompat for notifications.

    • Example:

      NotificationCompat.Builder(context, "channel_id")
          .setContentTitle("Title")
          .setContentText("Text")
          .build()
  20. What is the role of the gradle.properties file?

    • Type: Conceptual

    • Expected Answer: Stores global build configurations like JVM settings.


Expert-Level Questions

These questions challenge senior developers with complex scenarios, advanced Android features, and performance optimization.

Android Mobile App Development (Expert)

  1. How do you optimize Android app performance?

    • Type: Scenario-Based

    • Expected Answer: Minimize overdraw, use ViewHolder pattern, and profile with Android Studio.

    • Example:

      recyclerView.setHasFixedSize(true)
  2. What is Jetpack Compose, and how does it differ from XML layouts?

    • Type: Conceptual

    • Expected Answer: Jetpack Compose is a declarative UI toolkit, replacing XML with Kotlin code.

    • Example:

      @Composable
      fun Greeting(name: String) {
          Text(text = "Hello $name!")
      }
  3. How do you implement a custom WorkManager worker?

    • Type: Coding Challenge

    • Expected Answer:

      class MyWorker(context: Context, params: WorkerParameters) : Worker(context, params) {
          override fun doWork(): Result {
              return Result.success()
          }
      }
  4. What is the difference between ViewModel and SavedStateHandle?

    • Type: Conceptual

    • Expected Answer: SavedStateHandle persists data across process death.

  5. How do you implement dependency injection with Hilt?

    • Type: Practical

    • Expected Answer: Use @Inject and @HiltAndroidApp.

    • Example:

      @HiltAndroidApp
      class MyApp : Application()
  6. What is the role of the Room database migrations?

    • Type: Conceptual

    • Expected Answer: Migrations update schema changes without data loss.

    • Example:

      val MIGRATION_1_2 = object : Migration(1, 2) {
          override fun migrate(database: SupportSQLiteDatabase) {
              database.execSQL("ALTER TABLE user ADD COLUMN age INTEGER")
          }
      }
  7. How do you handle deep links in Android?

    • Type: Scenario-Based

    • Expected Answer: Use nav_deep_link in NavGraph or Intent filters.

    • Example:

      <nav-graph android:value="@navigation/nav_graph">
          <deepLink android:uri="example://app/profile/{id}" />
      </nav-graph>
  8. What is the difference between Flow and LiveData?

    • Type: Conceptual

    • Expected Answer: Flow is a Kotlin reactive stream, LiveData is lifecycle-aware.

  9. How do you implement a foreground service in Android?

    • Type: Practical

    • Expected Answer: Use startForeground with a notification.

    • Example:

      class MyService : Service() {
          override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
              startForeground(1, Notification())
              return START_STICKY
          }
      }
  10. What is the role of the LeakCanary library?

    • Type: Conceptual

    • Expected Answer: Detects memory leaks in Android apps.

  11. How do you implement Jetpack Compose animations?

    • Type: Coding Challenge

    • Expected Answer:

      @Composable
      fun AnimatedBox() {
          var expanded by remember { mutableStateOf(false) }
          Box(
              modifier = Modifier.animateContentSize().background(if (expanded) Color.Blue else Color.Red)
          )
      }
  12. What is the difference between Coroutines and Thread?

    • Type: Conceptual

    • Expected Answer: Coroutines are lightweight and managed, Threads are OS-level.

  13. How do you handle push notifications in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Firebase Cloud Messaging (FCM).

    • Example:

      class MyMessagingService : FirebaseMessagingService() {
          override fun onMessageReceived(message: RemoteMessage) {
              showNotification(message.notification?.body)
          }
      }
  14. What is the role of the Android Jetpack libraries?

    • Type: Conceptual

    • Expected Answer: Jetpack provides standardized APIs for UI, data, and architecture.

  15. How do you implement a custom ViewModel factory?

    • Type: Coding Challenge

    • Expected Answer:

      class MyViewModelFactory : ViewModelProvider.Factory {
          override fun <T : ViewModel> create(modelClass: Class<T>): T {
              return MyViewModel() as T
          }
      }
  16. What is the difference between Activity and AppCompatActivity?

    • Type: Conceptual

    • Expected Answer: AppCompatActivity supports backward-compatible features.

  17. How do you optimize RecyclerView performance?

    • Type: Scenario-Based

    • Expected Answer: Use DiffUtil and ViewHolder pattern.

    • Example:

      class MyDiffCallback : DiffUtil.ItemCallback<String>() {
          override fun areItemsTheSame(oldItem: String, newItem: String): Boolean = oldItem == newItem
          override fun areContentsTheSame(oldItem: String, newItem: String): Boolean = oldItem == newItem
      }
  18. What is the role of the adb tool in Android development?

    • Type: Conceptual

    • Expected Answer: ADB facilitates device communication for debugging.

  19. How do you implement biometric authentication in Android?

    • Type: Practical

    • Expected Answer: Use BiometricPrompt API.

    • Example:

      val prompt = BiometricPrompt(this, executor, object : BiometricPrompt.AuthenticationCallback() {
          override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult) {
              // Success
          }
      })
  20. What is the difference between startService and bindService?

    • Type: Conceptual

    • Expected Answer: startService runs indefinitely, bindService allows interaction.

  21. How do you implement a custom layout manager for RecyclerView?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomLayoutManager : RecyclerView.LayoutManager() {
          override fun generateDefaultLayoutParams(): RecyclerView.LayoutParams {
              return RecyclerView.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)
          }
      }
  22. What is the role of the Gradle build system in Android?

    • Type: Conceptual

    • Expected Answer: Automates and manages the build process.

  23. How do you handle memory leaks in Android?

    • Type: Scenario-Based

    • Expected Answer: Use LeakCanary and avoid static references.

    • Example:

      LeakCanary.install(application)
  24. What is the difference between Room and SQLiteOpenHelper?

    • Type: Conceptual

    • Expected Answer: Room is a higher-level abstraction with type safety.

  25. How do you implement a custom broadcast receiver?

    • Type: Practical

    • Expected Answer:

      val receiver = object : BroadcastReceiver() {
          override fun onReceive(context: Context, intent: Intent) {
              Log.d("Receiver", "Action: ${intent.action}")
          }
      }
      registerReceiver(receiver, IntentFilter("my_action"))
  26. What is the role of the Data Binding library?

    • Type: Conceptual

    • Expected Answer: Binds UI components to data sources.

    • Example:

      <layout>
          <data>
              <variable name="user" type="com.example.User" />
          </data>
          <TextView android:text="@{user.name}" />
      </layout>
  27. How do you implement dynamic feature modules in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Play Feature Delivery for on-demand modules.

    • Example:

      dynamicFeatures = [":dynamic_feature"]
  28. What is the difference between Hilt and Dagger?

    • Type: Conceptual

    • Expected Answer: Hilt simplifies Dagger with predefined components.

  29. How do you implement a custom notification channel?

    • Type: Practical

    • Expected Answer:

      val channel = NotificationChannel("id", "name", NotificationManager.IMPORTANCE_DEFAULT)
      getSystemService(NotificationManager::class.java).createNotificationChannel(channel)
  30. What is the role of the StrictMode class?

    • Type: Conceptual

    • Expected Answer: Detects policy violations like disk I/O on the main thread.

  31. How do you implement Jetpack Compose navigation?

    • Type: Coding Challenge

    • Expected Answer:

      val navController = rememberNavController()
      NavHost(navController, startDestination = "home") {
          composable("home") { Text("Home") }
          composable("profile") { Text("Profile") }
      }
  32. What is the difference between LiveData and StateFlow?

    • Type: Conceptual

    • Expected Answer: StateFlow is a Kotlin Flow with state management.

  33. How do you handle app updates in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Play In-App Updates API.

    • Example:

      val appUpdateManager = AppUpdateManagerFactory.create(context)
      appUpdateManager.startUpdateFlowForResult(appUpdateInfo, AppUpdateType.IMMEDIATE, this, 1)
  34. What is the role of the Android Profiler?

    • Type: Conceptual

    • Expected Answer: Monitors CPU, memory, and network usage.

  35. How do you implement a custom ContentProvider?

    • Type: Coding Challenge

    • Expected Answer:

      class MyProvider : ContentProvider() {
          override fun query(uri: Uri, projection: Array<String>?, selection: String?, args: Array<String>?, sortOrder: String?): Cursor? {
              return null
          }
      }
  36. What is the difference between Service and JobScheduler?

    • Type: Conceptual

    • Expected Answer: JobScheduler schedules tasks with system constraints.

  37. How do you implement accessibility in Android?

    • Type: Practical

    • Expected Answer: Use contentDescription and TalkBack support.

    • Example:

      <ImageView android:contentDescription="Profile picture" />
  38. What is the role of the buildTypes in build.gradle?

    • Type: Conceptual

    • Expected Answer: Defines build configurations like debug and release.

  39. How do you handle large dataset pagination in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Paging library for efficient data loading.

    • Example:

      val pagingConfig = PagingConfig(pageSize = 20)
      val pager = Pager(pagingConfig) { MyPagingSource() }
  40. What is the difference between Room and Realm?

    • Type: Conceptual

    • Expected Answer: Room integrates with SQLite, Realm is a standalone database.

  41. How do you implement a custom animation in Android?

    • Type: Coding Challenge

    • Expected Answer:

      val animator = ObjectAnimator.ofFloat(view, "translationX", 100f)
      animator.start()
  42. What is the role of the Android Architecture Components?

    • Type: Conceptual

    • Expected Answer: Provides libraries for lifecycle, data, and UI management.

  43. How do you handle security in Android apps?

    • Type: Scenario-Based

    • Expected Answer: Use ProGuard, HTTPS, and secure storage.

    • Example:

      buildTypes {
          release {
              minifyEnabled true
              proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
          }
      }
  44. What is the difference between Activity and Fragment lifecycle?

    • Type: Conceptual

    • Expected Answer: Fragment lifecycle includes onAttach and onCreateView.

  45. How do you implement a custom dialog in Android?

    • Type: Coding Challenge

    • Expected Answer:

      AlertDialog.Builder(this)
          .setTitle("Custom Dialog")
          .setMessage("Content")
          .setPositiveButton("OK") { _, _ -> }
          .show()
  46. What is the role of the adb shell command?

    • Type: Conceptual

    • Expected Answer: Provides access to device shell for debugging.

  47. How do you implement a custom splash screen in Android?

    • Type: Practical

    • Expected Answer: Use SplashScreen API or a custom Activity.

    • Example:

      <style name="SplashTheme" parent="Theme.SplashScreen">
          <item name="postSplashScreenTheme">@style/AppTheme</item>
      </style>
  48. What is the difference between DataStore and SharedPreferences?

    • Type: Conceptual

    • Expected Answer: DataStore supports complex data and coroutines.

  49. How do you implement a background fetch in Android?

    • Type: Practical

    • Expected Answer: Use WorkManager with periodic tasks.

    • Example:

      val request = PeriodicWorkRequestBuilder<MyWorker>(15, TimeUnit.MINUTES).build()
      WorkManager.getInstance(context).enqueue(request)
  50. What is the role of the Android Emulator?

    • Type: Conceptual

    • Expected Answer: Simulates Android devices for testing.

  51. How do you implement a custom bottom navigation in Android?

    • Type: Coding Challenge

    • Expected Answer:

      BottomNavigationView().apply {
          setupWithNavController(findNavController(R.id.nav_host_fragment))
      }
  52. What is the difference between onPause and onStop?

    • Type: Conceptual

    • Expected Answer: onPause is called when partially visible, onStop when not visible.

  53. How do you handle app versioning in Android?

    • Type: Practical

    • Expected Answer: Use versionCode and versionName in build.gradle.

    • Example:

      android {
          defaultConfig {
              versionCode 1
              versionName "1.0"
          }
      }
  54. What is the role of the ConstraintLayout in Android?

    • Type: Conceptual

    • Expected Answer: Provides flexible layout with constraints.

  55. How do you implement a custom tab layout in Android?

    • Type: Coding Challenge

    • Expected Answer:

      TabLayout().apply {
          addTab(newTab().setText("Tab 1"))
          setupWithViewPager(viewPager)
      }
  56. What is the difference between Activity and Service lifecycle?

    • Type: Conceptual

    • Expected Answer: Service lacks UI-related lifecycle methods.

  57. How do you handle large file downloads in Android?

    • Type: Scenario-Based

    • Expected Answer: Use DownloadManager or OkHttp with progress tracking.

    • Example:

      val request = DownloadManager.Request(Uri.parse("https://example.com/file"))
      DownloadManager(context).enqueue(request)
  58. What is the role of the Android Debug Bridge (ADB)?

    • Type: Conceptual

    • Expected Answer: Connects to devices for debugging and file transfer.

  59. How do you implement a custom back press handler in Android?

    • Type: Practical

    • Expected Answer:

      override fun onBackPressed() {
          if (condition) {
              // Custom logic
          } else {
              super.onBackPressed()
          }
      }
  60. What is the difference between ViewModel and AndroidViewModel?

    • Type: Conceptual

    • Expected Answer: AndroidViewModel provides application context.

  61. How do you implement a custom ViewGroup in Android?

    • Type: Coding Challenge

    • Expected Answer:

      class CustomViewGroup(context: Context) : ViewGroup(context) {
          override fun onLayout(changed: Boolean, l: Int, t: Int, r: Int, b: Int) {
              // Layout logic
          }
      }
  62. What is the role of the ProGuard in Android?

    • Type: Conceptual

    • Expected Answer: Shrinks and obfuscates code for optimization.

  63. How do you handle app crashes in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Crashlytics or custom exception handling.

    • Example:

      Thread.setDefaultUncaughtExceptionHandler { _, e ->
          Log.e("Crash", "Uncaught: $e")
      }
  64. What is the difference between Flow and Channel in Kotlin?

    • Type: Conceptual

    • Expected Answer: Flow is for cold streams, Channel for hot streams.

  65. How do you implement a custom loader in Android?

    • Type: Coding Challenge

    • Expected Answer:

      ProgressDialog(this).apply {
          setMessage("Loading...")
          show()
      }
  66. What is the role of the Android Jetpack Navigation library?

    • Type: Conceptual

    • Expected Answer: Simplifies navigation with NavGraph and NavController.

  67. How do you handle multi-threading in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Coroutines or ThreadPoolExecutor.

    • Example:

      CoroutineScope(Dispatchers.IO).launch {
          // Background task
      }
  68. What is the difference between Room migrations and schema export?

    • Type: Conceptual

    • Expected Answer: Migrations update schema, export generates schema files.

  69. How do you implement a custom snackbar in Android?

    • Type: Practical

    • Expected Answer:

      Snackbar.make(view, "Message", Snackbar.LENGTH_SHORT).show()
  70. What is the role of the R8 compiler?

    • Type: Conceptual

    • Expected Answer: Replaces ProGuard for code shrinking and optimization.

  71. How do you implement a custom transition animation in Android?

    • Type: Coding Challenge

    • Expected Answer:

      val transition = Slide()
      TransitionManager.beginDelayedTransition(viewGroup, transition)
  72. What is the difference between onCreate and onStart?

    • Type: Conceptual

    • Expected Answer: onCreate initializes, onStart makes the Activity visible.

  73. How do you handle localization in Android?

    • Type: Practical

    • Expected Answer: Use resource files for different locales.

    • Example:

      <string name="hello" lang="es">Hola</string>
  74. What is the role of the Android Studio Layout Inspector?

    • Type: Conceptual

    • Expected Answer: Visualizes view hierarchy for debugging.

  75. How do you implement a custom dialog fragment?

    • Type: Coding Challenge

    • Expected Answer:

      class MyDialogFragment : DialogFragment() {
          override fun onCreateDialog(savedInstanceState: Bundle?): Dialog {
              return AlertDialog.Builder(requireContext())
                  .setTitle("Dialog")
                  .setMessage("Content")
                  .create()
          }
      }
  76. What is the difference between startActivity and startActivityForResult?

    • Type: Conceptual

    • Expected Answer: startActivityForResult expects a result, deprecated in favor of Activity Result API.

  77. How do you handle large-scale data syncing in Android?

    • Type: Scenario-Based

    • Expected Answer: Use WorkManager with SyncAdapter.

    • Example:

      WorkManager.getInstance(context).enqueueUniquePeriodicWork("sync", ExistingPeriodicWorkPolicy.KEEP, workRequest)
  78. What is the role of the Android Asset Packaging Tool (AAPT)?

    • Type: Conceptual

    • Expected Answer: Packages resources into APK.

  79. How do you implement a custom toolbar in Android?

    • Type: Practical

    • Expected Answer:

      <androidx.appcompat.widget.Toolbar
          android:id="@+id/toolbar"
          android:layout_width="match_parent"
          android:layout_height="?attr/actionBarSize" />
      setSupportActionBar(findViewById(R.id.toolbar))
  80. What is the difference between Activity Result API and startActivityForResult?

    • Type: Conceptual

    • Expected Answer: Activity Result API is modern and type-safe.

  81. How do you implement a custom bottom sheet in Android?

    • Type: Coding Challenge

    • Expected Answer:

      BottomSheetDialog(this).apply {
          setContentView(R.layout.bottom_sheet_layout)
          show()
      }
  82. What is the role of the Android Gradle Plugin?

    • Type: Conceptual

    • Expected Answer: Integrates Gradle with Android build system.

  83. How do you handle orientation changes in Android?

    • Type: Scenario-Based

    • Expected Answer: Use onConfigurationChanged or ViewModel.

    • Example:

      override fun onConfigurationChanged(newConfig: Configuration) {
          super.onConfigurationChanged(newConfig)
      }
  84. What is the difference between Fragment and DialogFragment?

    • Type: Conceptual

    • Expected Answer: DialogFragment displays a dialog with Fragment lifecycle.

  85. How do you implement a custom ViewPager in Android?

    • Type: Coding Challenge

    • Expected Answer:

      ViewPager2().apply {
          adapter = MyPagerAdapter(this@MainActivity)
      }
  86. What is the role of the Android Studio Profiler?

    • Type: Conceptual

    • Expected Answer: Analyzes app performance metrics.

  87. How do you implement a custom notification action?

    • Type: Practical

    • Expected Answer:

      NotificationCompat.Builder(context, "channel_id")
          .addAction(R.drawable.ic_action, "Action", pendingIntent)
          .build()
  88. What is the difference between Room and GreenDAO?

    • Type: Conceptual

    • Expected Answer: Room is Jetpack-based, GreenDAO is lightweight.

  89. How do you handle app signing in Android?

    • Type: Practical

    • Expected Answer: Use keytool and jarsigner or Play App Signing.

    • Example:

      keytool -genkey -v -keystore my-key.keystore -alias alias_name
  90. What is the role of the Android Virtual Device (AVD)?

    • Type: Conceptual

    • Expected Answer: Simulates Android devices for testing.

  91. How do you implement a custom search view in Android?

    • Type: Coding Challenge

    • Expected Answer:

      SearchView().setOnQueryTextListener(object : SearchView.OnQueryTextListener {
          override fun onQueryTextSubmit(query: String?): Boolean {
              return true
          }
          override fun onQueryTextChange(newText: String?): Boolean {
              return true
          }
      })
  92. What is the difference between onResume and onStart?

    • Type: Conceptual

    • Expected Answer: onResume is called when Activity is interactive.

  93. How do you handle offline data in Android?

    • Type: Scenario-Based

    • Expected Answer: Use Room or WorkManager for offline caching.

    • Example:

      @Query("SELECT * FROM user WHERE offline = 1")
      fun getOfflineUsers(): List<User>
  94. What is the role of the Android Support Library?

    • Type: Conceptual

    • Expected Answer: Provides backward-compatible APIs, replaced by AndroidX.

  95. How do you implement a custom floating action button?

    • Type: Coding Challenge

    • Expected Answer:

      <com.google.android.material.floatingactionbutton.FloatingActionButton
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:src="@drawable/ic_add" />
  96. What is the difference between LiveData and MediatorLiveData?

    • Type: Conceptual

    • Expected Answer: MediatorLiveData combines multiple LiveData sources.

  97. How do you implement a custom progress bar in Android?

    • Type: Practical

    • Expected Answer:

      <ProgressBar
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          style="?android:attr/progressBarStyleHorizontal" />
  98. What is the role of the Android Studio Build Analyzer?

    • Type: Conceptual

    • Expected Answer: Identifies build bottlenecks.

  99. How do you implement a custom recycler view adapter with multiple view types?

    • Type: Coding Challenge

    • Expected Answer:

      class MultiTypeAdapter : RecyclerView.Adapter<RecyclerView.ViewHolder>() {
          override fun getItemViewType(position: Int): Int = if (position % 2 == 0) 1 else 2
          override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): RecyclerView.ViewHolder {
              return if (viewType == 1) ViewHolder1() else ViewHolder2()
          }
      }
  100. What is the difference between Activity and Application context?

    • Type: Conceptual

    • Expected Answer: Application context is app-wide, Activity context is UI-specific.

  101. How do you implement a custom app widget in Android?

    • Type: Practical

    • Expected Answer:

      class MyAppWidget : AppWidgetProvider() {
          override fun onUpdate(context: Context, appWidgetManager: AppWidgetManager, appWidgetIds: IntArray) {
              // Update widget
          }
      }
  102. What is the role of the Android Gradle Sync?

    • Type: Conceptual

    • Expected Answer: Synchronizes project with Gradle configuration.

  103. How do you handle background location updates in Android?

    • Type: Scenario-Based

    • Expected Answer: Use FusedLocationProviderClient with WorkManager.

    • Example:

      FusedLocationProviderClient(this).requestLocationUpdates(locationRequest, callback, null)
  104. What is the difference between ConstraintLayout and RelativeLayout?

    • Type: Conceptual

    • Expected Answer: ConstraintLayout is more flexible, RelativeLayout is deprecated.

  105. How do you implement a custom view animation in Android?

    • Type: Coding Challenge

    • Expected Answer:

      view.animate().alpha(0f).setDuration(1000).start()
  106. What is the role of the Android Studio Database Inspector?

    • Type: Conceptual

    • Expected Answer: Inspects and modifies app databases.

  107. How do you implement a custom share intent in Android?

    • Type: Practical

    • Expected Answer:

      val shareIntent = Intent().apply {
          action = Intent.ACTION_SEND
          putExtra(Intent.EXTRA_TEXT, "Share this")
          type = "text/plain"
      }
      startActivity(Intent.createChooser(shareIntent, null))
  108. What is the difference between Room and ContentProvider?

    • Type: Conceptual

    • Expected Answer: Room is for local data, ContentProvider for inter-app data sharing.

  109. How do you implement a custom onboarding screen in Android?

    • Type: Coding Challenge

    • Expected Answer:

      ViewPager2().apply {
          adapter = OnboardingAdapter()
      }
  110. What is the role of the Android Studio Motion Editor?

    • Type: Conceptual

    • Expected Answer: Creates and edits MotionLayout animations.

  111. How do you handle multi-language support in Android?

    • Type: Practical

    • Expected Answer: Use res/values-<lang> for localized resources.

    • Example:

      <string name="hello" lang="fr">Bonjour</string>
  112. What is the difference between onCreateView and onViewCreated in Fragments?

    • Type: Conceptual

    • Expected Answer: onCreateView creates the view, onViewCreated runs after view creation.

  113. How do you implement a custom recycler view item decoration?

    • Type: Coding Challenge

    • Expected Answer:

      class MyItemDecoration : RecyclerView.ItemDecoration() {
          override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
              outRect.top = 16
          }
      }
  114. What is the role of the Android Studio Logcat?

    • Type: Conceptual

    • Expected Answer: Displays app logs for debugging.

  115. How do you implement a custom navigation drawer in Android?

    • Type: Coding Challenge

    • Expected Answer:

      DrawerLayout().apply {
          addDrawerListener(object : DrawerLayout.DrawerListener {
              override fun onDrawerOpened(drawerView: View) {}
              override fun onDrawerClosed(drawerView: View) {}
          })
      }

Conclusion

This comprehensive guide of 155 Android Mobile App Development interview questions for 2025 equips you with the knowledge to excel in technical interviews. Spanning beginner to expert levels, these questions include real-world scenarios, coding examples, and practical challenges to prepare you for competitive exams and real-world applications. Practice the examples, master Kotlin and Android SDK, and explore resources like Android Developer Docs, Medium, and DZone for further study. Ace your Android interview and secure your dream role in 2025!

No comments:

Post a Comment

Thanks for your valuable comment...........
Md. Mominul Islam

Post Bottom Ad

Responsive Ads Here