The presentation introduces the reader to the principles of user interaction in Android applications. First, events are introduced, together with the related concepts of callbacks and event listeners. It follows a discussion on how to handle events in a declarative fashion via the XML layout file.
An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map.
Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
An application usually consists of multiple activities that are loosely bound to each other. Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. Each activity can then start another activity in order to perform different actions.
Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack .
When a new activity starts, it is pushed onto the back stack and takes user focus.
This Presentation will give u information about Android :
1. Implicit Intent Overview (Action, Data, category, etc)
2. How intent works How intent filter works and writing our own intent filters
This set of slides introduces the reader to the concepts of Android Activities and Views. After presenting these two concepts in general terms, it continues with a detailed description of the activity lifecycle. It follows a discussion on how to structure the user interface in terms of View and ViewGroup objects. Finally, the presentation shows how to frame Android application development within the dictates of the Model-View-Controller (MVC) pattern.
An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map.
Each activity is given a window in which to draw its user interface. The window typically fills the screen, but may be smaller than the screen and float on top of other windows.
An application usually consists of multiple activities that are loosely bound to each other. Typically, one activity in an application is specified as the "main" activity, which is presented to the user when launching the application for the first time. Each activity can then start another activity in order to perform different actions.
Each time a new activity starts, the previous activity is stopped, but the system preserves the activity in a stack .
When a new activity starts, it is pushed onto the back stack and takes user focus.
This Presentation will give u information about Android :
1. Implicit Intent Overview (Action, Data, category, etc)
2. How intent works How intent filter works and writing our own intent filters
This set of slides introduces the reader to the concepts of Android Activities and Views. After presenting these two concepts in general terms, it continues with a detailed description of the activity lifecycle. It follows a discussion on how to structure the user interface in terms of View and ViewGroup objects. Finally, the presentation shows how to frame Android application development within the dictates of the Model-View-Controller (MVC) pattern.
A complete Lab Manual with Aim, Procedure, Source Code, ... All the Experiments of Mobile Application Development Lab are developed using Android Studio.
Use of TextField, Label, Sliders and Switch buttons
Handling ActionSheet and Alerts
Application Delegates
Handling ActionSheet and Alerts
Application Delegates
UIApplication Delegates
View Controllers
Life Cycle of Application & Methods
ARC
iPhone App Development Training Programme (contd.)
Mobile Application Development, EVENT HANDLING
Android -Event Handling
•Event Listeners−An event listener is an interface in the View class that contains a single callback method. These methods will be called by the Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the UI.
•Event Listeners Registration−Event Registration is the process by which an Event Handler gets registered with an Event Listener so that the handler is called when the Event Listener fires the event.
•Event Handlers−When an event happens and we have registered an event listener for the event, the event listener calls the Event Handlers, which is the method that actually handles the event.
Event Handlers
#MobileApplicationDevelopment
Presentation on getting started with the Swiz framework for Adobe Flex. It concentrates on solving problems around IoC, dependency injection, event handling and interacting with external services.
A comprehensive guide on developing responsive and common react filter componentKaty Slemon
A blog that will help you develop a responsive and common React Filter Component for both desktop and mobile views to maintain consistency across the UI.
An introduction to resource management in Android. Namely, the presentation discusses how to correctly account for different screen densities and sizes.
The presentation deals with the problem of persistence when writing Android applications. After a general discussion on the capabilities of SQLite, the repository pattern (which allows the centralization all persistence concerns) is introduced. Then, the lifecycle of the SQLiteOpenHelper class is discussed, including how to correctly account for changes in the database schema between application updates. Finally, the concept of object-relational mapping (ORM) is introduced, together with a discussion and how the repository pattern helps isolating such a concern from the business logic code.
An introduction to Intents in Android. First, the presentation introduces the concept of Intents as messages between application components. Then, the difference between implicit and explicit intents is clearly stated, along with a description of the Intent resolution mechanism. The presentation concludes with a step-by-step tutorial on how to cast and intercept Intents from Activities.
Introduction to the basic aspects of application development in Android. The basic components, e.g., Activity and View, are introduced along with the different configuration files, e.g., AndroidManifest.xml.
This set of slides introduces the basics of the Android development framework and mobile development in general. First, a brief overview on the history of mobile development is introduced. Then, the architecture of the Android platform is discussed, commenting on the role and functionalities of each architectural layer.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024Neo4j
Neha Bajwa, Vice President of Product Marketing, Neo4j
Join us as we explore breakthrough innovations enabled by interconnected data and AI. Discover firsthand how organizations use relationships in data to uncover contextual insights and solve our most pressing challenges – from optimizing supply chains, detecting fraud, and improving customer experiences to accelerating drug discoveries.
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfPeter Spielvogel
Building better applications for business users with SAP Fiori.
• What is SAP Fiori and why it matters to you
• How a better user experience drives measurable business benefits
• How to get started with SAP Fiori today
• How SAP Fiori elements accelerates application development
• How SAP Build Code includes SAP Fiori tools and other generative artificial intelligence capabilities
• How SAP Fiori paves the way for using AI in SAP apps
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
Dr. Sean Tan, Head of Data Science, Changi Airport Group
Discover how Changi Airport Group (CAG) leverages graph technologies and generative AI to revolutionize their search capabilities. This session delves into the unique search needs of CAG’s diverse passengers and customers, showcasing how graph data structures enhance the accuracy and relevance of AI-generated search results, mitigating the risk of “hallucinations” and improving the overall customer journey.
PHP Frameworks: I want to break free (IPC Berlin 2024)Ralf Eggert
In this presentation, we examine the challenges and limitations of relying too heavily on PHP frameworks in web development. We discuss the history of PHP and its frameworks to understand how this dependence has evolved. The focus will be on providing concrete tips and strategies to reduce reliance on these frameworks, based on real-world examples and practical considerations. The goal is to equip developers with the skills and knowledge to create more flexible and future-proof web applications. We'll explore the importance of maintaining autonomy in a rapidly changing tech landscape and how to make informed decisions in PHP development.
This talk is aimed at encouraging a more independent approach to using PHP frameworks, moving towards a more flexible and future-proof approach to PHP development.
Unlocking Productivity: Leveraging the Potential of Copilot in Microsoft 365, a presentation by Christoforos Vlachos, Senior Solutions Manager – Modern Workplace, Uni Systems
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
Elevating Tactical DDD Patterns Through Object CalisthenicsDorra BARTAGUIZ
After immersing yourself in the blue book and its red counterpart, attending DDD-focused conferences, and applying tactical patterns, you're left with a crucial question: How do I ensure my design is effective? Tactical patterns within Domain-Driven Design (DDD) serve as guiding principles for creating clear and manageable domain models. However, achieving success with these patterns requires additional guidance. Interestingly, we've observed that a set of constraints initially designed for training purposes remarkably aligns with effective pattern implementation, offering a more ‘mechanical’ approach. Let's explore together how Object Calisthenics can elevate the design of your tactical DDD patterns, offering concrete help for those venturing into DDD for the first time!
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...DanBrown980551
Do you want to learn how to model and simulate an electrical network from scratch in under an hour?
Then welcome to this PowSyBl workshop, hosted by Rte, the French Transmission System Operator (TSO)!
During the webinar, you will discover the PowSyBl ecosystem as well as handle and study an electrical network through an interactive Python notebook.
PowSyBl is an open source project hosted by LF Energy, which offers a comprehensive set of features for electrical grid modelling and simulation. Among other advanced features, PowSyBl provides:
- A fully editable and extendable library for grid component modelling;
- Visualization tools to display your network;
- Grid simulation tools, such as power flows, security analyses (with or without remedial actions) and sensitivity analyses;
The framework is mostly written in Java, with a Python binding so that Python developers can access PowSyBl functionalities as well.
What you will learn during the webinar:
- For beginners: discover PowSyBl's functionalities through a quick general presentation and the notebook, without needing any expert coding skills;
- For advanced developers: master the skills to efficiently apply PowSyBl functionalities to your real-world scenarios.
3. Wrap-up: Activity
¤ An activity is a single, focused thing that the user can do
¤ Example: visualize the to-do list
3
declared
in
implemented
in
described in
associated with
4. Wrap-up: View
¤ The view is the basic building block for user interface
components
¤ A view can be seen as a widget which has an
appearance on the screen
¤ Examples: buttons, textboxes
¤ A view is responsible for:
¤ Drawing a piece of user interface
¤ Handling the events performed by the user (on itself)
4
5. Wrap-up: ViewGroup
¤ A ViewGroup is a special View that contains other views
¤ A ViewGroup can be seen as an invisible container that
organizes the contained views in a specific layout
¤ Linear layout: organizes its children into
a single horizontal or vertical row
¤ Relative layout: specifies manually the
location of each contained view
(relatively to the parent or other children)
5
6. Wrap-up: ViewGroup
¤ A special ViewGroup is the ScrollView
¤ It allows to scroll its content up and down
6
7. The starting point:
ToDoListActivity
7
What we want to achieve:
ü Scrollable view
ü LinearLayout viewgroup
enclosing the content
ü Static checkbox (string is
read from resources)
8. The starting point: User interface
¤ We need to define the user interface elements:
¤ Scrollable view
¤ LinearLayout viewgroup
¤ Static checkbox
¤ The definition of these elements is located in:
8
9. The starting point: User interface
¤ We need to define the user interface elements:
¤ Scrollable view
¤ LinearLayout viewgroup
¤ Static checkbox
¤ The definition of these elements is located in:
res/layout/activity_to_do_list.xml
(description of the activity layout)
9
16. Events
¤ User interacts with the interface so as to execute specific
tasks
¤ Every action the user performs while interacting with the
user interface triggers an event
¤ Examples: click, hardware key press, touch
¤ The application captures the event and consequently
adopts a specific behavior in response of that event
¤ A note for the Web developers: the approach is totally
similar to the one that you adopt when using JavaScript
16
17. Handling events
¤ Each action is performed on a specific element of the
user interface
¤ Example: the action of clicking on a button
¤ Hence, each View is responsible for handling those
events resulting from the interaction between the user
and the View itself
¤ Example: the button, when clicked, starts the procedure for
handling the event
17
18. Handling events
¤ Two possible ways of handling events:
¤ Callback methods: each View class provides public
methods meant to handle user interaction, e.g.,
onTouchEvent()
¤ Event listeners: the View delegates the event handling
responsibility to dedicated event listeners
18
19. Callback methods
Methods Description
onKeyDown(int, KeyEvent) called when a new key event occurs
onKeyUp(int, KeyEvent) called when a key up event occurs
onTrackballEvent(MotionEvent) called when a trackball motion event
occurs
onTouchEvent(MotionEvent) called when a touch screen motion
event occurs
19
20. Callback methods
¤ A callback method is automatically called by the
Android framework when the related event occurs on
that View
20
onClick() {
…
}
21. Callback methods
¤ Problem: to use the callback method approach, you
have to extend the View class of interest and override
those methods
¤ It may be the case that you want to extend a View class
for some reason
¤ Example: perhaps you want to extend the Button class to
make something fancier
21
22. Callback methods
¤ However, extending a whole class just to handle user
interaction does not seem practical
¤ Dozens of different interactions could be needed
¤ Thus, this procedure does not scale well
22
.
.
.
23. Event listeners
¤ The View class defines several nested interfaces, each of
which meant to respond to a specific event
¤ Such interfaces are called event listeners
¤ Examples: View.OnClickListener, View.OnKeyListener
¤ Event listeners can be registered to a View
¤ Each event listener handles a specific event on behalf of the
View it has been registered to
¤ Examples: a View.OnClickListenerlistener can manage
click events on behalf of a CheckBox view
23
24. Event listeners
¤ Inheritance is no longer needed, it is sufficient to create
the correct event listener and register it to the View
24
.
.
.
event1
event2
eventN
25. Event listeners
¤ Still, we do not know where to place the code that will
be executed in response to the event
25
View.OnClickListener
onClick() {
someActions;
}
26. ¤ Each event listener interface exposes a callback method
¤ This method will be invoked whenever the user interacts with
the View
¤ Example: The View.OnClickListener interface defines
an onClick() method that will be called each time the
View is clicked
Event listeners
26
onClick() {
…
}
27. Handling events with event listeners
¤ Two steps are needed to handle events via event
listeners:
¤ Implementing the event listener interface:
¤ Registering the event listener object to the View:
27
// create an anonymous implementation of OnClickListener
private OnClickListener myListener = new OnClickListener() {
public void onClick(View v) {
// do something when the button is clicked
}
};
Button button = (Button)findViewById(R.id.buttonId);
button.setOnClickListener(myListener);
28. Examples of event listeners
Event listener Callback method Description
View.OnClickListener onClick() called when the user
touches the item
View.OnLongClickListener onLongClick() called when the user
touched and holds the
item
View.OnKeyListener onKey() called when the user
presses or release a key
28
¤ The complete list of event listeners is available here
29. Alternative event handling
¤ You can assign a method to your button in the XML
layout, using the android:onClick attribute
¤ When the user clicks the button, the Android framework
calls the method MyActivity.myClickMethod(View)
¤ The View that is passed as parameter is a reference to the
button that was clicked
29
<Button
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="@string/myButtonText"
android:onClick="myClickMethod" />
32. TakeNotes v2: create onClick
listeners
¤ The event we handle is the user click on a checkbox
32
retrieve the list
for each checkbox list
add OnClickListener;
2
33. TakeNotes v2: create onClick
listeners
¤ We modify the ToDoListActivity class so as to add the
required listeners
33
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_to_do_list);
LinearLayout linearLayout = (LinearLayout)
findViewById(R.id.checkBoxContainer);
for (int i = 0; i < linearLayout.getChildCount(); i++)
addOnClickListener(linearLayout.getChildAt(i));
}
A listener is added to each layout
child (i.e., to each checkbox)
Read from the
res/layout file
34. TakeNotes v2: create onClick
listeners
¤ We add a listener to each checkbox by using the
setOnClickListener method:
34
private void addOnClickListener(View view) {
if (view.getClass() == CheckBox.class) {
CheckBox checkBox = (CheckBox) view;
checkBox.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onCheckBoxClicked(v);
}
});
}
}
Home-made method which
contains the logic used for handling
the event
35. TakeNotes v2: how to handle the
click?
¤ At the current state we have create a method that is
woken up each time the user touches a checkbox
¤ The expected behavior is the one of showing an alert,
asking for confirmation
35
36. TakeNotes v2: how to handle the
click?
¤ At the current state we have create a method that is
woken up each time the user touches a checkbox
¤ The expected behavior is the one of showing an alert,
asking for confirmation
36
These are buttons too, thus
other listeners that handle
the onClick() event on
them are needed
37. ConfirmDialogListener for
confirming an action
¤ This listener, when the onClick event is captured,
requires to remove the checkbox from the to do list
37
public class ConfirmDialogListener implements OnClickListener {
private View clickedView;
@Override
public void onClick(DialogInterface dialog, int which) {
LinearLayout layout = (LinearLayout)clickedView.getParent();
layout.removeView(clickedView);
}
}
Here we store a reference
to the clicked checkbox
We remove the clicked checkbox
from the set of children of the layout
object. From now on the checkbox
will not be displayed anymore
38. ConfirmDialogListener for
confirming an action
¤ onClick() receives two parameters:
¤ DialogInterface dialog: the dialog that received the
click
¤ int which: the button that was clicked
38
39. DiscardDialogListener for
canceling the action
¤ This listener, when the onClick event is captured, restores
the check status on the clicked checkbox
39
public class DiscardDialogListener implements OnClickListener {
private View clickedView;
@Override
public void onClick(DialogInterface dialog, int which) {
if (clickedView.getClass() == CheckBox.class) {
CheckBox checkBox = (CheckBox)clickedView;
checkBox.setChecked(false);
}
}
}
Here we store a reference
to the clicked checkbox
Since the user clicked on the checkbox, its state is
“checked”. However, the to do item was not
performed, so we need to remove the check from
the checkbox by restoring the “not checked” state
40. TakeNotes v2: answering to the to do
deletion request
40
public void onCheckBoxClicked(View view) {
Resources resources = getResources();
ConfirmDialogListener confirmListener = new ConfirmDialogListener(view);
DiscardDialogListener discardListener = new DiscardDialogListener(view);
AlertDialog alertDialog = new AlertDialog.Builder(ToDoListActivity.this)
.setTitle([title in resources])
.setMessage([message in resources])
.setPositiveButton([name in resources], confirmListener)
.setNegativeButton([name in resources], discardListener)
.create();
alertDialog.show();
}
NOTE:
ü A Dialog is a little popup window carrying a message
ü An AlertDialog is a dialog that can display one, two or three buttons
42. Event handling vs. layout file
Callback methods
¤ Already present in the
View class
Event listeners
¤ Nested interfaces +
Customized implementation
42
.
.
.
.
.
.
43. Event handling vs. layout file
¤ Sometimes there are views that do not need to change
during run-time
43
The “+” button
ü Used to add new items to the list
ü It is loaded at runtime
ü Its behavior remains unchanged
during the execution
ü Its aspect remains unchanged
during the execution
44. Event handling vs. layout file
Changes on the view
¤ Causes
¤ It is created during the
execution (e.g., new to-
do item)
¤ Approach
¤ The listener is added
programmatically
¤ Example
¤ Checkboxes vs. onClick
View is unaltered
¤ Causes
¤ It represents a static
behavior of the
application
¤ Approach
¤ Define its aspect and
behavior in layout file
¤ Example
¤ “+” button
44
45. Event handling vs. layout file
45
associated
with
described in
This is a reference to the
button that was clicked
46. Event handling vs. layout file
¤ To correctly locate the callback method from its name as
specified in the layout file, the callback method must:
¤ Be public
¤ Have a void return value
¤ Specify a View as the only parameter (i.e., the View that was
clicked)
¤ Example: public void addNewToDo(View v)
46
47. TakeNotes v3: add a new item
¤ In the previous TakeNotes version we have seen how to
delete an item from the to do list
¤ We are now going to add a new item to the do to list
¤ Use case:
¤ The user presses the + button
¤ A form appears, requiring the item description
¤ The user inserts the text and confirms the action
¤ The new checkbox appears in the to do list
47
48. TakeNotes v3: The + button
¤ We define a + button that, if clicked, starts the procedure
used for adding an item to the to do list
¤ where the requireNewToDo is a method defined in the
ToDoListActivity class that will be invoked when the
user clicks the button
48
<Button android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/button_requireAdd"
android:onClick="requireNewToDo"/>