android objective question

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

50 Objective Questions Based on the Android app development

1. Overview of Open Source Mobile Technology and Android Development

1. What is the main advantage of open-source mobile technology?


a) High licensing cost
b) Closed-source development
c) Free and customizable software
d) Limited community support
Answer: c) Free and customizable software
2. What is Android?
a) A web server
b) An open-source operating system for mobile devices
c) A hardware platform
d) A desktop operating system
Answer: b) An open-source operating system for mobile devices
3. Which organization leads the development of Android?
a) Google
b) Apple
c) Microsoft
d) Oracle
Answer: a) Google
4. What is the Open Handset Alliance?
a) A group of companies developing hardware
b) A consortium for Android app distribution
c) A group of companies promoting Android
d) None of the above
Answer: c) A group of companies promoting Android
5. Which file type is used to package Android applications?
a) .exe
b) .apk
c) .msi
d) .jar
Answer: b) .apk
6. What does AVD stand for in Android development?
a) Android Virtual Device
b) Android Visual Development
c) Advanced Virtual Deployment
d) Application Virtual Debugging
Answer: a) Android Virtual Device
7. What is the role of the Android SDK?
a) Provides tools for hardware integration
b) Manages database systems
c) Facilitates Android application development
d) Optimizes system performance
Answer: c) Facilitates Android application development
8. Which IDE is most commonly used for Android development?
a) IntelliJ IDEA
b) Eclipse
c) Android Studio
d) Visual Studio
Answer: c) Android Studio
9. Where can Android applications be published?
a) Google Play Store
b) Android App Marketplaces
c) Both a and b
d) None of the above
Answer: c) Both a and b
10. Which component emulates an Android device for testing?
a) Emulator
b) Debugger
c) Compiler
d) Processor
Answer: a) Emulator

2. Android Architecture Framework

11. Which layer forms the foundation of Android architecture?


a) Libraries
b) Linux Kernel
c) Android Runtime
d) Application Framework
Answer: b) Linux Kernel
12. What does the Android Runtime include?
a) SQLite and Media Framework
b) Dalvik Virtual Machine and Core Libraries
c) Java Compiler
d) Application Services
Answer: b) Dalvik Virtual Machine and Core Libraries
13. What is the role of the Zygote in Android?
a) To start services
b) To preload system resources and manage application processes
c) To compile applications
d) To provide user permissions
Answer: b) To preload system resources and manage application processes
14. What is the function of the Android Manifest file?
a) To compile source code
b) To define application permissions and components
c) To configure hardware
d) To store application data
Answer: b) To define application permissions and components
15. What is the purpose of Android Debug Bridge (ADB)?
a) To build APK files
b) To provide communication between a device and a developer
c) To manage application lifecycle
d) To run the Zygote process
Answer: b) To provide communication between a device and a developer
16. Which component provides a UI interaction layer for Android?
a) Linux Kernel
b) Application Framework
c) Libraries
d) Android Runtime
Answer: b) Application Framework
17. What is stored in the Android Libraries layer?
a) User data
b) Hardware instructions
c) C and C++ core libraries for media, graphics, and database handling
d) Application files
Answer: c) C and C++ core libraries for media, graphics, and database handling
18. What permission model does Android use?
a) Open permission
b) Role-based permissions
c) User-granted permissions defined in the manifest
d) Dynamic permissions only
Answer: c) User-granted permissions defined in the manifest
19. Which process ensures Android applications run in isolation?
a) Sandboxing
b) Threading
c) Garbage Collection
d) Root Access
Answer: a) Sandboxing
20. What does the application layer contain in Android?
a) System services
b) Application Framework
c) User applications
d) Device drivers
Answer: c) User applications

3. Android UI Layout Design

21. What are the fundamental building blocks of an Android application?


a) Activities, Services, Broadcast Receivers, Content Providers
b) Zygote, Kernel, Libraries, SDK
c) Threads, Processes, Handlers
d) Emulator, Device, Debugger
Answer: a) Activities, Services, Broadcast Receivers, Content Providers
22. Which lifecycle method is called when an Activity starts?
a) onDestroy()
b) onStart()
c) onResume()
d) onPause()
Answer: b) onStart()
23. Which property ensures layouts scale properly across devices?
a) px
b) dp
c) sp
d) Both b and c
Answer: d) Both b and c
24. Which layout organizes elements in a row or column?
a) LinearLayout
b) RelativeLayout
c) GridLayout
d) FrameLayout
Answer: a) LinearLayout
25. What is a Drawable resource used for?
a) String storage
b) Displaying images or shapes
c) Database management
d) Layout definition
Answer: b) Displaying images or shapes

