This document discusses key concepts for mobile application development on Android including activities, layouts, menus, dialogs, intents, notifications, and services. It describes how to create an activity by extending the Activity class and setting the user interface. It also explains the different types of layouts, menus, and dialogs available in Android and how to implement them.
This document discusses Android activity lifecycles and lists. It begins with an overview of activity lifecycles, describing the different states an activity can be in such as active, paused, or stopped. Key lifecycle methods like onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy() are explained. The document also covers using a list view widget to display a list of contacts and storing data with shared preferences. Finally, it mentions building a student information project using these concepts.
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.
The document discusses the Android application lifecycle, which describes the steps an app goes through from launch to exit. It includes starting, resuming, pausing, stopping and destroying activities. The lifecycle is managed by callbacks in the Activity class like onCreate(), onResume() and onDestroy(). An app's manifest defines its components and launcher activity using tags like <activity>, <intent-filter> and <category>.
An activity provides a screen for users to interact with an Android application. Activities are organized into a stack and have a lifecycle of states like resumed and paused. To create an activity, you subclass the Activity class and implement callback methods corresponding to lifecycle states like onCreate and onPause. Activities must be declared in the app manifest and can be started with an intent.
The document discusses the activity lifecycle in Android, describing the different states an activity can be in (starting, running, paused, stopped, destroyed) and the methods called during transitions between these states (onCreate, onPause, onResume, onStop, onDestroy). It provides details on the role and proper use of each method, such as initializing resources in onCreate, stopping animations in onPause, and releasing resources in onDestroy. Logging with LogCat is also described as a way to test activity state changes.
The Android life cycle manages activities, which are processes that can be active, paused, stopped, or dead. Activities transition between these states as they come in and out of focus. The Android system uses an activity stack to track activity states and free memory as needed by stopping or killing inactive processes according to priority rules. Developers must be aware of activity life cycle callbacks like onPause() and onStop() to properly save data when an activity moves into the background. Long tasks should also be handled in services or async tasks to avoid application not responding (ANR) errors.
This document provides an overview of Android development. It discusses the Android SDK, Dalvik VM, and differences between Android and Java APIs. It also covers key aspects of building Android apps like activities, intents, services, and UI components. Debugging, optimizations, and the anatomy of an Android app are also briefly discussed.
This document discusses Android activity lifecycles and lists. It begins with an overview of activity lifecycles, describing the different states an activity can be in such as active, paused, or stopped. Key lifecycle methods like onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy() are explained. The document also covers using a list view widget to display a list of contacts and storing data with shared preferences. Finally, it mentions building a student information project using these concepts.
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.
The document discusses the Android application lifecycle, which describes the steps an app goes through from launch to exit. It includes starting, resuming, pausing, stopping and destroying activities. The lifecycle is managed by callbacks in the Activity class like onCreate(), onResume() and onDestroy(). An app's manifest defines its components and launcher activity using tags like <activity>, <intent-filter> and <category>.
An activity provides a screen for users to interact with an Android application. Activities are organized into a stack and have a lifecycle of states like resumed and paused. To create an activity, you subclass the Activity class and implement callback methods corresponding to lifecycle states like onCreate and onPause. Activities must be declared in the app manifest and can be started with an intent.
The document discusses the activity lifecycle in Android, describing the different states an activity can be in (starting, running, paused, stopped, destroyed) and the methods called during transitions between these states (onCreate, onPause, onResume, onStop, onDestroy). It provides details on the role and proper use of each method, such as initializing resources in onCreate, stopping animations in onPause, and releasing resources in onDestroy. Logging with LogCat is also described as a way to test activity state changes.
The Android life cycle manages activities, which are processes that can be active, paused, stopped, or dead. Activities transition between these states as they come in and out of focus. The Android system uses an activity stack to track activity states and free memory as needed by stopping or killing inactive processes according to priority rules. Developers must be aware of activity life cycle callbacks like onPause() and onStop() to properly save data when an activity moves into the background. Long tasks should also be handled in services or async tasks to avoid application not responding (ANR) errors.
This document provides an overview of Android development. It discusses the Android SDK, Dalvik VM, and differences between Android and Java APIs. It also covers key aspects of building Android apps like activities, intents, services, and UI components. Debugging, optimizations, and the anatomy of an Android app are also briefly discussed.
This document discusses user interfaces for Android apps. It begins by introducing activities as the core building block of Android UI. It describes the four states an activity can be in (active, paused, stopped, destroyed) and the lifecycle methods (onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy()) that are called as the activity transitions between states. It then discusses UI resources like layout resources that define the visual structure of an activity's screens using XML files. Finally, it provides an example of a relative layout and how views can be positioned relative to each other or the overall layout.
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.
This document provides an overview of event handling in Advanced Java Programming. It discusses the delegation event model, where a source generates an event and a listener receives the event. It describes different types of events like mouse, keyboard, window events and the classes that represent them. It also covers event listener interfaces that must be implemented by listeners to receive and process events from sources. Key concepts covered are event sources, event objects, event listeners, and the delegation model of separating source and listener logic.
This document provides information about an Android development community and lessons on activities and fragments. It summarizes the key topics covered in an online Android course, including activity and fragment lifecycles, saving persistent data, and communicating between fragments. It also introduces mentors from the community and examples of how to create activities and fragments and handle configuration changes and backgrounding.
An event-driven program relies on events to trigger responses rather than actively polling for user input. Older programs used polling which involved continuously checking for user actions in a loop, wasting CPU resources. Event-driven programs address this by using listeners that wait passively for events from sources like user interactions. When an event occurs, the appropriate listener receives and handles the event without wasting resources on empty polling loops.
The document discusses event handling in Java, describing different types of events like window, mouse, and keyboard events. It explains the event handling process and different event classes. Various listener interfaces are described that can be implemented to handle specific events, such as WindowListener, MouseListener, and KeyListener.
Machines like computers, printers, and webcams have parts like keyboards, CPUs, and monitors that work together using electricity. It is important to be safe when using machines by keeping them away from water, not opening plugged in machines, and not overloading outlets.
The document discusses GUI event handling in Java. It explains that window-based Java programs are event-driven, meaning they wait for and respond to user-initiated events like button clicks or key presses. When an event occurs, an event object is passed to a listener object that handles the event. Listeners implement interfaces that correspond to different event types, like ActionListener for button clicks. The delegation event model in Java handles event passing from components to listeners.
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptxMugiiiReee
This document provides information about activities, menus, intents, services, broadcast receivers and SQLite database in Android. It discusses the activity lifecycle and different types of activities. It explains the concept of intents and how they are used to start activities, services and broadcast receivers. It covers the different types of menus like option menu, context menu and popup menu. It discusses services, their types and lifecycle. It provides details about broadcast receivers, how they receive and respond to broadcast messages. It also gives an overview of SQLite database and how it is used in Android applications for data storage.
This document provides an overview of Android development. It discusses the core components of an Android app including activities, services, content providers, and broadcast receivers. It also covers key concepts like the application lifecycle, intents, and processes/threads. The session aims to give an introduction to the Android ecosystem and components, explain how to create a simple app, and include socializing with beer breaks.
This document provides an overview of Android development including the key components of an Android app. It discusses Activities, Services, Content Providers, Broadcast Receivers, Intents, Views, and common UI elements. It also covers how to start Android development using Android Studio and best practices for handling the UI thread and asynchronous tasks. Notifications are demonstrated as well key layout types and the Play Store.
Data Transfer between Activities & DatabasesMuhammad Sajid
- Services are components that run in the background to perform long-running operations like playing music or handling network transactions. There are three types: foreground, background, and bound.
- The lifecycle of a service includes starting, binding, running, and stopping. Key methods include onStartCommand(), onBind(), onUnbind(), and onDestroy().
- The Android architecture is divided into layers including the Linux kernel, libraries, Android runtime, application framework, and applications. The framework provides high-level services to applications.
Embedded systems contain two main elements: the embedded system hardware and embedded system software. The hardware contains a microprocessor, memory, input/output interfaces, and a display. The embedded system software is written to perform a particular task and is typically stored in firmware on a chip. When developing mobile applications, architects must consider constraints like screen size and storage, choose an appropriate architecture based on factors like available connectivity and user interface needs, and implement effective user interfaces and navigation.
The document provides information about smartphone programming and Android app development. It discusses:
1) The basics of Android app development including that apps are written in Java, compiled into APK files, and require resources like data, code and images.
2) Android app security including how each app runs in its own "sandbox" with unique permissions to access only required components.
3) The main components that make up an Android app - activities, services, broadcast receivers and content providers. It describes what each component represents and its role.
4) Additional topics covered include the Android manifest file, app lifecycles, intents, permissions and more concepts relevant for Android programming.
The document discusses activities, intents, and event listeners in Android. It defines an activity as a single focused thing the user can interact with and explains the activity lifecycle including methods like onCreate, onStart, onResume, etc. It describes intents as messages that allow communication between app components and how they are used to start activities. It also defines event listeners as a way to handle user interactions and collect data on events like button presses. It provides examples of registering different types of event listeners including anonymous inner classes and having the activity implement listener interfaces.
The document discusses the core components of the Android operating system architecture. It describes how Android relies on the Linux kernel for core system services and uses the Dalvik virtual machine to execute applications. It outlines the main OS components including activities, services, broadcast receivers, content providers, and libraries. It explains how applications are packaged and deployed, how components are activated via intents, and the role of the Android manifest file in declaring application building blocks.
An Android activity presents a visual user interface for a focused task. It contains a hierarchy of views that provide the visual content and user interaction. Each activity has a default window and a content view hierarchy set with setContentView(). An application can contain multiple activities, with one specified as the initial activity in the manifest. Activities transition between running, paused, and stopped states, notifying the activity of changes through callback methods like onCreate(), onStart(), onResume(), etc. Activities are managed in a stack, with new activities placed on top and previous activities remaining below until the top activity exits.
An Android activity presents a visual user interface for a focused task. It contains a hierarchy of views that provide interaction and visual content within its window. Activities are declared in the Android manifest file and can launch other activities using intents. An activity transitions through various states as it moves between the foreground and background. The activity lifecycle callbacks notify an activity of state changes like create, start, resume and pause. Activities are managed in a stack, so starting a new activity places it on top of any existing activities.
Presentation for the workshop by Muhammad Azfar Siddiqui of 10Pearls on the topic of Android Application Development conducted at the NEST I/0, a tech incubator by P@SHA.
Sample codes for the workshop can be followed at:
https://github.com/azfarsiddiqui/android-workshop-pasha
- Services are components that run in the background to perform long-running operations or interact with content providers. There are three main types: foreground, background, and bound services.
- The lifecycle of a service includes methods like onStartCommand(), onBind(), onUnbind(), and onDestroy(). Services can be either started or bound.
- The Android architecture consists of layers including the Linux kernel, libraries, the Android framework, and applications. The Dalvik VM executes compiled applications.
This document provides an overview of Android user interface concepts including screen size, screen density, screen orientation, and resolution. It discusses density independent pixels which allow specifying dimensions independently of screen density. Toasts are described as short duration messages that appear on an activity. The activity lifecycle is explained, with key methods like onCreate, onPause, onResume called when the activity comes in and out of focus. Examples are provided for creating toasts and positioning them on the screen in different locations. The assignment is to create toasts displaying text and an image in different screen positions.
This document discusses user interfaces for Android apps. It begins by introducing activities as the core building block of Android UI. It describes the four states an activity can be in (active, paused, stopped, destroyed) and the lifecycle methods (onCreate(), onStart(), onResume(), onPause(), onStop(), onDestroy()) that are called as the activity transitions between states. It then discusses UI resources like layout resources that define the visual structure of an activity's screens using XML files. Finally, it provides an example of a relative layout and how views can be positioned relative to each other or the overall layout.
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.
This document provides an overview of event handling in Advanced Java Programming. It discusses the delegation event model, where a source generates an event and a listener receives the event. It describes different types of events like mouse, keyboard, window events and the classes that represent them. It also covers event listener interfaces that must be implemented by listeners to receive and process events from sources. Key concepts covered are event sources, event objects, event listeners, and the delegation model of separating source and listener logic.
This document provides information about an Android development community and lessons on activities and fragments. It summarizes the key topics covered in an online Android course, including activity and fragment lifecycles, saving persistent data, and communicating between fragments. It also introduces mentors from the community and examples of how to create activities and fragments and handle configuration changes and backgrounding.
An event-driven program relies on events to trigger responses rather than actively polling for user input. Older programs used polling which involved continuously checking for user actions in a loop, wasting CPU resources. Event-driven programs address this by using listeners that wait passively for events from sources like user interactions. When an event occurs, the appropriate listener receives and handles the event without wasting resources on empty polling loops.
The document discusses event handling in Java, describing different types of events like window, mouse, and keyboard events. It explains the event handling process and different event classes. Various listener interfaces are described that can be implemented to handle specific events, such as WindowListener, MouseListener, and KeyListener.
Machines like computers, printers, and webcams have parts like keyboards, CPUs, and monitors that work together using electricity. It is important to be safe when using machines by keeping them away from water, not opening plugged in machines, and not overloading outlets.
The document discusses GUI event handling in Java. It explains that window-based Java programs are event-driven, meaning they wait for and respond to user-initiated events like button clicks or key presses. When an event occurs, an event object is passed to a listener object that handles the event. Listeners implement interfaces that correspond to different event types, like ActionListener for button clicks. The delegation event model in Java handles event passing from components to listeners.
11.11.2020 - Unit 5-3 ACTIVITY, MENU AND SQLITE DATABASE.pptxMugiiiReee
This document provides information about activities, menus, intents, services, broadcast receivers and SQLite database in Android. It discusses the activity lifecycle and different types of activities. It explains the concept of intents and how they are used to start activities, services and broadcast receivers. It covers the different types of menus like option menu, context menu and popup menu. It discusses services, their types and lifecycle. It provides details about broadcast receivers, how they receive and respond to broadcast messages. It also gives an overview of SQLite database and how it is used in Android applications for data storage.
This document provides an overview of Android development. It discusses the core components of an Android app including activities, services, content providers, and broadcast receivers. It also covers key concepts like the application lifecycle, intents, and processes/threads. The session aims to give an introduction to the Android ecosystem and components, explain how to create a simple app, and include socializing with beer breaks.
This document provides an overview of Android development including the key components of an Android app. It discusses Activities, Services, Content Providers, Broadcast Receivers, Intents, Views, and common UI elements. It also covers how to start Android development using Android Studio and best practices for handling the UI thread and asynchronous tasks. Notifications are demonstrated as well key layout types and the Play Store.
Data Transfer between Activities & DatabasesMuhammad Sajid
- Services are components that run in the background to perform long-running operations like playing music or handling network transactions. There are three types: foreground, background, and bound.
- The lifecycle of a service includes starting, binding, running, and stopping. Key methods include onStartCommand(), onBind(), onUnbind(), and onDestroy().
- The Android architecture is divided into layers including the Linux kernel, libraries, Android runtime, application framework, and applications. The framework provides high-level services to applications.
Embedded systems contain two main elements: the embedded system hardware and embedded system software. The hardware contains a microprocessor, memory, input/output interfaces, and a display. The embedded system software is written to perform a particular task and is typically stored in firmware on a chip. When developing mobile applications, architects must consider constraints like screen size and storage, choose an appropriate architecture based on factors like available connectivity and user interface needs, and implement effective user interfaces and navigation.
The document provides information about smartphone programming and Android app development. It discusses:
1) The basics of Android app development including that apps are written in Java, compiled into APK files, and require resources like data, code and images.
2) Android app security including how each app runs in its own "sandbox" with unique permissions to access only required components.
3) The main components that make up an Android app - activities, services, broadcast receivers and content providers. It describes what each component represents and its role.
4) Additional topics covered include the Android manifest file, app lifecycles, intents, permissions and more concepts relevant for Android programming.
The document discusses activities, intents, and event listeners in Android. It defines an activity as a single focused thing the user can interact with and explains the activity lifecycle including methods like onCreate, onStart, onResume, etc. It describes intents as messages that allow communication between app components and how they are used to start activities. It also defines event listeners as a way to handle user interactions and collect data on events like button presses. It provides examples of registering different types of event listeners including anonymous inner classes and having the activity implement listener interfaces.
The document discusses the core components of the Android operating system architecture. It describes how Android relies on the Linux kernel for core system services and uses the Dalvik virtual machine to execute applications. It outlines the main OS components including activities, services, broadcast receivers, content providers, and libraries. It explains how applications are packaged and deployed, how components are activated via intents, and the role of the Android manifest file in declaring application building blocks.
An Android activity presents a visual user interface for a focused task. It contains a hierarchy of views that provide the visual content and user interaction. Each activity has a default window and a content view hierarchy set with setContentView(). An application can contain multiple activities, with one specified as the initial activity in the manifest. Activities transition between running, paused, and stopped states, notifying the activity of changes through callback methods like onCreate(), onStart(), onResume(), etc. Activities are managed in a stack, with new activities placed on top and previous activities remaining below until the top activity exits.
An Android activity presents a visual user interface for a focused task. It contains a hierarchy of views that provide interaction and visual content within its window. Activities are declared in the Android manifest file and can launch other activities using intents. An activity transitions through various states as it moves between the foreground and background. The activity lifecycle callbacks notify an activity of state changes like create, start, resume and pause. Activities are managed in a stack, so starting a new activity places it on top of any existing activities.
Presentation for the workshop by Muhammad Azfar Siddiqui of 10Pearls on the topic of Android Application Development conducted at the NEST I/0, a tech incubator by P@SHA.
Sample codes for the workshop can be followed at:
https://github.com/azfarsiddiqui/android-workshop-pasha
- Services are components that run in the background to perform long-running operations or interact with content providers. There are three main types: foreground, background, and bound services.
- The lifecycle of a service includes methods like onStartCommand(), onBind(), onUnbind(), and onDestroy(). Services can be either started or bound.
- The Android architecture consists of layers including the Linux kernel, libraries, the Android framework, and applications. The Dalvik VM executes compiled applications.
This document provides an overview of Android user interface concepts including screen size, screen density, screen orientation, and resolution. It discusses density independent pixels which allow specifying dimensions independently of screen density. Toasts are described as short duration messages that appear on an activity. The activity lifecycle is explained, with key methods like onCreate, onPause, onResume called when the activity comes in and out of focus. Examples are provided for creating toasts and positioning them on the screen in different locations. The assignment is to create toasts displaying text and an image in different screen positions.
The document provides information about a mobile application development course including the course teacher, outcomes, units covered, textbooks, and key components of an Android application. The course is taught by Mr. Kiran Khandarkar and covers topics like control flow, directory structure, UI design using layouts, and publishing apps. It also describes the logical components, development flow, project structure, and fundamental elements of an Android screen including activities, views, view groups, and common layouts.
This document provides an introduction to Xcode, the integrated development environment (IDE) for building iOS apps. It describes the main parts of Xcode including the navigator panel, inspector panel, libraries and frameworks. It also explains key concepts like the model-view-controller (MVC) pattern, outlets and actions, view controllers and their lifecycles, navigation controllers, table views, and the iOS application lifecycle.
This document discusses the core application components in Android:
1) Activities represent single screens and are independent of each other. The activity lifecycle callbacks like onCreate(), onStart(), onResume(), onPause(), onStop(), and onDestroy() are explained.
2) Services run in the background to perform long-running tasks without a user interface.
3) Content providers allow data sharing between applications by hiding database details.
4) Broadcast receivers respond to broadcast messages from other apps or the system to perform tasks when apps are not active. The document provides examples of how to implement each component.
Project a day 2 android application fundamentalsGoran Djonovic
The document provides an overview of key Android application fundamentals including concepts like activities, services, broadcast receivers, content providers, and intents. It describes how applications are written in Java and launched in their own process with a unique user ID. Activities are the basic component for user interfaces and can start each other to form a task stack. The document outlines the lifecycle of activities and different states they can be in. It also discusses how views and layouts are used to construct user interfaces and handle events. Services, broadcast receivers, and content providers are introduced as background processes without a UI. Finally, the Android manifest file is described as declaring application components.
Ch5 intent broadcast receivers adapters and internetShih-Hsiang Lin
The document provides an overview of intents, broadcast receivers, adapters, and using internet resources in Android applications. It discusses how intents allow interaction between applications through message passing and how they can be used to start activities, broadcast events, and start services. It covers explicit and implicit intents, returning results from activities, and registering broadcast receivers and activities to handle intents through intent filters. The document also discusses linkify for making links in text views, broadcasting events with intents, and registering broadcast receivers in the manifest.
Android design patterns in mobile application development presentationMichail Grigoropoulos
Design patterns help developers and designers to solve common design problems by using tested and user friendly solutions. The term can be applied to both directions to build a thing and the thing itself. The purpose of this study is to present such solutions and examine their applicability in android application development and user experience. For he study's purposes, an application called "Messeme" was developed based on some of the design patterns that are presented in the Second section of this Thesis.
This document outlines how to install and run a simple application using AngularJS. It discusses downloading AngularJS, creating the necessary files (index.html, app.js, angular.min.js), adding Angular directives and controllers. Specifically, it shows how to create an Immediately Invoked Function Expression (IIFE) to avoid variable collisions, define a controller that shares data with the view, and bind form elements to the scope with ng-model. The goal is for students to learn how to install AngularJS and build a basic app with it.
The document describes various types of systems. It states that systems engineering is applied to open, physical systems that are human-made or modified from largely precedented elements. It provides examples of different types of systems, including:
- Open systems that interact with their environment and closed systems that are isolated
- Natural, human-made, and human-modified systems
- Physical and conceptual systems
- Precedented systems that have been produced before and unprecedented systems requiring research
It discusses systems in terms of their capabilities and operational aspects beyond just hardware and software, such as organization, personnel, facilities, data, and procedures. Systems can be described logically in terms of functions and physically in terms of their elements. System
This document discusses systems thinking and system fundamentals. It defines a system as a set of elements that interact to achieve a stated purpose. The document describes different types of systems including physical systems like communication systems and conceptual systems like social systems. It provides examples of system elements, interactions, and boundaries. The goal is to define what a system is and describe the key components of systems.
The document discusses SQLite database usage in Android applications. It describes how SQLiteOpenHelper is used to manage database creation and versioning. The SQLiteDatabase class exposes methods for common database operations like insert, query, update, and delete. Queries return Cursor objects to access result sets. ContentValues are used to insert and update records. The document also provides an overview of using content providers to share data across applications.
The document discusses mobile operating systems and Android application development. It provides an overview of mobile OS characteristics like multitasking and power management. Current mobile OSs mentioned include Android, iOS, Blackberry and Windows Mobile. Android is described as being developed by Google based on Linux, using Java and a Dalvik virtual machine. The Android software stack is explained, including its applications, framework, libraries and runtime. Tools for Android app development in Eclipse and Android Studio are also listed.
The document provides an overview of Arduino programming structures and concepts. It discusses the setup and loop functions, variables and data types, arrays, operators, constants, control structures, and input/output functions like pinMode, digitalRead, analogRead, and analogWrite. It also covers other functions for delay, random numbers, serial communication, and working with sensors like a vibration sensor, accelerometer, ultrasonic sensor, and Bluetooth shield. Example code is provided to read and display sensor values and control an LED.
This document discusses Internet of Things (IoT) and provides definitions and architectures for IoT. It defines IoT as a global infrastructure that connects physical and virtual things through technologies that enable services. It discusses standard organization definitions and how IoT connects objects through sensors, actuators and communication technologies. The document outlines IoT architectures including layers for applications, information processing, resource management, networking and sensing/control. It also discusses cloud of things and reference architectures for IoT middleware and infrastructure.
Padlet is an online tool that allows teachers to provide feedback to students in a digital format. Students can post work or responses to prompts on a virtual "wall" for the teacher and classmates to see and comment on. Teachers are then able to give feedback directly on the wall in written comments or by using sticky notes, allowing for an interactive feedback process.
This document discusses a learning management system called Canvas and was prepared by Dr. P. Karthikeyan, an Associate Professor in the Department of IT at Thiagarajar College of Engineering in Madurai. The document repeatedly notes that it was prepared by Dr. P. Karthikeyan, an Associate Professor of IT at Thiagarajar College of Engineering.
3. Creating an Activity
• Create a new Activity by extending the Activity class.
• Override the onCreate() method to set the view for the
activity
• Set the user interface to an Activity using the
setContentView() method in the onCreate method of
the Activity.
public class MyActivity extends Activity {
public void onCreate(Bundle b) {
super.onCreate(b);
setContentView(R.layout.main);
}
}
4. • Activities in the system are managed as an activity stack.
• The Android memory manager uses this stack to determine
the priority of applications based on their Activities when
deciding which application to terminate to free resources.
• An activity has essentially four states:
Active : An activity in the foreground of the screen.
Paused : An activity has lost focus but is still visible.
Stopped : An activity is completely obscured by another
activity.
Inactive : After an Activity has been killed or before it has
been launched.
Activity Life Cycle
5.
6. Activity Lifetimes
• Entire lifetime :
Happens between the first call to onCreate(Bundle) through
to a single final call to onDestroy(). An activity will do all
setup of "global" state in onCreate(), and release all remaining
resources in onDestroy().
• Visible lifetime :
Happens between a call to onStart() until a corresponding call
to onStop(). During this time the user can see the activity on-
screen, though it may not be in the foreground and
interacting with the user.
• Foreground lifetime :
Happens between a call to onResume() until a corresponding
call to onPause().
7. Layouts
• Layout is the design plan or the architecture for the
user interface in an activity.
• Layout is required to arrange or organize the widgets
inside an activity.
• Layout defines the activity structure & holds all the
elements that are part of the user interface.
• Layouts can be nested.
8. A Layout can be declared in two ways:
• Declaring in XML:
Android provides a straightforward XML tags that
corresponds to the View classes and subclasses, such as
those for widgets and layouts that can be added to the
layout.
• Instantiating at runtime:
Your application can create View and ViewGroup objects
(and manipulate their properties) programmatically.
Declaring Layout
9. • Linear Layout
A layout that organizes its children into a single horizontal or
vertical row.
• Table Layout
A layout that positions its children into rows and columns.
• Relative Layout
A layout that allows to organize child elements in positions
relative to the parent or siblings elements.
• Frame Layout
It is designed to block out an area on the screen to display a
single item.
Layout Types
10.
11. Menus
• Menus provide familiar interfaces to expose
application functions without sacrificing screen
space.
• Android offers an easy programming interface to
provide standardized application menus.
• Android offers three fundamental types of
application menus:
Options Menu
Context Menu
Sub-menu
12. • By default, every Activity supports an Options menu. It
is revealed by pressing the device MENU key.
• Options Menu has two groups of menu items:
Icon Menu
Collection of maximum of six menu items
Supports Icons and short-cuts
Expanded Menu
Exposed by the 'More' menu item
Displayed when the icon menu becomes over-loaded
Comprised of sixth options menu item and the rest.
Options Menu
14. Context Menu
• Context menu is a floating menu that is associated
with a control.
• Context menu is launched when the control has the
focus and the D pad is pressed.
• Context menus can be assigned to any View within
an Activity.
• It provides functions relating to the view, to which it
is registered.
• It supports submenus, checkboxes, radio buttons.
• It does not support shortcuts and icons.
16. • Sub menu is a floating menu, it can be a child menu of
options menu or context menu.
• It supports checkboxes, radio buttons and shortcut
keys.
• It does not support item icons, or nested sub menus.
Sub Menu
18. • A dialog is a small window that appears in front of an
Activity.
• The underlying Activity loses focus and the dialog
accepts all user interaction.
• Normally used for notifications and short activities that
directly relate to the application in progress.
• Android supports following types of dialogs.
Alert Dialog
Progress Dialog
Date Picker Dialog
Time Picker Dialog
Toast
Dialog
19. • A dialog that can manage zero, one, two or three
buttons.
• It can also manage a list of selectable items that can
include checkboxes or radio buttons.
• The AlertDialog is capable of constructing most
dialog user interfaces and is the suggested dialog
type.
• AlertDialog class is a subclass of Dialog class and
has a nested subclass AlertDialog.Builder to
construct a dialog.
Alert Dialog
20.
21. Other Dialogs
• Progress Dialog
A dialog that displays a progress wheel or progress
bar.
It supports buttons like in AlertDialog.
• DatePicker Dialog
A dialog that allows the user to select a date.
• TimePicker Dialog
A dialog that allows the user to select a time.
22.
23. • A toast is a transient Dialog box containing a
quick little message for the user.
• Toasts never receive focus and they don’t
interrupt the active application.
• They provide an ideal mechanism for alerting
users to events occurring in background Services
without interrupting foreground applications.
Toast
24. • Intents are the messages that are used to activate
following application components:
Activities
Services
Broadcast Receivers
• Intent is an object, which has a data structure holding
any one of the following data :
Abstract description of an operation to be performed
In the case of broadcasts, a description of something
that has happened and is being announced.
Intents
25. Application components are invoked through intents
in the following way :
• Activity : Intent object is passed to following
functions to invoke the Activity.
Context.startActivity (Intent intent)
Activity.startActivityForResult (Intent intent, int
requestCode)
• Service : Intent object is passed to following functions
to invoke the Service.
Context.startService (Intent)
Context.bindService (Intent)
Invoking Components
26. • Broadcast Receivers : Intent object is passed to
following functions to invoke the Broadcast
Receiver.
Context.sendBroadcast ( Intent intent, String
receiverPermission)
Context.sendOrderedBroadcast ( Intent intent,
String receiverPermission)
Context.sendStickyBroadcast ( Intent intent )
Invoking Components
27. • A status bar notification adds an icon to the system's
status bar (with an optional ticker-text message) and an
expanded message in the "Notifications" window.
• When the user selects the expanded message, Android
fires an Intent that is defined by the notification
(usually to launch an Activity).
• You can also configure the notification to alert the user
with a sound, a vibration, and flashing lights on the
device.
• This kind of notification is ideal when your application
is working in a background Service and needs to notify
the user about an event.
Notification
28. • To create a notification, following classes should be
used:
Notification
NotificationManager
• Notification is a class that represents how a persistent
notification is to be presented to the user using the
NotificationManager.
• NotificationManager is an Android system service used
to handle notifications.
Notification (Continued)
31. • A Service is an application component that runs in the
background for an indefinite period of time.
• Services are specifically used to handle operations and
functionality that should run silently, without any User
Interface.
• Services are generally used to perform following
operations in the background
Updating the Content Providers
Firing Intents
Triggering Notifications etc
• Services, like other application objects, run in the main
thread of their hosting process.
Services
32. • Services are started, stopped, and controlled from
other application components including other
Services, Activities, and Broadcast Receivers.
• Service is involved in any CPU intensive (such as MP3
playback) or blocking (such as networking)
operations, should spawn its own thread to do that
work.
• Android platform has following services:
Location Manager
Media Controller
Notification Manager
Services (Continued)
33. • Service supports following lifecycle methods :
OnCreate
OnStart
OnBind
OnUnbind
OnRebind
OnDestroy
• Service is controlled using following methods:
Context.startService
Context.stopService
Service.stopSelf
Context.bindService
Context.UnbindService
Service Life Cycle
34.
35. 1. Professional Android Application Development, Reto
Meier, Wrox, November 2008
2. Beginning Android, Mark Murphy, Apress, June 2009
3. Pro Android, Sayed Y Hashimi, Apress, June 2009
4. Android – Application Development, Rick Rogers et.al,
O’Reilly, May 2009
5. “Hello, Android”, Introducing Google’s Mobile
Development Platform, Ed Burnette, The Pragmatic
Bookshelf, 2008
6. developer.android.com
References