SlideShare a Scribd company logo
6
Most read
7
Most read
17
Most read
Mobile Application Development
(ITEC-303)
Fahim Abid
fahim.abid@uettaxila.edu.pk
fahim.abid@uoc.edu.pk
Credits Hours 3(3,0)
Recommended Books
1. Professional Android application development, Reto Meier, Wrox Programmer to
Programmer, 2015.
2. Android Programming: The Big Nerd Ranch Guides, Phillips, B. & Hardy, B., 2nd
Edition, 2014.
3. iOS Programming: The Big Nerd Ranch Guide, Conway, J., Hillegass, A., & Keur, C.,
5th Edition, 2014.
What Makes an Android Application?
Android applications consist of loosely coupled components, bound using a project
manifest that describes each component and how they interact.
There are six components that provide the building blocks for your applications:
 Activities Your application’s presentation layer. Every screen in your application
will be an extension of the Activity class. Activities use Views to form graphical
user interfaces that display information and respond to user actions. In terms of
desktop development, an Activity is equivalent to a Form.
 Services The invisible workers of your application. Service components run
invisibly, updating your data sources and visible Activities and triggering
Notifications. They’re used to perform regular processing that needs to continue
even when your application’s Activities aren’t active or visible.
 Content Providers A shareable data store. Content Providers are used to manage
and share application databases. Content Providers are the preferred way of
sharing data across application boundaries. This means that you can configure
your own Content Providers to permit access from other applications and use
Content Providers exposed by others to access their stored data.
 Intents A simple message-passing framework. Using Intents, you can broadcast
messages system-wide or to a target Activity or Service, stating your intention to
have an action performed. The system will then determine the target(s) that will
perform any actions as appropriate.
 Broadcast Receivers Intent broadcast consumers. By creating and registering a
Broadcast Receiver, your application can listen for broadcast Intents that match
specific filter criteria. Broadcast Receivers will automatically start your
application to respond to an incoming Intent, making them ideal for event-
driven applications.
 Notifications A user notification framework. Notifications let you signal users