(Continued in next part...)

4. Event-Driven Programming in Android

26. Which method is called when a button is clicked in Android?


a) onClick()
b) onPressed()
c) onTap()
d) onFocus()
Answer: a) onClick()
27. What is the purpose of a splash screen?
a) To display a dialog box
b) To show a temporary screen while the application is loading
c) To handle button events
d) To store data in SQLite
Answer: b) To show a temporary screen while the application is loading
28. Which thread runs UI operations in Android?
a) Worker Thread
b) Main Thread
c) Background Thread
d) Daemon Thread
Answer: b) Main Thread
29. What is the first method called when an Activity starts?
a) onCreate()
b) onStart()
c) onResume()
d) onDestroy()
Answer: a) onCreate()
30. Which Android component handles broadcasting system-wide events?
a) Service
b) Broadcast Receiver
c) Content Provider
d) Intent
Answer: b) Broadcast Receiver

5. Menus, Dialog Boxes, and Toast

31. Which menu type is system-defined?


a) Context Menu
b) System Menu
c) Custom Menu
d) Hardware Menu
Answer: b) System Menu
32. What is a Toast in Android?
a) A message box requiring user interaction
b) A temporary popup message
c) A persistent notification
d) A menu option
Answer: b) A temporary popup message
33. Which XML file is used to define menu options?
a) menu.xml
b) layout.xml
c) strings.xml
d) colors.xml
Answer: a) menu.xml
34. What method is used to create a custom AlertDialog?
a) create()
b) build()
c) setView()
d) show()
Answer: a) create()
35. Which method is used to inflate a menu in Android?
a) inflateMenu()
b) onCreateOptionsMenu()
c) onPrepareMenu()
d) setupMenu()
Answer: b) onCreateOptionsMenu()

6. Database Applications in Android

36. What is SQLite in Android?


a) A type of file system
b) A lightweight database for local storage
c) A web service for cloud databases
d) An external library for networking
Answer: b) A lightweight database for local storage
37. Which class is used to create or open a database in Android?
a) SQLiteDatabase
b) DatabaseManager
c) OpenHelper
d) SQLiteHelper
Answer: d) SQLiteHelper
38. Which method is used to execute SQL queries in SQLite?
a) executeQuery()
b) execSQL()
c) runSQL()
d) fetchSQL()
Answer: b) execSQL()
39. What does the onCreate() method in SQLiteOpenHelper do?
a) Closes the database
b) Executes when the database is created for the first time
c) Deletes the database
d) Updates database schema
Answer: b) Executes when the database is created for the first time
40. Which data type is used to store text in SQLite?
a) TEXT
b) VARCHAR
c) STRING
d) CHAR
Answer: a) TEXT
41. Which method is used to insert data into an SQLite database?
a) insert()
b) add()
c) put()
d) write()
Answer: a) insert()
42. How do you close an SQLite database?
a) stop()
b) close()
c) terminate()
d) delete()
Answer: b) close()
43. What method retrieves data from an SQLite database?
a) fetch()
b) query()
c) get()
d) retrieve()
Answer: b) query()
44. What does ContentValues class do in Android?
a) Maps key-value pairs for database operations
b) Handles UI events
c) Manages files in external storage
d) Creates system logs
Answer: a) Maps key-value pairs for database operations
45. Which permission is required to access SQLite databases?
a) WRITE_DATABASE
b) None (SQLite does not require explicit permissions)
c) DATABASE_ACCESS
d) READ_STORAGE
Answer: b) None

General and Miscellaneous Questions

46. What file extension does Android Manifest use?


a) .json
b) .xml
c) .apk
d) .txt
Answer: b) .xml
47. Which method is called to pause an Activity?
a) onStop()
b) onPause()
c) onDestroy()
d) onCreate()
Answer: b) onPause()
48. What does "dp" stand for in Android design?
a) Density Pixel
b) Device Pixel
c) Dynamic Pixel
d) Default Pixel
Answer: a) Density Pixel
49. What does the Intent class do?
a) Sends messages between components
b) Handles UI layout
c) Manages threads
d) Accesses databases
Answer: a) Sends messages between components
50. Which lifecycle method is always called before an Activity is destroyed?
a) onPause()
b) onDestroy()
c) onStop()
d) onResume()
Answer: b) onDestroy()

You might also like