Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 27

Mobile App Development

Primary Components of Android Mobile App

Hajrah Jahan
Overview

• Main components of Android Mobile App


• Android Emulator (AVD)
• Different types of Navigations in Android
Activity
Represents a single screen

View
UI element such as button,
label, text field etc.

Intent
Invokes these components
Content Providers
Share data between the
applications
Fragments
One or more parts of an
activity displayed on the
screen at the same time.
Services
Background processes that can run for a long time.

Local Services:
Accessed from within the application.

Remote Services:
Accessed from other applications.
Android Emulator

• An AVM, Android Virtual Device.

• Represents a specific Android device.

• A target device to execute and test our Android application on our


PC.

• It gives the location of the device and simulates different network


speeds.

• Simulates rotation and other hardware sensors.

• It accesses the Google Play store, and much more.


Activity Lifecycle
Local Services
Background processes from the app that can run for a long time.

Foreground Services:
● These services are used to perform tasks that
are noticeable to users.
● They stay alive even when the app is
terminated.
● Must display a notification while they are
running.
● For example, playing audio or saving an edited
video.
Background Services:

● Runs only when the app is running so it'll get terminated when the app is terminated.

● These are not noticeable to the users.

● Keep in mind that Android places some restrictions on background services in order to optimize

performance.

● For Example, Storage optimization


Bound services:

● When an application component binds to the service.

● Bound services provide an interface that allows them to interact with app components, and these services

only run as long as they are bound to an application component.

● Runs only if the component it is bound to is still active.

● For Example - Saving data to the database


Content Providers

● A content provider is a component for managing a data set.

● This data set can be private to your application or can be shared, with other

apps able to query and modify the data.

● In case it is for your app, the UI components such as activities will use the

content provider to interact with the data.

● When used by other apps, the content provider manages access to the data

through standard methods to interact with structured data sets such as


Broadcast Receivers

● The Android system makes various types of broadcasts an app can respond to.

● You can also develop apps to make these broadcasts, but this is far less likely than

listening for existing broadcasts.

● For example, information about the device's hardware, such as the battery level, the

screen shutting off, the charger being plugged into an outlet, etc.
Widgets

● These are the small visual application

components that you can find on the

home screen of the devices.

● They are a special variation of

Broadcast Receivers that allow us to

create dynamic, interactive application

components for users to embed on

their Home Screen.


Widgets
Information widget:

● These widgets display crucial information and track how the

information changes over time.

● For example – Clock widgets and widgets that display weather

and time information.

Control widget:

● These widgets display functionalities and by using them, the

user can trigger from home screen without opening the

application.

● For example – pause and play the video outside the application.
Widgets
Collection widget:

● Collection widgets are a collection of information of the same type.

● Used for browsing information and opening any one of the elements to

view details.

● For example – music widgets, as we can skip pause and play music

outside the music application.

Hybrid widget:

● These widgets combine features of all the other three widgets.

● For example – music player widget is a control widget that also

displays information about the music to the user.


Notifications
● Notifications are the application alerts that are used to

draw the user’s attention to some particular app event

without stealing focus or interrupting the current activity of

the user.

● They are generally used to grab user’s attention when the

application is not visible or active, particularly from within

a Service or Broadcast Receiver.

● For example, Email popups, Messenger popups, etc.


Action Bar
● The action bar, also known as the app bar, is a key user interface element.

● The action bar gives your app a user interface component that is consistent across the Android

system.

● Typical items displayed in the action bar include shortcuts to common actions, including

navigation between the parts of the app.


Top Navigation Bar
● This consists of a navigation bar, located at the top of the screen.

● It offers most of the benefits from bottom navigation, minus the ease of use while holding mobile

devices.

● With larger phones, many users will have to use both hands or change their grasp in order to

reach all the links.

● Bottom navigation bar is a better version of the top navigation bar.


Tabs
● Tabs allow users to quickly move between a small number of equally important views.

Appropriate for these hierarchies:

○ Parents with embedded child views

○ A group of sibling views

Recommended for:

○ Frequent switching between views

○ Apps with few top-level views

○ Promoting awareness of alternate views


Bottom navigation bar
● A bottom navigation bar allows users to quickly move between a small number of top-level views.

Appropriate for these hierarchies:

○ Parents with embedded child views

○ A group of parent views

Recommended for:

○ Frequent switching between views

○ Apps with few top-level views

○ Promoting awareness of alternate views

○ Mobile devices, as bottom navigation is located in a more ergonomic location


Navigation drawer - The hamburger menu
● When there is insufficient space to support tabs, side navigation is a good alternative as it can display

many navigation targets at once.

● A drawer remains hidden until invoked by the user.

Appropriate for these hierarchies:

○ Lateral navigation

○ Parents with siblings or peers

Recommended for:

○ Apps with many top-level views

○ Enabling navigation between unrelated views

○ Reducing visibility of infrequent destinations


Navigation drawer - The hamburger menu
Cards
● Card UI design is a brilliant design pattern and can really

make your mobile UI pop as a result of their highly visual and

customizable nature.

● They come in all shapes and sizes and are a great way to

showcase various elements such as text, a link, or a photo in

one place and have become very popular in mobile app

navigation.

● Aggregates individual pieces of information in one place.


Handouts

• https://developer.android.com/guide/components/fundamentals

• https://www.javatpoint.com/android-core-building-blocks#:~:text=The%20core%20building%20blocks%20

or,%2C%20fragments%20and%20AndroidManifest.xml

• https://www.youtube.com/watch?v=r3YbZ7N8xAM

• https://www.youtube.com/watch?v=W2Xn42Id2V4
Handouts

• https://www.androidpolice.com/how-to-manage-notifications-android-phone/

• https://developer.android.com/develop/ui/views/appwidgets/overview

• https://developer.android.com/develop/ui/views/notifications

• https://developer.android.com/guide/components/services

• https://developer.android.com/guide/topics/providers/content-provider-basics

• https://developer.android.com/guide/components/broadcasts
Handouts

• https://m2.material.io/design/navigation/understanding-navigation.html#lateral-navigation

• https://android-course.cornellappdev.com/chapters/8.-navigation/8.1-types-of-navigation

• https://www.justinmind.com/blog/mobile-navigation/

• https://m1.material.io/patterns/navigation.html#navigation-combined-patterns

• https://www.nngroup.com/articles/mobile-navigation-patterns/

You might also like