without stealing focus or interrupting their current Activities. They’re the
preferred technique for getting a user’s attention from within a Service or
Broadcast Receiver. For example, when a device receives a text message or an
incoming call, it alerts you by flashing lights, making sounds, displaying icons, or
showing dialog messages. You can trigger these same events from your own
applications using Notifications.
Android Application Manifest
Each Android project includes a manifest file, AndroidManifest.xml, stored in the
root of its project hierarchy. The manifest defines the structure and metadata of
your application, its components and its requirements. It includes nodes for each of
the Activities, Services, Content Providers and Broadcast Receivers that make up
your application and using Intent Filters and Permissions, determines how they
interact with each other and with other applications.
The manifest can also specify application metadata (such as its icon, version
number or theme), and additional top-level nodes can specify any required
permissions, unit tests and define hardware, screen, or platform requirements.
The manifest is made up of a root manifest tag with a package attribute set to the
project’s package. It should also include an xmlns:android attribute that supplies
several system attributes used within the file.
Using the Manifest Editor
To use the Manifest Editor in Android Studio, left click in your project folder.
Android Application Life Cycle
Unlike most traditional environments, Android applications have no control over
their own life cycles. Instead, application components must listen for changes in the
application state and react accordingly, taking particular care to be prepared for
untimely termination.
by default, each Android application is run in its own process that’s running a
separate instance of Dalvik. Memory and process management of each application
is handled exclusively by the run time.
Android aggressively manages its resources, doing whatever it takes to ensure that
the device remains responsive. This means that processes (and their hosted
applications) will be killed, without warning if necessary, to free resources for
higher-priority applications — generally those that are interacting directly with the
user at the time.
Android Application Priority and Process States
The order in which processes are killed to reclaim resources is determined by the
priority of the hosted applications. An application’s priority is equal to its highest-
priority component.
Where two applications have the same priority, the process that has been at a
lower priority longest will be killed first. Process priority is also affected by inter-
process dependencies; if an application has a dependency on a Service or Content
Provider supplied by a second application, the secondary application will have at
least as high a priority as the application it supports.
All Android applications will remain running and in memory until the system needs
its resources for other applications.
shows the priority tree used to determine the order of application termination
Externalizing Resources
Android supports the externalization of resources ranging from simple values such
as strings and colors to more complex resources like images (drawables),
animations, and themes. Perhaps the most powerful resources available for
externalization are layouts.
By externalizing resources, they become easier to maintain, update, and manage.
This also lets you easily define alternative resource values to support different
hardware and internationalization.
Android dynamically selects resources from resource trees that let you define
alternative values based on a device’s hardware configuration, language, and
location. This lets you create different resource values for specific languages,
countries, screens, and keyboards. When an application starts, Android will
automatically select the correct resource values without your having to write a line
of code.
Closer Look at Android Activities
Each Activity represents a screen that an application can present to its users. The
more complicated your application, the more screens you are likely to need.
Typically, this includes at least a primary interface screen that handles the main UI
functionality of your application. This primary interface generally consists of a
number of Fragments that make up your UI and is generally supported by a set of
secondary Activities. To move between screens you start a new Activity.
Most Activities are designed to occupy the entire display, but you can also create
semitransparent or floating Activities.
Creating Activities
Extend Activity to create a new Activity class. Within this new class you must define
the UI and implement your functionality.
The base Activity class presents an empty screen that encapsulates the window
display handling. An empty Activity isn’t particularly useful, so the first thing you’ll
want to do is create the UI with Fragments, layouts, and Views.
Views are the UI controls that display data and provide user interaction. Android
provides several layout classes, called View Groups, which can contain multiple
Views to help you layout your UIs. Fragments are used to encapsulate segments of
your UI, making it simple to create dynamic interfaces that can be rearranged to
optimize your layouts for different screen sizes and orientations.
Installation, Configuration and Understanding Functionality
of Android Studio
Android Studio -2021.1.1.23
Android Project Folders
• java/ ‐ Source files for the module.
• manifests/ ‐ Manifest files for the module.
• res/ ‐ Resource files for the module.
Some important resource types include:
• drawable: Bitmap files (.png, .9.png, .jpg, .gif) or XML files that are compiled into
drawable resource.
• layout: XML files that define a user interface layout.
• menu: XML files that define application menus, such as an Options Menu,
Context Menu, or Sub Menu.
• values: XML files that contain simple values, such as strings, integers, and colors.
Android Project Files
• Java Files: (Source Code)
• Resources:
– XML Files (Layouts, Values, Menus, Colors etc.)
– Images & Other Media Files
• Libraries:
• Assets (Text & Database Files)
Gradle
• Android Studio uses Gradle to compile and build your app.
• There is a build.gradle file for each module of your project, as well as a
build.gradle file for the entire project.
• Usually, you're only interested in the build.gradle file for the module.
• This is where your app's build dependencies are set, including the defaultConfig
settings.

More Related Content

PPT
Part 2 android application development 101
PPT
introductiontoandroiddevelopment (2).ppt
PPTX
Android apps development
PPTX
Intro to android (gdays)
PDF
Lecture3
PPT
Android application development for TresmaxAsia
PPTX
Introduction to Android Development Part 1
PDF
Android app development.pdf
Part 2 android application development 101
introductiontoandroiddevelopment (2).ppt
Android apps development
Intro to android (gdays)
Lecture3
Android application development for TresmaxAsia
Introduction to Android Development Part 1
Android app development.pdf

Similar to Mobile Application Development Lecture 05 & 06.pdf (20)

