MODISM ppt in maam quiz Flashcards
are used to target a specific app or component within an app.
explicit intents
Explicit Intents - By specifying either the____ of the target app or the ____ of the component (like an activity or service), you ensure that the intent is directed to a particular component
package name, full class name
By specifying either the package name of the target app or the full class name of the component (like an activity or service), you ensure that the intent is directed to a particular component
Explicit Intents
especially useful when you want a precise action from a known part of the app or when you’re starting a specific activity within the same app
Explicit Intents
are more general; they don’t specify a particular app or component and rely on the system to choose an appropriate app to handle the request based on the type of action and data provided
implicit intents
used when you want the system to find an appropriate app to perform a specific action, such as opening a webpage, sending an email, or sharing content.
Implicit intents
Starting with ______, Android introduced heads-up notifications
Android 5.0 (Lollipop)
Starting with Android 5.0 (Lollipop), Android introduced ____
heads-up notifications
appear briefly in a floating window at the top of the screen. overlaying the current content.
notifications
They’re especially useful for time-sensitive notifications, like incoming calls, messages, or urgent reminders, as they grab the user’s attention without requiring them to pull down the notification shade
notifications
Key Features of Head-Up Notifications
Temporary Display, Direct Action, Visibility Priority
Heads-up notifications appear for a few seconds, allowing users to interact with them directly (e.g., answer or dismiss a call)
Temporary Display
User can swipe the notification away or interact with action buttons (like “Reply” for messages or “Accept” for calls) without leaving the current screen
Direct Actions
These notifications are generally used when the priority is set to high, which signals urgency and lets the notifications temporarily overlay the current activity
Visibility Priority
Priority: Setting _________ or ________ is crucial to trigger heads-up behavior
PRIORITY_HIgh, PRIORITY_MAX
Important Points of Notification
Priority, Channel Importance (Android 8.0 and above),
Channel Importance (Android 8.0 and above): Since Android 8.0 (Oreo), notifications are managed in channels, so setting the channel importance to ________ is also necessary for heads-up notifications to work
IMPORTANCE_HIGH
This feature enhances the way critical information is delivered to user without disrupting their activity entirely
Notifications
are used to detect and respond to different user interactions with the app’s UI components.
Action Listeners
These listeners allow developers to define what happens when users perform actions like clicking a button, selecting an item from a list, or typing into a text field
Action Listeners
specifically designed to respond to clock events on widget-like buttons, text views, images, etc.
OnClickListener
When an OnClickListener is assigned to a _____, it will respond to click events, meaning it only triggers when the user taps on the ______
widget
Touch events are typically handled by ______
OnTouchListener
Focus events are handled by _____
OnFocusChangeListener
The _____ method is triggered when the user taps on button
onClick()
Inside onClick(), you can ____ upon the click
define what should happen
Detects Touch Events
OnTouchListener
This listener detects touch interactions, allowing you to track presses, movements, and releases on the screen
OnTouchListener
Detects Key Press Events
OnKeyListener
This listener is often used to detect key events in an EditText, such as when a user presses the “Enter” key
OnKeyListener
Detects Focus Changes
OnFocusChangeListener
Used for detecting when a view, like an input field, gains or loses focus
OnFocusChangeListener
is a messaging object used to request an action from another app component
Intent
______ facilitates communication between different components
Intent
Intents are two types:
Explicit
Implicit
communicates between two activities inside the same application
Explicit Intents
Communicates between two activities of different application
Implicit Intent
Intents are used to:
Start an Activity
Start a Service (open email, web browser, and calling)
Pass data in same application or different application
Intent is used for ______
Intent are also used in Broadcast Message via ______
Broadcasting message, Broadcast Receiver
Designed for storing and transporting data between different parts of an app, often used in conjunction with Intents
Bundle
The following are the major types that are passed/retrieved to/from a Bundle:
putInt(String key, int value), getInt(String key, int value)
putString(String key, String value), getString(String key, String value)
putStringArray(String key, String[] value), getStringArray(String key, String[] value)
putChar(String key, char value), getChar(String key, char value)
putBoolean(String key, boolean value), getBoolean(String key, boolean value)
is a fundamental aspect of Android app development, allowing your app to respond to user interactions.
Event Handling
These are objects that listen for specific events, such as button clicks, touch gestures, or text input.
Event Listeners
These methods are invoked when the corresponding event occurs. They typically contain the code that defines the app’s response to the event
Event Handling Methods
Used for button clicks
OnClickListener:
This method is called when the button is clicked
onClick(View v):
Used for touch events like touch, press, and release
OnTouchListener
This method is called for each touch event
onTouch(View v, MotionEvent event):
Used to monitor text changes in a TextView
TextWatcher
Called when the text changes
onTextChanged(CharSequence s, int start, int count, int after):
: Called before the text changes
beforeTextChanged(CharSequence s, int start, int count, int after)
: Called after the text changes
afterTextChanged(Editable s)
define the visual structure of your app’s user interface.
Android layouts
They are created using XML files, and you can use various layout types to organize your UI elements;
Android layouts
Arranges views in a single vertical or horizontal line
LinearLayout
Positions views relative to each other or to the parent layout
RelativeLayout
Stacks views on top of each other
FrameLayout
A flexible layout system that allows you to position and size views relative to each other, the parent layout, or guidelines
ConstraintLayout
are the visual building blocks of your app’s UI.
Widgets
Displays text
TextView:
Triggers actions when clicked
Button
Allows users to input text
EditText
Displays images
ImageView
Indicates progress
ProgressBar
Allows user to select a value from a range
SeekBar
Presents a list of items for selection
Spinner
inform users about events that occur outside of their app, such as new messages, alarms or reminders.
Notifications
You can create notifications using the ____ class
NotificationCompat
Key Steps to create a notification:
Create a NotificationChannel, Create a Notification Builder, Set the notification’s content, Set the notification’s intent, Build and show the notification
This is required for Android Oreo and higher
Create a NotificationChannel
This object helps you customize the notification’s appearance and behavior
Create a Notification Builder
This includes the title, text, and any additional details
Set the notification’s content
This defines what happens when the user taps on the notification
Set the notification’s intent
Use the NotificationManager to display the notification
Build and show the notification