Basics Flashcards
What is the android architecture component
A collection of libraries that help you design robust, testable and maintainable apps
Difference between activity and fragment
Activity is a single, focused thing that the user can do. Fragment is a modular piece of an activity than can be reused
What is a service
A component that runs in the background to perform long-running operations
What is an intent
A message object used to request an action from another component
Explain the android lifecycle
The series of states an activity goes through from creation to destruction.
List all lifecycle states
onCreate()
onStart() <— onRestart() ——-v
onResume()
Activity Running
onPause()
onStop() —> onRestart () ——-^
onDestroy()
What’s the difference of AsyncTask and Loader
AsynkTask for short background tasks like downloading a small image.
Loader for loading data from a content provider like fetching contacts
What is Content Provider
A component that manages a shared set of data, like contacts, or calendar events
What is the difference between SharedPreferences and SQLite
SharedPreferences is for storing simple key-value data like user settings.
SQLite is for storing structured data, like a database of contacts
Explain the role of the AndoidManifest.xml file
Declares components, permissions, and other information about the app
What’s the difference between a hard and a soft reference
A hard reference prevents an object from being garbage collected, while a soft reference allowed it to be collected under memory pressure
What is an activity
Is a single screen in an android app that represents the user interface
What is a fragment
A modular piece of an activity that can be reused in different layouts
What is AsyncTask
A class that performs background operations and publishes results on the UI thread
What is a Loader
A component that asynchronously loads Data from a content provider in the background and delivers it to the UI
(Deprecated, use viewmodel and live data)
What is SharedPreferences
A simple way to store key-value pairs of data, like user preferences
What’s is SQLite
A lightweight database for storing structured data like contacts
What’s is a hard reference
A direct reference to an object that prevents it from being garbage collected
What is a soft reference
A reference to an object that allows it to be garbage collected under memory pressure
What is a soft reference
A weak reference to an object that allows it to be garbage collected under memory pressure
What is a Broadcast receiver
A component that responds to system-wide broadcast announcements
What is a notification
A message displayed to the user outside the app’s UI