PPT
Introduction to Android Development
PDF
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
PPTX
Android Development Basics
PPTX
Introduction to Android and Android Studio
PDF
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
PDF
Android development first steps
PDF
Android Bootcamp
PPTX
Technology and Android.pptx
PPTX
Mobile Application Development
PPTX
architecture of android.pptx
PDF
Android Jump Start
PPTX
Android app devolopment
PDF
Introduction to Android Development
DOCX
Android Tutorial For Beginners Part-1
PPTX
Project a day 2 android application fundamentals
PPTX
Introduction to Android Development.pptx
PPTX
Introduction & App Structure
PPTX
Android app fundamentals
PPTX
Android Technology
PPTX
Getting started with android programming
Introduction to Android Development
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Android Development Basics
Introduction to Android and Android Studio
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Android development first steps
Android Bootcamp
Technology and Android.pptx
Mobile Application Development
architecture of android.pptx
Android Jump Start
Android app devolopment
Introduction to Android Development
Android Tutorial For Beginners Part-1
Project a day 2 android application fundamentals
Introduction to Android Development.pptx
Introduction & App Structure
Android app fundamentals
Android Technology
Getting started with android programming
Ad

More from AbdullahMunir32 (20)

PDF
Mobile Application Development-Lecture 15 & 16.pdf
PDF
Mobile Application Development-Lecture 13 & 14.pdf
PDF
Mobile Application Development -Lecture 11 & 12.pdf
PDF
Mobile Application Development -Lecture 09 & 10.pdf
PDF
Mobile Application Development -Lecture 07 & 08.pdf
PDF
Mobile Application Development-Lecture 03 & 04.pdf
PDF
Mobile Application Development-Lecture 01 & 02.pdf
PDF
Parallel and Distributed Computing Chapter 13
PDF
Parallel and Distributed Computing Chapter 12
PDF
Parallel and Distributed Computing Chapter 11
PDF
Parallel and Distributed Computing Chapter 10
PDF
Parallel and Distributed Computing Chapter 9
PDF
Parallel and Distributed Computing Chapter 8
PDF
Parallel and Distributed Computing Chapter 7
PDF
Parallel and Distributed Computing Chapter 6
PDF
Parallel and Distributed Computing Chapter 5
PDF
Parallel and Distributed Computing Chapter 4
PDF
Parallel and Distributed Computing chapter 3
PDF
Parallel and Distributed Computing Chapter 2
PDF
Parallel and Distributed Computing chapter 1
Mobile Application Development-Lecture 15 & 16.pdf
Mobile Application Development-Lecture 13 & 14.pdf
Mobile Application Development -Lecture 11 & 12.pdf
Mobile Application Development -Lecture 09 & 10.pdf
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development-Lecture 03 & 04.pdf
Mobile Application Development-Lecture 01 & 02.pdf
Parallel and Distributed Computing Chapter 13
Parallel and Distributed Computing Chapter 12
Parallel and Distributed Computing Chapter 11
Parallel and Distributed Computing Chapter 10
Parallel and Distributed Computing Chapter 9
Parallel and Distributed Computing Chapter 8
Parallel and Distributed Computing Chapter 7
Parallel and Distributed Computing Chapter 6
Parallel and Distributed Computing Chapter 5
Parallel and Distributed Computing Chapter 4
Parallel and Distributed Computing chapter 3
Parallel and Distributed Computing Chapter 2
Parallel and Distributed Computing chapter 1
Ad

Recently uploaded (20)

