MCQ
MCQ
A) build.gradle
B) AndroidManifest.xml
C) MainActivity.java
D) res/layout/activity_main.xml
Answer: B) AndroidManifest.xml
A) src
B) res
C) assets
D) libs
Answer: B) res
A) build.gradle
B) AndroidManifest.xml
C) strings.xml
D) styles.xml
Answer: B) AndroidManifest.xml
A) To hold UI files
5. Which of the following is NOT a valid resource type in the res folder?
A) drawable
B) layout
C) color
D) script
Answer: D) script
A) A background task
D) A broadcast receiver
Answer: B) A UI component for user interaction
A) onPause()
B) onStart()
C) onCreate()
D) onResume()
Answer: C) onCreate()
A) To store data
C) To display UI elements
A) startActivity()
B) startService()
C) startTask()
D) startIntent()
Answer: B) startService()
10. What type of Intent is used to start an Activity within the same application?
A) Implicit Intent
B) Explicit Intent
C) Broadcast Intent
D) Service Intent
Answer: B) Explicit Intent
A) android.permission.INTERNET
B) android.permission.ACCESS_NETWORK_STATE
C) android.permission.READ_EXTERNAL_STORAGE
D) android.permission.WRITE_EXTERNAL_STORAGE
Answer: A) android.permission.INTERNET
A) In AndroidManifest.xml
B) In strings.xml
C) In build.gradle
D) In activity_main.xml
Answer: B) In strings.xml
A) drawable
B) mipmap
C) res
D) layout
Answer: A) drawable
A) ConstraintLayout
B) RelativeLayout
C) LinearLayout
D) FrameLayout
Answer: C) LinearLayout
A) UI layouts
C) Image files
D) Native libraries
Answer: B) String resources, colors, and styles
A) Button
B) TextView
C) EditText
D) ImageView
Answer: B) TextView
A) LinearLayout
B) FrameLayout
C) ConstraintLayout
D) RelativeLayout
Answer: C) ConstraintLayout
C) To create buttons
D) To show images
Answer: B) To allow user input
A) setTextView()
B) setText()
C) updateText()
D) changeText()
Answer: B) setText()
A) RelativeLayout
B) FrameLayout
C) AbsoluteLayout
D) ConstraintLayout
Answer: C) AbsoluteLayout (Note: AbsoluteLayout is deprecated)
C) To create UI layouts
A) SharedPreferences
B) PreferencesManager
C) PrefUtils
D) DataStore
Answer: A) SharedPreferences
A) save()
B) put()
C) edit()
D) commit()
Answer: C) edit() (with a call to commit() or apply())
24. Which of the following can NOT be used to persist data?
A) SQLite Database
B) Shared Preferences
C) Internal Storage
D) UI Thread
Answer: D) UI Thread
A) Jackson
B) Gson
C) Json.org
A) Using HttpURLConnection
B) Using AsyncTask
C) Using Retrofit
28. What is the method used to convert a JSON string to a Java object using Gson?
A) fromJson()
B) toJson()
C) parse()
D) readJson()
Answer: A) fromJson()
A) POST
B) GET
C) PUT
D) DELETE
Answer: B) GET
A) Using Threads
B) Using AsyncTask
C) Using Handlers
A) ImageDisplay
B) ImageView
C) ImageRenderer
D) PictureView
Answer: B) ImageView
A) startAnimation()
B) runAnimation()
C) animate()
D) beginAnimation()
Answer: A) startAnimation()
B) Canvas
C) SurfaceView
A) Graphics
B) Paint
C) Bitmap
D) View
Answer: B) Paint
A) onDraw()
B) draw()
C) render()
D) paint()
Answer: A) onDraw()
C) A layout manager
A) AnimatorSet
B) ObjectAnimator
C) ViewPropertyAnimator
D) All of the above
Answer: D) All of the above
A) <objectAnimator>
B) <animator>
C) <set>
D) <transition>
Answer: A) <objectAnimator>
A) startTransition()
B) beginDelayedTransition()
C) triggerTransition()
D) startLayoutAnimation()
Answer: B) beginDelayedTransition()
A) LinearLayout
B) RelativeLayout
C) ConstraintLayout
D) TableLayout
Answer: C) ConstraintLayout
C) To manage fragments
A) ArrayAdapter
B) BaseAdapter
C) RecyclerView.Adapter
D) SimpleAdapter
Answer: C) RecyclerView.Adapter
A) LinearLayout
B) RelativeLayout
C) FrameLayout
D) ConstraintLayout
Answer: B) RelativeLayout
B) To define an interface
B) A reusable UI component
C) A background service
D) A type of Intent
Answer: B) A reusable UI component
A) onAttach()
B) attachFragment()
C) onCreate()
D) addFragment()
Answer: A) onAttach()
A) To manage UI threads
A) fragment.replace()
B) fragmentTransaction.replace()
C) replaceFragment()
D) switchFragment()
Answer: B) fragmentTransaction.replace()
D) To create animations
Answer: B) To simplify navigation in the app
Networking
B) Volley
C) OkHttp
D) To create animations
Answer: C) To convert API responses into Java objects
B) Manages UI updates
A) 404
B) 500
C) 200
D) 403
Answer: C) 200
A) encryptData()
B) SecureRandom()
C) Cipher.getInstance()
D) hashData()
Answer: C) Cipher.getInstance()
A) User preferences
B) Sensitive information
D) App settings
Answer: B) Sensitive information
A) build.gradle
B) strings.xml
C) AndroidManifest.xml
D) styles.xml
Answer: C) AndroidManifest.xml
A) Optimizes code
B) Obfuscates code
A) Shared Preferences
B) Internal Storage
C) External Storage
D) SQLite Database
Answer: C) External Storage
Advanced Topics
A) Dagger
B) Retrofit
C) Gson
D) OkHttp
Answer: A) Dagger
D) A type of Fragment
Answer: B) A lifecycle-aware data holder
B) A networking library
C) A UI framework
A) Espresso
B) JUnit
C) Robolectric
D) Mockito
Answer: A) Espresso
A) To test the UI
A) Mockito
B) Espresso
C) JUnit
D) Robolectric
Answer: A) Mockito
A) logMessage()
B) Log.i()
C) Log.d()
D) Both B and C
Answer: D) Both B and C
App Lifecycle
A) onStart()
B) onCreate()
C) onResume()
D) onPause()
Answer: B) onCreate()
A) To save UI state
A) onSaveInstanceState()
B) onRestoreInstanceState()
C) onConfigurationChanged()
D) onCreate()
Answer: C) onConfigurationChanged()
C) To create websites
C) To design UI layouts
D) To handle networking
Answer: B) To manage project dependencies and build configuration
B) build.gradle
C) settings.gradle
D) proguard-rules.pro
Answer: B) build.gradle
A) Service
B) Activity
C) BroadcastReceiver
D) ContentProvider
Answer: C) BroadcastReceiver
C) To manage UI updates
D) To display notifications
Answer: A) To perform background operations
A) Android Profiler
B) Logcat
C) ADB
D) To monitor UI updates
Answer: B) To enforce best practices for background tasks
A) onCreate()
B) getView()
C) onBindViewHolder()
D) onRecycleView()
Answer: B) getView()
B) When objects are still referenced after they are no longer needed
86. Which method is called when the Activity is about to go into the background?
A) onPause()
B) onStop()
C) onDestroy()
D) onCreate()
Answer: A) onPause()
C) Simplifies networking
89. Which component is best suited for handling background tasks that need to run
even if the app is not visible?
A) Activity
B) Service
C) Fragment
D) BroadcastReceiver
Answer: B) Service
90. Which of the following is NOT a feature of Kotlin for Android development?
A) Null safety
B) Extension functions
C) Java interoperability
91. Which lifecycle method is called when the Activity comes back to the
foreground?
A) onResume()
B) onStart()
C) onCreate()
D) onPause()
Answer: A) onResume()
C) To manage UI layouts
C) To create animations
A) To manage UI threads
A) AsyncTask
B) Thread
C) WorkManager
D) Service
Answer: C) WorkManager
97. What is the primary role of the Manifest file in an Android application?
A) To store UI layouts
C) To manage dependencies
D) To define animations
Answer: B) To declare app components and permissions
A) getApplicationContext()
B) getContext()
C) getActivity()
D) obtainContext()
Answer: A) getApplicationContext()
A) To define a module
D) To handle networking
Answer: B) To define an entry point for dependency injection
C) It cannot be customized