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
Explain the concept of intents and intent filters
Intents are message objects that request an action from a component
Intent filters allow the system to find a suitable component
What’s the difference between implicit and explicit intents
Explicit intents specify the target component, while implicit intents allow the system to find a suitable component
What is the purpose of that Android SDK
A set of development tools and APIs provided by Google for building Android apps
What is the Android Debug Bridge (ADB)
A command-line tool for communicating with a connected Android device
What’s the difference between emulators and simulators
Emulators simulate the entire hardware and software, while simulators only simulate the software
What is the role of the R file in an Android Project
Contains resource identifiers generated by the android build system
What is the difference between a layout and a view
Layout contains views, while a view is a UI element displayed on the screen
What are the different types of layouts in Android
Linear layout, relative layout, constraint layout, frame layout, android table layout
What is the purpose of the Android Resource Manager
Manages non-code resources like images, strings, and layouts
Explain the concept of density-independent pixels (DP)
A unit of measurement for UI elements that adapts to different screen densities
What is the android asset Pipeline
Compiles and packages app resources for different device configurations
What is the difference between a drawable and a mipmap
Drawables are general-purpose images, while mipmaps are optimized for different screen densities
What is the purpose of the build.gradle file
Configures the build process for an Android project
What is the android Gradle plugin
A plugin that extends the Gradle build system for Android projects
What is dependency injection
A software design pattern for providing dependencies to components
What is the purpose of Dagger
A dependency injection framework for Android
What is a RecyclerView
A flexible view for displaying large lists of data efficiently
What is a CardView
A layout for displaying information inside a card with a shadow
What is a ViewPager
A container for dynamically adding and removing views
What is a TabLayout
A component for displaying tabs to switch between different views in a ViewPager
What is a CoordinatorLayout
A flexible layout that allows you to create complex layouts with fewer nested views
What is a Navigation Drawer
A side drawer that displays navigation options
What is a Bottom Navigation Bar
A Navigation bar at the bottom of the screen for switching between top-level destinations
What is a Progress Bar
A visual indicator of progress
What is a ProgressDialog
A dialog that displays progress information
What is the difference between a ProgressDialog and a Progress Bar
A ProgressDialog is a dialog-style progress indicator, while a Progress Bar is a view that can be embedded in other layouts
What is a Toast
A short message displayed at the bottom of the screen
What is a Snackbar
A message displayed at the bottom of the screen with an optional action
What is the lifecycle of a Fragment
Similar to an Activity, but with additional states
onAttach(),
onCreate(),
onCreateView(),
onViewCreated(),
onStart(),
onResume(),
onPause(),
onStop(),
onSaveInstanceState(),
onDestroyView(),
onDestroy(),
onDetach()
What is the difference between a back stack and a fragment back stack
Back stack manages the history of activities, while a fragment back stack manages the history of fragments within an Activity
What is the purpose of the View model class
In MVVM, It separates the UI from the business logic, while also storing data used by activities or fragments so it survives configuration changes
What is the purpose of the LiveData class
Observable data holder that updates UI automatically when data changes
What is the purpose of the Room persistence library
An abstraction layer over SQLite for accessing database data
What is the purpose of Retrofit
A type-safe HTTP client for making network requests