Android Interview Question and Answer
✅ Android Top 30 Questions and Answers (Hindi)
1. Android क्या है?
उत्तर:
Android एक open-source operating system है जो Google द्वारा Linux kernel पर आधारित बनाया गया है। यह मुख्य रूप से smartphones और tablets के लिए use होता है।
2. Android के मुख्य components कौन-कौन से हैं?
उत्तर:
-
Activities
-
Services
-
Broadcast Receivers
-
Content Providers
3. Activity क्या होती है?
उत्तर:
Activity Android में एक screen को represent करती है। जैसे एक app में multiple screens होती हैं, हर screen एक Activity होती है।
4. Activity Lifecycle के stages कौन-कौन से हैं?
उत्तर:
-
onCreate()
-
onStart()
-
onResume()
-
onPause()
-
onStop()
-
onDestroy()
5. Service क्या है?
उत्तर:
Service background में चलने वाला component है जो बिना UI के काम करता है। जैसे music player background में song play करता है।
6. Intent क्या है?
उत्तर:
Intent एक messaging object है जिसका use components (Activities, Services, Broadcast receivers) को communicate कराने के लिए किया जाता है।
7. Intent के types कौन से हैं?
उत्तर:
-
Explicit Intent (Specific activity/service को start करने के लिए)
-
Implicit Intent (Action perform करने के लिए, जैसे share, open browser)
8. Fragment क्या है?
उत्तर:
Fragment Activity का एक हिस्सा होता है जो UI का reusable part है। इसे multiple screen sizes पर UI design flexible बनाने के लिए use किया जाता है।
9. Adapter क्या है?
उत्तर:
Adapter data source को UI component (ListView, RecyclerView) से connect करता है।
10. RecyclerView क्या है?
उत्तर:
RecyclerView एक advanced और optimized version है ListView का, जो large datasets को efficiently handle करता है।
11. Content Provider क्या है?
उत्तर:
Content Provider का use एक application से दूसरी application में data share करने के लिए किया जाता है।
12. AndroidManifest.xml का use क्या है?
उत्तर:
यह Android application का configuration file है जिसमें app के सभी components declare होते हैं।
13. Android Architecture के main layers कौन से हैं?
उत्तर:
-
Linux Kernel
-
Libraries
-
Android Runtime (ART)
-
Application Framework
-
Applications
14. Dalvik और ART में क्या फर्क है?
उत्तर:
-
Dalvik: पुराने Android versions में use होता था, Just-In-Time (JIT) compilation करता था।
-
ART (Android Runtime): Modern Android versions में use होता है, Ahead-Of-Time (AOT) compilation करता है।
15. ANR (Application Not Responding) क्या है?
उत्तर:
जब main thread पर long operation होता है और UI freeze हो जाता है, तब ANR error आता है।
16. Handler और Looper का use क्यों होता है?
उत्तर:
Handler background thread से main thread पर data update करने के लिए use होता है, और Looper message queue manage करता है।
17. Parcelable और Serializable में क्या फर्क है?
उत्तर:
Parcelable Android-specific है और Serializable से faster है क्योंकि यह memory efficient होता है।
18. Broadcast Receiver क्या है?
उत्तर:
Broadcast Receiver system-wide broadcast events को receive करने के लिए use होता है, जैसे Battery Low, Network Change।
19. SharedPreferences क्या है?
उत्तर:
SharedPreferences key-value pair में small data store करने के लिए use होता है।
20. AsyncTask क्या है?
उत्तर:
AsyncTask background operations perform करने और result UI thread पर show करने के लिए use होती थी (Deprecated now)।
21. ViewModel क्या है?
उत्तर:
ViewModel Android Architecture Component है जो UI data को lifecycle aware तरीके से store करता है।
22. LiveData क्या है?
उत्तर:
LiveData observable data holder class है जो UI components को data change होने पर notify करती है।
23. Room Database क्या है?
उत्तर:
Room एक ORM (Object Relational Mapping) library है जो SQLite database को easy और efficient तरीके से manage करती है।
24. Service के types कौन से हैं?
उत्तर:
-
Foreground Service
-
Background Service
-
Bound Service
25. PendingIntent क्या है?
उत्तर:
PendingIntent future में किसी intent को execute करने के लिए use किया जाता है, जैसे Notification click पर action।
26. ProGuard क्या है?
उत्तर:
ProGuard code shrinking, obfuscation और optimization के लिए use होता है।
27. Multidex क्या है?
उत्तर:
जब app में methods की संख्या 65,536 से ज्यादा हो जाती है, तब multidex enable करना पड़ता है।
28. ANR को कैसे avoid करें?
उत्तर:
-
Long operations को background thread में run करें।
-
UI thread को free रखें।
-
AsyncTask, Handler, Coroutine का use करें।
29. MVVM क्या है?
उत्तर:
MVVM (Model-View-ViewModel) Android architecture pattern है जो UI और business logic को अलग करता है।
30. Jetpack Compose क्या है?
उत्तर:
Jetpack Compose Android का modern UI toolkit है जो declarative तरीके से UI build करने देता है।
✅ 20 Advanced Android Interview Questions & Answers (New Set)
1. Android में JobScheduler क्या है?
उत्तर:
JobScheduler API का उपयोग background tasks को schedule करने के लिए किया जाता है। यह बैटरी optimization और network conditions को ध्यान में रखते हुए काम करता है।
2. WorkManager क्या है और क्यों use होता है?
उत्तर:
WorkManager एक Android Jetpack library है जो background में deferrable और guaranteed tasks को execute करने के लिए use होती है, जैसे data sync या log upload।
3. Coroutines क्या हैं और क्यों popular हैं?
उत्तर:
Coroutines Kotlin में asynchronous programming को simple बनाने के लिए use होते हैं। ये lightweight threads की तरह काम करते हैं और main thread को block नहीं करते।
4. Android में Data Binding क्या है?
उत्तर:
Data Binding एक library है जो XML layouts को सीधे ViewModel या data source से bind करती है, जिससे boilerplate code कम होता है।
5. Dependency Injection क्या है और Android में कैसे use होता है?
उत्तर:
Dependency Injection एक design pattern है जो loosely coupled architecture बनाने के लिए use होता है। Android में Hilt और Dagger 2 सबसे popular DI frameworks हैं।
6. View Binding और Data Binding में क्या फर्क है?
उत्तर:
-
View Binding: केवल views को bind करने के लिए।
-
Data Binding: views + data को bind करता है और binding expressions support करता है।
7. Android में Navigation Component क्या है?
उत्तर:
Navigation Component Android Jetpack का हिस्सा है, जो app में screen navigation (fragment transitions) को आसान और consistent बनाता है।
8. Lifecycle-aware components क्या होते हैं?
उत्तर:
ये ऐसे components होते हैं जो Activity या Fragment के lifecycle को observe कर सकते हैं, जैसे ViewModel, LiveData।
9. DiffUtil क्या है और RecyclerView में क्यों use होता है?
उत्तर:
DiffUtil एक utility class है जो RecyclerView के adapter में efficiently item list updates करने के लिए use होती है।
10. Paging Library क्या है?
उत्तर:
Paging Library का use बड़े datasets को efficiently load करने के लिए किया जाता है, ताकि app memory-efficient रहे।
11. Android में ProGuard और R8 में क्या फर्क है?
उत्तर:
-
ProGuard: Code shrinking और obfuscation के लिए पुराना tool।
-
R8: Modern tool जो ProGuard का replacement है और faster है।
12. Android में ANR trace कैसे analyze करें?
उत्तर:
ANR trace file को /data/anr/traces.txt
में देखा जा सकता है, जिसमें main thread block होने का reason होता है।
13. Cold Start और Warm Start में क्या फर्क है?
उत्तर:
-
Cold Start: जब app पहली बार launch होती है (process memory में नहीं है)।
-
Warm Start: जब app background से foreground में आती है।
14. LeakCanary क्या है?
उत्तर:
LeakCanary एक open-source tool है जो Android apps में memory leaks detect करने के लिए use होता है।
15. Android App Bundle (AAB) क्या है?
उत्तर:
Android App Bundle एक publishing format है जो Google Play को dynamic delivery allow करता है, जिससे app size कम होती है।
16. Instant Apps क्या हैं?
उत्तर:
Instant Apps user को app के कुछ features बिना install किए run करने देती हैं।
17. StrictMode क्या है?
उत्तर:
StrictMode एक developer tool है जो app में accidental disk/network operations को detect करने में मदद करता है।
18. Deep Link और App Link में क्या अंतर है?
उत्तर:
-
Deep Link: किसी specific screen को open करता है, चाहे app installed हो या नहीं।
-
App Link: Verified deep link होता है जो domain verification करता है।
19. Lottie Animation क्या है?
उत्तर:
Lottie एक library है जो JSON-based animations (After Effects से export) को Android apps में render करती है।
20. Android में Security best practices क्या हैं?
उत्तर:
-
ProGuard/R8 का use करें।
-
Sensitive data SharedPreferences में encrypted store करें।
-
HTTPS और SSL pinning का use करें।
-
Room database encryption enable करें।
Comments
Post a Comment