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

ODP
Nativa Android Applications development
PDF
Android Introduction by Kajal
PPTX
MAD_UNIT-3.pptx mobile application development
PPTX
architecture of android.pptx
PPTX
5 beginner android application development foundation
PPT
UPDATED Application fundamentals lec 1 &2.ppt
DOCX
Android article
PPTX
UNIT5newpart1pptx__2024_11_13_09_51_59 (1).pptx
Nativa Android Applications development
Android Introduction by Kajal
MAD_UNIT-3.pptx mobile application development
architecture of android.pptx
5 beginner android application development foundation
UPDATED Application fundamentals lec 1 &2.ppt
Android article
UNIT5newpart1pptx__2024_11_13_09_51_59 (1).pptx

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

PPTX
Android 1-intro n architecture
PPTX
Building blocks of android
PDF
android-developer-fundamentals-course-concepts-en.pdf
PPTX
Notes Unit3.pptx
PPTX
Android beginners David
PPTX
01. Introduction to Android_lecture1.pptx
PDF
android app development training report
PDF
B041130610
PPT
Android ppt
DOC
Mobile testing android
PDF
Speed delivery of Android devices and applications with model-driven development
PDF
Android development-tutorial
PPTX
Beginning android
PPTX
Introduction to Android Development
DOCX
Android Tutorial For Beginners Part-1
PPTX
hema ppt (2).pptx
PPTX
Getting started with android programming
PDF
Android Basic- CMC
PDF
Mobile Application Development-Lecture 01 & 02.pdf
PPTX
Android Development Basics
Android 1-intro n architecture
Building blocks of android
android-developer-fundamentals-course-concepts-en.pdf
Notes Unit3.pptx
Android beginners David
01. Introduction to Android_lecture1.pptx
android app development training report
B041130610
Android ppt
Mobile testing android
Speed delivery of Android devices and applications with model-driven development
Android development-tutorial
Beginning android
Introduction to Android Development
Android Tutorial For Beginners Part-1
hema ppt (2).pptx
Getting started with android programming
Android Basic- CMC
Mobile Application Development-Lecture 01 & 02.pdf
Android Development Basics
Ad

More from AbdullahMunir32 (19)

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
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
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
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
PDF
Updated Idioms and Phrasal Verbs in English subject
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
PDF
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
PPTX
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
PDF
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
PDF
LDMMIA Reiki Yoga Finals Review Spring Summer
PDF
Microbial disease of the cardiovascular and lymphatic systems
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
Complications of Minimal Access Surgery at WLH
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
Lesson notes of climatology university.
PPTX
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPTX
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
PPTX
master seminar digital applications in india
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx
STATICS OF THE RIGID BODIES Hibbelers.pdf
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Updated Idioms and Phrasal Verbs in English subject
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
ChatGPT for Dummies - Pam Baker Ccesa007.pdf
GENETICS IN BIOLOGY IN SECONDARY LEVEL FORM 3
UV-Visible spectroscopy..pptx UV-Visible Spectroscopy – Electronic Transition...
LNK 2025 (2).pdf MWEHEHEHEHEHEHEHEHEHEHE
LDMMIA Reiki Yoga Finals Review Spring Summer
Microbial disease of the cardiovascular and lymphatic systems
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
Complications of Minimal Access Surgery at WLH
Supply Chain Operations Speaking Notes -ICLT Program
Lesson notes of climatology university.
202450812 BayCHI UCSC-SV 20250812 v17.pptx
PPT- ENG7_QUARTER1_LESSON1_WEEK1. IMAGERY -DESCRIPTIONS pptx.pptx
master seminar digital applications in india
What if we spent less time fighting change, and more time building what’s rig...
Chinmaya Tiranga quiz Grand Finale.pdf
Radiologic_Anatomy_of_the_Brachial_plexus [final].pptx

Mobile Application Development Lecture 05 & 06.pdf

  • 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.