PDF
Business Ethics Teaching Materials for college
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PDF
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
PDF
Complications of Minimal Access Surgery at WLH
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
TR - Agricultural Crops Production NC III.pdf
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
01-Introduction-to-Information-Management.pdf
PDF
Insiders guide to clinical Medicine.pdf
PPTX
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
PDF
Classroom Observation Tools for Teachers
PPTX
Renaissance Architecture: A Journey from Faith to Humanism
PPTX
Institutional Correction lecture only . . .
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PPTX
PPH.pptx obstetrics and gynecology in nursing
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Business Ethics Teaching Materials for college
O7-L3 Supply Chain Operations - ICLT Program
human mycosis Human fungal infections are called human mycosis..pptx
Origin of periodic table-Mendeleev’s Periodic-Modern Periodic table
Complications of Minimal Access Surgery at WLH
Final Presentation General Medicine 03-08-2024.pptx
VCE English Exam - Section C Student Revision Booklet
TR - Agricultural Crops Production NC III.pdf
Microbial diseases, their pathogenesis and prophylaxis
01-Introduction-to-Information-Management.pdf
Insiders guide to clinical Medicine.pdf
Introduction to Child Health Nursing – Unit I | Child Health Nursing I | B.Sc...
Classroom Observation Tools for Teachers
Renaissance Architecture: A Journey from Faith to Humanism
Institutional Correction lecture only . . .
Module 4: Burden of Disease Tutorial Slides S2 2025
PPH.pptx obstetrics and gynecology in nursing
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx

Mobile Application Development Lecture 05 & 06.pdf

  • 1. Mobile Application Development (ITEC-303) Fahim Abid fahim.abid@uettaxila.edu.pk fahim.abid@uoc.edu.pk
  • 2. Credits Hours 3(3,0) Recommended Books 1. Professional Android application development, Reto Meier, Wrox Programmer to Programmer, 2015. 2. Android Programming: The Big Nerd Ranch Guides, Phillips, B. & Hardy, B., 2nd Edition, 2014. 3. iOS Programming: The Big Nerd Ranch Guide, Conway, J., Hillegass, A., & Keur, C., 5th Edition, 2014.
  • 3. What Makes an Android Application? Android applications consist of loosely coupled components, bound using a project manifest that describes each component and how they interact. There are six components that provide the building blocks for your applications:  Activities Your application’s presentation layer. Every screen in your application will be an extension of the Activity class. Activities use Views to form graphical user interfaces that display information and respond to user actions. In terms of desktop development, an Activity is equivalent to a Form.  Services The invisible workers of your application. Service components run invisibly, updating your data sources and visible Activities and triggering Notifications. They’re used to perform regular processing that needs to continue even when your application’s Activities aren’t active or visible.
  • 4.  Content Providers A shareable data store. Content Providers are used to manage and share application databases. Content Providers are the preferred way of sharing data across application boundaries. This means that you can configure your own Content Providers to permit access from other applications and use Content Providers exposed by others to access their stored data.  Intents A simple message-passing framework. Using Intents, you can broadcast messages system-wide or to a target Activity or Service, stating your intention to have an action performed. The system will then determine the target(s) that will perform any actions as appropriate.  Broadcast Receivers Intent broadcast consumers. By creating and registering a Broadcast Receiver, your application can listen for broadcast Intents that match specific filter criteria. Broadcast Receivers will automatically start your application to respond to an incoming Intent, making them ideal for event- driven applications.
  • 5.  Notifications A user notification framework. Notifications let you signal users without stealing focus or interrupting their current Activities. They’re the preferred technique for getting a user’s attention from within a Service or Broadcast Receiver. For example, when a device receives a text message or an incoming call, it alerts you by flashing lights, making sounds, displaying icons, or showing dialog messages. You can trigger these same events from your own applications using Notifications.
  • 6. Android Application Manifest Each Android project includes a manifest file, AndroidManifest.xml, stored in the root of its project hierarchy. The manifest defines the structure and metadata of your application, its components and its requirements. It includes nodes for each of the Activities, Services, Content Providers and Broadcast Receivers that make up your application and using Intent Filters and Permissions, determines how they interact with each other and with other applications. The manifest can also specify application metadata (such as its icon, version number or theme), and additional top-level nodes can specify any required permissions, unit tests and define hardware, screen, or platform requirements. The manifest is made up of a root manifest tag with a package attribute set to the project’s package. It should also include an xmlns:android attribute that supplies several system attributes used within the file.
  • 7. Using the Manifest Editor To use the Manifest Editor in Android Studio, left click in your project folder.
  • 8. Android Application Life Cycle Unlike most traditional environments, Android applications have no control over their own life cycles. Instead, application components must listen for changes in the application state and react accordingly, taking particular care to be prepared for untimely termination. by default, each Android application is run in its own process that’s running a separate instance of Dalvik. Memory and process management of each application is handled exclusively by the run time. Android aggressively manages its resources, doing whatever it takes to ensure that the device remains responsive. This means that processes (and their hosted applications) will be killed, without warning if necessary, to free resources for higher-priority applications — generally those that are interacting directly with the user at the time.
  • 9. Android Application Priority and Process States The order in which processes are killed to reclaim resources is determined by the priority of the hosted applications. An application’s priority is equal to its highest- priority component. Where two applications have the same priority, the process that has been at a lower priority longest will be killed first. Process priority is also affected by inter- process dependencies; if an application has a dependency on a Service or Content Provider supplied by a second application, the secondary application will have at least as high a priority as the application it supports. All Android applications will remain running and in memory until the system needs its resources for other applications.
  • 10. shows the priority tree used to determine the order of application termination
  • 11. Externalizing Resources Android supports the externalization of resources ranging from simple values such as strings and colors to more complex resources like images (drawables), animations, and themes. Perhaps the most powerful resources available for externalization are layouts. By externalizing resources, they become easier to maintain, update, and manage. This also lets you easily define alternative resource values to support different hardware and internationalization. Android dynamically selects resources from resource trees that let you define alternative values based on a device’s hardware configuration, language, and location. This lets you create different resource values for specific languages, countries, screens, and keyboards. When an application starts, Android will automatically select the correct resource values without your having to write a line of code.
  • 12. Closer Look at Android Activities Each Activity represents a screen that an application can present to its users. The more complicated your application, the more screens you are likely to need. Typically, this includes at least a primary interface screen that handles the main UI functionality of your application. This primary interface generally consists of a number of Fragments that make up your UI and is generally supported by a set of secondary Activities. To move between screens you start a new Activity. Most Activities are designed to occupy the entire display, but you can also create semitransparent or floating Activities.
  • 13. Creating Activities Extend Activity to create a new Activity class. Within this new class you must define the UI and implement your functionality. The base Activity class presents an empty screen that encapsulates the window display handling. An empty Activity isn’t particularly useful, so the first thing you’ll want to do is create the UI with Fragments, layouts, and Views. Views are the UI controls that display data and provide user interaction. Android provides several layout classes, called View Groups, which can contain multiple Views to help you layout your UIs. Fragments are used to encapsulate segments of your UI, making it simple to create dynamic interfaces that can be rearranged to optimize your layouts for different screen sizes and orientations.
  • 14. Installation, Configuration and Understanding Functionality of Android Studio Android Studio -2021.1.1.23 Android Project Folders • java/ ‐ Source files for the module. • manifests/ ‐ Manifest files for the module. • res/ ‐ Resource files for the module.
  • 15. Some important resource types include: • drawable: Bitmap files (.png, .9.png, .jpg, .gif) or XML files that are compiled into drawable resource. • layout: XML files that define a user interface layout. • menu: XML files that define application menus, such as an Options Menu, Context Menu, or Sub Menu. • values: XML files that contain simple values, such as strings, integers, and colors.
  • 16. Android Project Files • Java Files: (Source Code) • Resources: – XML Files (Layouts, Values, Menus, Colors etc.) – Images & Other Media Files • Libraries: • Assets (Text & Database Files)
  • 17. Gradle • Android Studio uses Gradle to compile and build your app. • There is a build.gradle file for each module of your project, as well as a build.gradle file for the entire project. • Usually, you're only interested in the build.gradle file for the module. • This is where your app's build dependencies are set, including the defaultConfig settings.