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 provides an overview of Android application development fundamentals including application components, intents, manifest files, and more. It discusses that Android apps are written in Java and compiled to APK files. The core application components are activities, services, broadcast receivers, and content providers. Intents are used to start components and broadcast receivers register to receive system or app events. Every app must declare its components in the Android manifest.
Android is an open source operating system for mobile devices that uses a Linux kernel and middleware layer. It includes core applications like email, SMS, calendar, maps and a browser. Key components of Android apps include activities for user interfaces, services for background tasks, broadcast receivers to receive system announcements, and content providers to share data between apps. Apps are built using Java and communicate through intents, which are messages containing a destination and optional data.
The document discusses the fundamentals of Android applications, including project structure, the Android manifest file, resources, activities and the activity lifecycle. It explains that the project structure includes folders for code, resources, Gradle files and libraries. The manifest declares application components and properties. Resources include files for images, strings, layouts and more. Activities represent screens with user interfaces and have a lifecycle that involves starting, resuming, pausing and stopping.
This document summarizes key topics from a lecture on security engineering:
1. It discusses security engineering and management, risk assessment, and designing systems for security. Application security focuses on design while infrastructure security is a management problem.
2. It outlines guidelines for secure system design including basing decisions on security policies, avoiding single points of failure, balancing security and usability, validating all inputs, and designing for deployment and recoverability.
3. It also covers risk management, assessing threats, and designing architectures with layered protection and distributed assets to minimize the effects of attacks.
Accelerating Agile by Adding Business AnalysisIIBA UK Chapter
油
The document discusses the role of a business analyst (BA) in an agile environment. It provides examples of tasks a BA can perform to help the product owner, scrum master, and development team. These include maintaining the backlog, writing user stories, guiding decomposition and prioritization, and freeing up developer time. The BA is presented as filling gaps in the agile approach by providing analysis skills, non-technical expertise, and a durable partnership for the team. Calculations estimate the BA role can yield time savings equivalent to over 1 full-time employee annually.
This document discusses various options for storage in Android and iOS applications. It covers shared preferences, internal storage, external storage, SQLite databases, and network connections in Android. It also discusses NSUserDefaults, file I/O, and SQLite databases using FMDB as a wrapper in iOS. The document provides code examples for reading and writing data using these various storage mechanisms.
This talk is about Apples new programming language: its features, concepts and similarities to other well established languages. To make it more fun: live coding will be involved. Experiences based on working with the language on a project, touching subjects like testing, tools and general stability will be shared.
The document discusses different types of sensors available on smartphones and how to access sensor data on iOS and Android platforms. It covers motion sensors like accelerometers and gyroscopes, environmental sensors like temperature and pressure sensors, and position sensors like magnetometers. It provides code examples of accessing the accelerometer sensor and using filters to isolate the force of gravity on iOS and Android. It also explains how to use the Android sensor framework to determine available sensors and get sensor events.
Android and IOS UI Development (Android 5.0 and iOS 9.0)Michael Shrove
油
The document discusses various project templates available in iOS for building mobile apps, including:
- Single view, tab bar, master-detail, page-based, and game templates
- The templates provide a starting structure and interface for different types of apps
- It also covers controllers like tab bar, navigation, and table view controllers that are used to organize interfaces in iOS apps
1. The document outlines the agenda for a Swift Office Hours meetup.
2. The agenda includes an icebreaker, introductions about the meetup, a Swift pitch session, a demo by Vincent Toms using the Vapor web framework, an open discussion, and free coding time.
3. Future meetups will cover various Swift topics like animation, libraries, device features, and expert panels, with guest speakers from local companies.
This document provides an overview of key Java concepts including classes, objects, methods, fields, inheritance, interfaces, exceptions, and collections. Some key points:
- Java code is organized into classes which can contain fields to store data and methods to encapsulate behaviors. Objects are instantiated from classes.
- Fields can be declared with primitive types or as arrays/objects. Methods are declared with a return type and parameters.
- Inheritance allows subclasses to extend and override methods from parent classes. Interfaces define contracts that classes can implement.
- Exceptions provide error handling for exceptions that occur in code. Collections like ArrayList and LinkedList provide data structures to store and access multiple objects.
Using off-the-shelf backend services like Parse, CloudKit, and Firebase, the presenter implemented a feedback tool for an auto loan tracker app. The tool aimed to get more real-time feedback from customers to understand if the app's tips were useful or confusing and to see if it actually helped people. The presentation compared the services on factors like setup, dashboards, storage size, security, and ease of use. Testing the feedback tool revealed that it motivated on-time payments, identified new feature requests, and increased feedback rates, helping the company design better future products.
This document discusses custom view controller transitions in iOS, including an overview and demos of different transition animations like shrink, circular, fade, pop, and sideways transitions. It covers the transition animation lifecycle and provides examples of using the block-based UIView animation API, spring animation API, keyframe animation API, and UIKit Dynamics to implement custom transitions.
The document discusses the Swift Buildpack for Cloud Foundry, which allows developers to deploy Swift applications to Cloud Foundry. It provides an overview of Swift and the Swift Package Manager, and then describes how the buildpack works, including installing Swift, building executable and library packages, handling dependencies, configuring services, and debugging deployed applications on Cloud Foundry.
This document discusses the power of an agile business analyst. It begins by contrasting the original purpose of BAs with how their role turned less agile over time. It then reviews agile principles from the Agile Manifesto and 12 principles. Sections discuss challenges with moving to agile and how BAs can embrace exploration, remove perfectionism, and work with product owners in shared or scaled models. The document promotes BAs becoming "agile superheroes".
The document discusses challenges with traditional business analyst roles and provides suggestions for an agile business analyst approach. It recommends that the business analyst get stakeholders involved in development and testing, focus on high priority items first, use executable specifications over documents, provide just-in-time details through daily analysis, and let developers speak to the business when needed. This reflects an emphasis on collaboration, prioritization, and adaptive planning in the agile methodology.
This document discusses the delivery of the BBC iPlayer across different platforms at scale. It summarizes that iPlayer is accessed by over 10,000 devices, with 37 million mobile app installs. It outlines the structure of iPlayer teams for different platforms and priorities for 2016 around personalization, content discovery, and quality of service. Challenges include delivering a consistent experience across screens and committing to releasing new features to beta audiences. Success is measured through metrics like time spent and engagement. Stakeholders are managed based on their power and interest.
Detecting Problematic Lookup Functions in Spreadsheets icseconf
油
Spreadsheets are used heavily in many business
domains around the world. They are easy to use and as such
enable end-user programmers to and build and maintain all sorts
of reports and analyses. In addition to using spreadsheets for
modeling and calculation, spreadsheets are often also used for
creating reports and dashboards: combining data from different
sources and creating overviews. For this, lookup functions can
be used: they search for a value in a range and return a
corresponding row or column. Lookup functions are common:
according to recent research the VLOOKUP is the fifth most
common Excel function. In this paper we investigate the use of
lookup functions in more detail. We analyze lookup functions
within the newly released Enron spreadsheet corpus. The results
show that 1) a minority of 43% of lookup formulas use the
default setting where an approximate match may be returned,
2) 77% of approximate matches are used unnecessary and 3)
23% of approximate lookups is problematic: they search over
unsorted ranges, while this is specifically advised against in the
specification, and might lead to wrong results.
Between Business Demands and Thriving Technology: The 'Modern Day BA'IIBA UK Chapter
油
The document discusses the role of business analysis in change environments. It covers the scope of business analysis, including requirements elicitation and validation at different organizational levels. The boundaries between business analysis and solution architecture skills are outlined. Key competencies for business analysts are analytical thinking, communication skills, and interaction skills. The document also describes how business analysts deliver change and provide voice in projects from concept development through solution design. A multi-dimensional change model shows the relationship between business analysis and solution architecture. Adaptability is important to overcome skill creep between roles.
Introduction to Scrum - An Agile FrameworksAMJAD SHAIKH
油
Introduction to Scrum - is one of the most popular frameworks for implementing agile. The presentation in quick overview to introduce readers with terms used in scrum & process itself.
The health care industry typically refers to consumers as "patients," "enrollees," or "members," which implies a passive role for individuals. However, health policy experts argue that costs would be lower, service better, and quality improved if the industry recognized consumers' active role and repositioned itself as a consumer market instead of focusing on medical designations.
The document is an introduction to the Business Analysis Body of Knowledge (BABOK) version 2. It was presented by Kevin Brennan, VP of the Body of Knowledge at the International Institute of Business Analysis, at the WCBA San Diego. The International Institute of Business Analysis (IIBA) is a non-profit professional association for business analysis with goals of creating awareness of the value of business analysis, developing and maintaining standards for business analysis practice and certification, and supporting the business analysis profession.
The document discusses user interface (UI) elements and controls in Android and iOS. It provides overviews of common UI elements like buttons, text fields, and layouts in both platforms. For Android specifically, it covers view objects, XML layouts, and getting input from controls. For iOS, it discusses the UIControl class, configuring controls, auto layout, and content for different controls like text fields and buttons.
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.
This talk is about Apples new programming language: its features, concepts and similarities to other well established languages. To make it more fun: live coding will be involved. Experiences based on working with the language on a project, touching subjects like testing, tools and general stability will be shared.
The document discusses different types of sensors available on smartphones and how to access sensor data on iOS and Android platforms. It covers motion sensors like accelerometers and gyroscopes, environmental sensors like temperature and pressure sensors, and position sensors like magnetometers. It provides code examples of accessing the accelerometer sensor and using filters to isolate the force of gravity on iOS and Android. It also explains how to use the Android sensor framework to determine available sensors and get sensor events.
Android and IOS UI Development (Android 5.0 and iOS 9.0)Michael Shrove
油
The document discusses various project templates available in iOS for building mobile apps, including:
- Single view, tab bar, master-detail, page-based, and game templates
- The templates provide a starting structure and interface for different types of apps
- It also covers controllers like tab bar, navigation, and table view controllers that are used to organize interfaces in iOS apps
1. The document outlines the agenda for a Swift Office Hours meetup.
2. The agenda includes an icebreaker, introductions about the meetup, a Swift pitch session, a demo by Vincent Toms using the Vapor web framework, an open discussion, and free coding time.
3. Future meetups will cover various Swift topics like animation, libraries, device features, and expert panels, with guest speakers from local companies.
This document provides an overview of key Java concepts including classes, objects, methods, fields, inheritance, interfaces, exceptions, and collections. Some key points:
- Java code is organized into classes which can contain fields to store data and methods to encapsulate behaviors. Objects are instantiated from classes.
- Fields can be declared with primitive types or as arrays/objects. Methods are declared with a return type and parameters.
- Inheritance allows subclasses to extend and override methods from parent classes. Interfaces define contracts that classes can implement.
- Exceptions provide error handling for exceptions that occur in code. Collections like ArrayList and LinkedList provide data structures to store and access multiple objects.
Using off-the-shelf backend services like Parse, CloudKit, and Firebase, the presenter implemented a feedback tool for an auto loan tracker app. The tool aimed to get more real-time feedback from customers to understand if the app's tips were useful or confusing and to see if it actually helped people. The presentation compared the services on factors like setup, dashboards, storage size, security, and ease of use. Testing the feedback tool revealed that it motivated on-time payments, identified new feature requests, and increased feedback rates, helping the company design better future products.
This document discusses custom view controller transitions in iOS, including an overview and demos of different transition animations like shrink, circular, fade, pop, and sideways transitions. It covers the transition animation lifecycle and provides examples of using the block-based UIView animation API, spring animation API, keyframe animation API, and UIKit Dynamics to implement custom transitions.
The document discusses the Swift Buildpack for Cloud Foundry, which allows developers to deploy Swift applications to Cloud Foundry. It provides an overview of Swift and the Swift Package Manager, and then describes how the buildpack works, including installing Swift, building executable and library packages, handling dependencies, configuring services, and debugging deployed applications on Cloud Foundry.
This document discusses the power of an agile business analyst. It begins by contrasting the original purpose of BAs with how their role turned less agile over time. It then reviews agile principles from the Agile Manifesto and 12 principles. Sections discuss challenges with moving to agile and how BAs can embrace exploration, remove perfectionism, and work with product owners in shared or scaled models. The document promotes BAs becoming "agile superheroes".
The document discusses challenges with traditional business analyst roles and provides suggestions for an agile business analyst approach. It recommends that the business analyst get stakeholders involved in development and testing, focus on high priority items first, use executable specifications over documents, provide just-in-time details through daily analysis, and let developers speak to the business when needed. This reflects an emphasis on collaboration, prioritization, and adaptive planning in the agile methodology.
This document discusses the delivery of the BBC iPlayer across different platforms at scale. It summarizes that iPlayer is accessed by over 10,000 devices, with 37 million mobile app installs. It outlines the structure of iPlayer teams for different platforms and priorities for 2016 around personalization, content discovery, and quality of service. Challenges include delivering a consistent experience across screens and committing to releasing new features to beta audiences. Success is measured through metrics like time spent and engagement. Stakeholders are managed based on their power and interest.
Detecting Problematic Lookup Functions in Spreadsheets icseconf
油
Spreadsheets are used heavily in many business
domains around the world. They are easy to use and as such
enable end-user programmers to and build and maintain all sorts
of reports and analyses. In addition to using spreadsheets for
modeling and calculation, spreadsheets are often also used for
creating reports and dashboards: combining data from different
sources and creating overviews. For this, lookup functions can
be used: they search for a value in a range and return a
corresponding row or column. Lookup functions are common:
according to recent research the VLOOKUP is the fifth most
common Excel function. In this paper we investigate the use of
lookup functions in more detail. We analyze lookup functions
within the newly released Enron spreadsheet corpus. The results
show that 1) a minority of 43% of lookup formulas use the
default setting where an approximate match may be returned,
2) 77% of approximate matches are used unnecessary and 3)
23% of approximate lookups is problematic: they search over
unsorted ranges, while this is specifically advised against in the
specification, and might lead to wrong results.
Between Business Demands and Thriving Technology: The 'Modern Day BA'IIBA UK Chapter
油
The document discusses the role of business analysis in change environments. It covers the scope of business analysis, including requirements elicitation and validation at different organizational levels. The boundaries between business analysis and solution architecture skills are outlined. Key competencies for business analysts are analytical thinking, communication skills, and interaction skills. The document also describes how business analysts deliver change and provide voice in projects from concept development through solution design. A multi-dimensional change model shows the relationship between business analysis and solution architecture. Adaptability is important to overcome skill creep between roles.
Introduction to Scrum - An Agile FrameworksAMJAD SHAIKH
油
Introduction to Scrum - is one of the most popular frameworks for implementing agile. The presentation in quick overview to introduce readers with terms used in scrum & process itself.
The health care industry typically refers to consumers as "patients," "enrollees," or "members," which implies a passive role for individuals. However, health policy experts argue that costs would be lower, service better, and quality improved if the industry recognized consumers' active role and repositioned itself as a consumer market instead of focusing on medical designations.
The document is an introduction to the Business Analysis Body of Knowledge (BABOK) version 2. It was presented by Kevin Brennan, VP of the Body of Knowledge at the International Institute of Business Analysis, at the WCBA San Diego. The International Institute of Business Analysis (IIBA) is a non-profit professional association for business analysis with goals of creating awareness of the value of business analysis, developing and maintaining standards for business analysis practice and certification, and supporting the business analysis profession.
The document discusses user interface (UI) elements and controls in Android and iOS. It provides overviews of common UI elements like buttons, text fields, and layouts in both platforms. For Android specifically, it covers view objects, XML layouts, and getting input from controls. For iOS, it discusses the UIControl class, configuring controls, auto layout, and content for different controls like text fields and buttons.
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.
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.
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
The document discusses the basics of developing Android applications, including the four main components (activities, services, content providers, and broadcast receivers) that make up Android apps. It explains that activities represent screens with user interfaces, services run in the background, content providers manage shared app data, and broadcast receivers respond to system-wide broadcasts. The document also covers how apps are packaged in an APK file and run in a secure sandbox on Android devices.
Welcome to the Android developer guides. The documents teach you Application Fundamentals.Arna Softech is a mobile app development solutions company, We deliver end-to-end mobile app development solutions integrated with our technical expertise, excellent domain knowledge, and team work. We deliver mobile applications that create value, Enjoy 100% Quality assurance on all mobile applications.
Enroll for Android Certification in Mumbai at Asterix Solution to develop your career in Android. Make your own android app after android development training in mumbai provides under guidance of expert Trainers. For more details, visit : http://www.asterixsolution.com/android-development-training.html
Android fundamentals and tutorial for beginnersBoom Shukla
油
Android is an open-source software stack that includes an operating system, middleware, and key applications for mobile devices. It uses the Java programming language and a custom virtual machine called Dalvik. The Android SDK provides tools for developing Android applications. Applications are built from components like activities, services, broadcast receivers and content providers that interact using intents. The manifest file identifies application components and permissions.
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.
Data Transfer between Activities & DatabasesMuhammad Sajid
油
Data Transfer between Activities & Databases, icon: This is displayed as icon for activity. You can check or save png image of name icon in drawable folder. android:icon="@drawable/icon"
label: The label / title that appears at top in Toolbar of that particular Activity. You can check or edit label name by opening String XML file present inside Values folder
android:label = "@string/label or android:label = "New Activity
Just like icon attribute, if you have not declared any label for your activity then it will be same as your parent activity
This slide deck contains the requirement for Android Penetration testing using some open source tools and techniques. And it also cover OWASP TOP 10 Mobile, MSTG and MASVS guidelines for Mobile Application Penetration testing
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.
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.
The document discusses the Android application lifecycle and architecture. It describes the key stages an Android activity goes through (onCreate, onStart, onResume, onPause, onStop, onDestroy) and what occurs at each stage. It also covers key Android concepts like views, XML layouts, intents, permissions, and security vulnerabilities. In particular, it notes that permissions allow additional capabilities but make the app more vulnerable, and that rooting a device voids warranties but provides more customization options at the cost of potential stability issues.
Data Transfer between Activities & DatabasesMuhammad Sajid
油
The document discusses content providers in Android. It describes content providers as a central repository that stores application data and makes it available to other applications. Content providers can store data in SQLite databases, files, or over a network. The ContentResolver class is used to access data from content providers using content URIs. Content providers receive data requests from clients, perform actions like create, update, delete, retrieve, and return results.
3. Fundamentals
Android application are written in Java
Android SDK tools compile the code in an .apk
file
Resources
Data
Code
APK file are what android powered device use
4. Android App Security
Once installed all apps live in their own sandbox
The Android operating system is a multi-user Linux
system in which each app is a different user.
By default, the system assigns each app a unique Linux
user ID. The system sets permissions for all the files in an
app so that only the user ID assigned to that app can
access them.
Each process has its own virtual machine (VM), so an
app's code runs in isolation from other apps.
By default, every app runs in its own Linux process.
5. Android App Security++
In this way, the Android system implements the principle
of least privilege. That is, each app, by default, has
access only to the components that it requires to do its
work and no more.
However, there are ways for an app to share data with other apps
and for an app to access system services:
An app can request permission to access device data
such as the user's contacts, SMS messages, the
mountable storage (SD card), camera, Bluetooth, and
more.
All app permissions must be granted by the user at install
time.
6. App Components
App
Activities
Content
Providers
Services
Broadcast
Receivers
App components are the
essential building blocks of
an Android app.
Each component is a
different point through which
the system can enter your
app.
Not all components are
actual entry points for the
user and some depend on
each other, but each one
exists as its own entity and
plays a specific role
Each one is a unique building
block that helps define your
app's overall behavior.
7. Activities
An activity represents a single
screen with a user interface.
For example, an email app might have
one activity that shows a list of new
emails, another activity to compose an
email, and another activity for reading
emails.
Although the activities work together
to form a cohesive user experience
in the email app, each one is
independent of the others.
As such, a different app can start
any one of these activities (if the
email app allows it).
For example, a camera app can start
the activity in the email app that
composes new mail, in order for the
user to share a picture.
An activity is implemented as a
subclass of Activity
App
Activities
Content
Providers
Services
Broadcast
Receivers
8. Services
A service is a component that runs in the
background to perform long-running
operations or to perform work for remote
processes.
A service does not provide a user
interface.
For example, a service might play
music in the background while the
user is in a different app, or it might
fetch data over the network without
blocking user interaction with an
activity.
Another component, such as an activity,
can start the service and let it run or
bind to it in order to interact with it.
A service is implemented as a subclass
of Service
App
Activities
Content
Providers
Services
Broadcast
Receivers
9. Content Providers
A content provider manages a shared
set of app data.
SQLite database, Web, Persistent storage
location your app can access.
Through the content provider, other
apps can query or even modify the data.
For example, the Android system provides a
content provider that manages the user's contact
information.
Content providers are also
useful for reading and writing
data that is private to your app
and not shared.
For example, the Note Pad sample app uses a
content provider to save notes.
A content provider is implemented as a
subclass of ContentProvider and must
implement a standard set of APIs that
enable other apps to perform
transactions.
App
Activities
Content
Providers
Services
Broadcast
Receivers
10. Broadcast Receivers
A broadcast receiver is a component that
responds to system-wide broadcast
announcements.
Many broadcasts originate from the
system.
For example, a broadcast announcing that the screen
has turned off, the battery is low, or a picture was
captured.
Apps can also initiate broadcasts.
For example, to let other apps know that some data
has been downloaded to the device and is available
for them to use.
Although broadcast receivers don't display
a user interface, they may create a status
bar notification to alert the user when a
broadcast event occurs.
More commonly, though, a broadcast
receiver is just a "gateway" to other
components and is intended to do a very
minimal amount of work.
For instance, it might initiate a service to perform some
work based on the event.
A broadcast receiver is implemented as a
subclass of BroadcastReceiver and each
broadcast is delivered as an Intent object.
App
Activities
Content
Providers
Services
Broadcast
Receivers
11. Intents
Three of the four component typesactivities, services,
and broadcast receiversare activated by an
asynchronous message called an intent.
An intent is created with an Intent object, which defines a
message to activate either a specific component or a
specific type of componentan intent can be either
explicit or implicit, respectively.
The other component type, content provider, is not
activated by intents. Rather, it is activated when targeted
by a request from a ContentResolver.
12. Methods for Starting Components
There are separate methods for activating each type of
component:
You can start an activity (or give it something new to do) by passing
an Intent to startActivity() or startActivityForResult() (when you
want the activity to return a result).
You can start a service (or give new instructions to an ongoing
service) by passing an Intent to startService(). Or you can bind to
the service by passing an Intent to bindService().
You can initiate a broadcast by passing an Intent to methods like
sendBroadcast(), sendOrderedBroadcast(), or
sendStickyBroadcast().
You can perform a query to a content provider by calling query() on
a ContentResolver.
13. Manifest File
Before the Android system can start an app component,
the system must know that the component exists by
reading the app's AndroidManifest.xml file (the "manifest"
file).
Your app must declare all its components in this file,
which must be at the root of the app project directory.
The manifest does a number of things in addition to
declaring the app's components, such as:
User Permissions
Minimum API Level required by the app
Declare hardware and software features used or required by the
app
API libraries the app needs to be linked against
14. Intent Filters
Specifies the types of intents that an activity, service, or
broadcast receiver can respond to. An intent filter
declares the capabilities of its parent component what
an activity or service can do and what types of broadcasts
a receiver can handle. It opens the component to
receiving intents of the advertised type, while filtering out
those that are not meaningful for the component.
15. App Requirements
There are a variety of devices powered by Android and
not all of them provide the same features and capabilities.
In order to prevent your app from being installed on
devices that lack features needed by your app, it's
important that you clearly define a profile for the types of
devices your app supports by declaring device and
software requirements in your manifest file.
16. App Resources
An Android app is composed of more than just code
It requires resources that are separate from the source
code.
images,
audio files
anything relating to the visual presentation of the app.
For every resource that you include in your Android
project, the SDK build tools define a unique integer ID,
which you can use to reference the resource from your
app code or from other resources defined in XML.
res/layout/activity2.xml ------> R.id.Activity2
18. What is an Activity?
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.
Apps usual consist of multiple Activities
21. Managing the Activity Lifecycle
App
Resumed
PausedStopped
Managing the lifecycle of
your activities by
implementing callback
methods is crucial to
developing a strong and
flexible application.
An activity can exist in
essentially three states:
Resumed, Paused,
Stopped
22. Lifecycle States
Resumed
The activity is in the foreground of the screen and has user focus.
(This state is also sometimes referred to as "running".)
Paused
Another activity is in the foreground and has focus, but this one is
still visible. That is, another activity is visible on top of this one and
that activity is partially transparent or doesn't cover the entire
screen.
Stopped
The activity is completely obscured by another activity (the activity
is now in the "background"). A stopped activity is also still alive (the
Activity object is retained in memory, it maintains all state and
member information, but is not attached to the window manager).
However, it is no longer visible to the user and it can be killed by
the system when memory is needed elsewhere.
23. Implementing the lifecycle callbacks
When an activity transitions into and out of the different
states described above, it is notified through various
callback methods.
All of the callback methods are hooks that you can
override to do appropriate work when the state of your
activity changes.
Activity must have onCreate() callback by default.
25. States
Name Description
onCreate Called when the activity is first created.
onRestart Called after the activity has been stopped, just prior to it being
started again. Always followed by onStart()
onStart Called just before the activity becomes visible to the user. Followed
by onResume() if the activity comes to the foreground, or onStop()
if it becomes hidden.
onResume Called just before the activity starts interacting with the user. At this
point the activity is at the top of the activity stack, with user input
going to it. Always followed by onPause().
onPause Called when the system is about to start resuming another activity.
Followed either by onResume() if the activity returns back to the
front, or by onStop() if it becomes invisible to the user.
onStop Called when the activity is no longer visible to the user. Followed
either by onRestart() if the activity is coming back to interact with
the user, or by onDestroy() if this activity is going away.
onDestroy Called before the activity is destroyed. This is the final call that the
activity will receive.
26. Activity and the UI
The Activity class takes care of creating a window for you
in which you can place your UI with setContentView().
In code, an activity is a Java class, that extends the
Activity base class.
The activity class loads its UI components using the XML
file defined in your res/layout folder.
Every activity you have in your app, must be declared in
your AndroidManifest.xml file.
27. Starting Activities
The startActivity( ) method invokes another activity but
does not return a result to the current activity.
Activity #1 Activity #2
Intent
28. Starting Activities
Sometimes, you might want to receive a result from the
activity that you start. In that case, start the activity by
calling startActivityForResult() (instead of startActivity())
Activity #1 Activity #2
Intent
Data
29. Sending Results back
In your SecondActivity set the data which you want to
return back to FirstActivity. If you don't want to return
back, don't set any.
If you don't want to return data:
30. Receiving the results
If you want to receive the results after Activity2 sends it
back using an Intent, you implement the
onActivityResult() method.
31. Activity Example
Creating a new activity
Adding Lifecycle Callbacks
Starting an Activity
Starting an Activity for Results
34. Model-View-Controller (MVC)
The Model-View-Controller
(MVC) design pattern assigns
objects in an application one of
three roles: model, view, or
controller.
The pattern defines not only the
roles objects play in the
application, it defines the way
objects communicate with each
other.
Each of the three types of
objects is separated from the
others by abstract boundaries
and communicates with objects
of the other types across those
boundaries.
35. MVC
MVC is central to a good design for a Cocoa application.
The benefits of adopting this pattern are numerous.
Many objects in these applications tend to be more reusable, and
their interfaces tend to be better defined.
Applications having an MVC design are also more easily extensible
than other applications.
Moreover, many Cocoa technologies and architectures
are based on MVC and require that your custom objects
play one of the MVC roles.
36. Model Objects
Model objects encapsulate the data specific to an
application and define the logic and computation that
manipulate and process that data.
For example, a model object might represent a character in a game
or a contact in an address book.
A model object can have to-one and to-many relationships
with other model objects, and so sometimes the model
layer of an application effectively is one or more object
graphs.
Much of the data that is part of the persistent state of the
application (whether that persistent state is stored in files
or databases) should reside in the model objects after the
data is loaded into the application.
37. Model Objects
Ideally, a model object should have no explicit connection
to the view objects that present its data and allow users to
edit that datait should not be concerned with user-
interface and presentation issues.
Communication: User actions in the view layer that
create or modify data are communicated through a
controller object and result in the creation or updating of a
model object.
When a model object changes (for example, new data is
received over a network connection), it notifies a
controller object, which updates the appropriate view
objects.
39. View Objects
A view object is an object in an application that users can see.
A view object knows how to draw itself and can respond to user
actions.
A major purpose of view objects is to display data from the
applications model objects and to enable the editing of that
data.
Despite this, view objects are typically decoupled from model
objects in an MVC application.
Both the UIKit and AppKit frameworks provide collections of
view classes, and Interface Builder offers dozens of view
objects in its Library.
Communication: View objects learn about changes in model
data through the applications controller objects and
communicate user-initiated changes
For example: text entered in a text fieldthrough controller objects to
an applications model objects.
41. Controller Objects
A controller object acts as an intermediary between one or
more of an applications view objects and one or more of its
model objects.
Controller objects are thus a conduit through which view
objects learn about changes in model objects and vice versa.
Controller objects can also perform setup and coordinating
tasks for an application and manage the life cycles of other
objects.
Communication: A controller object interprets user actions
made in view objects and communicates new or changed data
to the model layer.
When model objects change, a controller object communicates
that new model data to the view objects so that they can
display it.
44. Execution States for Apps
At any given moment, your app is in one of the states
listed in the next table.
The system moves your app from state to state in
response to actions happening throughout the system.
For example, when the user presses the Home button, a
phone call comes in, or any of several other interruptions
occurs, the currently running apps change state in
response.
45. App States
State Description
Not Running The app has not been launched or was running but was terminated by the
system.
Inactive The app is running in the foreground but is currently not receiving events. (It
may be executing other code though.) An app usually stays in this state only
briefly as it transitions to a different state.
Active The app is running in the foreground and is receiving events. This is the
normal mode for foreground apps.
Background The app is in the background and executing code. Most apps enter this state
briefly on their way to being suspended. However, an app that requests extra
execution time may remain in this state for a period of time. In addition, an
app being launched directly into the background enters this state instead of
the inactive state.
Suspended The app is in the background but is not executing code. The system moves
apps to this state automatically and does not notify them before doing so.
While suspended, an app remains in memory but does not execute any
code.
When a low-memory condition occurs, the system may purge suspended
apps without notice to make more space for the foreground app.
46. State Delegates
Most state transitions are accompanied by a
corresponding call to the methods of your app delegate
object.
These methods are your chance to respond to state
changes in an appropriate way.
These methods are listed below, along with a summary of
how you might use them.
47. State Delegates Table
Delegate Description
application:willFinishLaunchingWithOptio
ns
This method is your apps first chance to execute code at
launch time.
application:didFinishLaunchingWithOptio
ns
This method allows you to perform any final initialization
before your app is displayed to the user.
applicationDidBecomeActive Lets your app know that it is about to become the
foreground app. Use this method for any last minute
preparation.
applicationWillResignActive Lets you know that your app is transitioning away from
being the foreground app. Use this method to put your app
into a quiescent state.
applicationDidEnterBackground Lets you know that your app is now running in the
background and may be suspended at any time.
applicationWillEnterForeground Lets you know that your app is moving out of the
background and back into the foreground, but that it is not
yet active.
applicationWillTerminate Lets you know that your app is being terminated. This
method is not called if your app is suspended.
48. App Termination
Apps must be prepared for termination to happen at any
time and should not wait to save user data or perform
other critical tasks.
System-initiated termination is a normal part of an apps
life cycle.
The system usually terminates apps so that it can reclaim
memory and make room for other apps being launched by
the user, but the system may also terminate apps that are
misbehaving or not responding to events in a timely
manner.
49. App Termination
Suspended apps receive no notification when they are
terminated; the system kills the process and reclaims the
corresponding memory.
If an app is currently running in the background and not
suspended, the system calls the applicationWillTerminate: of
its app delegate prior to termination.
The system does not call this method when the device reboots.
In addition to the system terminating your app, the user can
terminate your app explicitly using the multitasking UI.
User-initiated termination has the same effect as terminating a
suspended app.
The apps process is killed and no notification is sent to the
app.
50. Starting ViewController
2 methods for starting a viewcontroller from another
viewcontroller.
Method #1: Use built in Storyboard connection (example
will be shown in class)
Method #2: By Code (shown in Figure 1)
Figure 1
51. Passing Data between ViewControllers
Since there are two methods for starting a viewcontroller,
there is likewise two methods for passing data from VC to
VC.
Method #1: Pass data from VC to VC using method #2 of
Starting ViewController and use the VCs properties.
Method #2: Pass data from VC to VC using method #1 of
Starting ViewController slide but add prepareForSegue
method.
52. iOS Examples
Storyboard
Adding ViewControllers and Views
Presenting ViewControllers
Passing Data