0% found this document useful (0 votes)
4 views42 pages

Mobile Application Development Pt1

The document provides an overview of mobile application development, including definitions of mobile phones, types of mobile applications, and the development process. It discusses device constraints, various app types, and the architecture of Android, along with its components and development tools. Additionally, it covers layout design and attributes essential for creating user interfaces in Android applications.

Uploaded by

csnjawa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views42 pages

Mobile Application Development Pt1

The document provides an overview of mobile application development, including definitions of mobile phones, types of mobile applications, and the development process. It discusses device constraints, various app types, and the architecture of Android, along with its components and development tools. Additionally, it covers layout design and attributes essential for creating user interfaces in Android applications.

Uploaded by

csnjawa
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Mobile Application

Development Pt-1
Introduction

BY Gift Msigwa

ITT 06214
1. Introduction

❖ What is Mobile?
➢ able to move or be moved freely or easily.
❖ What is Mobile Phone?
➢ is a portable telephone that can make and receive calls over a radio frequency link while the user is moving
within a telephone service area, as opposed to a fixed-location phone.
❖ Type Of Mobile Phone?
➢ Feature phone
➢ Smartphone
Mobile Devices in the Development Process

❖ Target Device Selection


➢ Decide supported devices before coding
➢ Affects language, framework, minimum API level, and UI design
➢ Low-end device markets (e.g., Tanzania) → prioritize performance & small APK size
❖ Device Fragmentation
➢ Thousands of Android devices with varying screen sizes, RAM, and OS versions
➢ Apps must be tested across multiple configurations
❖ Development Machine vs Target Device
➢ Deploy to a physical device via USB using ADB
➢ Or use a virtual device via Android Emulator in Android Studio
❖ Testing on Real Devices Reveals:
➢ Actual battery consumption
➢ GPS & sensor accuracy
➢ Camera quality
➢ Real network behavior (Wi-Fi vs mobile data switching)
Introduction Cont…

❖ What is Operating system (OS)?


➢ is system software that manages computer hardware, software resources, and provides common services
for computer programs.
❖ Example of Mobile OS?
➢ Android OS
➢ iPhone OS / iOS
➢ Symbian OS
➢ Windows Mobile OS
➢ BlackBerry OS
➢ Harmony OS
➢ Palm OS
➢ WebOS (Palm/HP)
Introduction Cont…

❖ Mobile Application :- is a software application developed specifically for use on small, wireless
computing devices, such as smartphones.
❖ Example Of Mobile Application
➢ Facebook.
➢ Instagram.
➢ Pinterest.
➢ Snapchat.
➢ Spotify
➢ Tripadvisor
➢ Uber
Introduction Cont...

❖ Mobile applications can run on:


➢ Smartphones
➢ Tablets
➢ Smart TV
➢ Smart Watch
Device Constraints
Constraint What Developer Must Do

Screen Size Use flexible layouts (e.g., ConstraintLayout) for different screen sizes
Processing Power Run heavy tasks in background threads (Coroutines, WorkManager)

Memory & Storage Compress images, cache large files, avoid memory leaks
Battery Life Minimize background services and use JobScheduler/Doze Mode rules
Connectivity Handle offline mode, cache data locally, sync when back online
Security Use HTTPS, encrypt data, request only necessary permissions
Types of Mobile Apps by Technology

❖ Native apps are created for one specific platform or operating system.
❖ Web apps are responsive versions of websites that can work on any mobile device or OS because
they’re delivered using a mobile browser.
❖ Hybrid apps are combinations of both native and web apps, but wrapped within a native app, giving
it the ability to have its own icon or be downloaded from an app store.
Hardware & Scripting Technologies

Key Hardware Components

Hardware Example App Use


Camera QR scanner, photo apps
GPS Maps, delivery tracking
Accelerometer Step counter, gaming
Proximity Sensor Auto screen-off on calls
NFC Mobile payments
Microphone Voice recording
Bluetooth / Wi-Fi File sharing, IoT
Hardware & Scripting Technologies

Scripting Technologies by App Type

App Type Technologies Hardware Access

Native Java, Kotlin, Swift Full

Web App HTML5, CSS, JavaScript Limited (browser only)

Hybrid Ionic, React Native, Flutter Medium (via plugins)

Cross-Platform Flutter (Dart), React Native Near-full


App Building Approaches

❖ When it comes to mobile app development, these are the 4 most popular approaches:
➢ Native Mobile Applications
➢ Cross-Platform Native Mobile Applications
➢ Hybrid Mobile Applications
➢ Progressive Web Applications

NOTE: Each of these methods for developing mobile applications has both advantages and disadvantages.
Native Applications Development

❖ Native mobile applications are written by the programming language and frameworks provided by
the platform owner.
❖ A native app runs directly on the operating system of the device such as iOS and Android.
❖ Pros
➢ Best performance in terms of runtime
➢ Direct access to the device’s APIs
❖ Cons
➢ Higher costs for developing and maintaining apps
➢ Various code bases for each platform
Cross-Platform Applications Development

❖ Multiplatform mobile development is an approach that allows you to build a single mobile
application that runs smoothly on several operating systems.
❖ Cross-platform applications can be written in various programming languages and frameworks.
❖ But they are bundled into a native application that would run on the operating system of the
device.
❖ Pros
➢ Single code base for multiple platforms
➢ Easy to develop and maintain
❖ Cons
➢ Relying on on bridges and libraries for native features
➢ Performance limitations due to bridging
2. Android

❖ What is Android?
➢ is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet
computers.
➢ Android was developed by the Open Handset Alliance, led by Google, and other companies.
❖ Android offers a unified approach to application development for mobile devices
❖ which means developers need to develop only for Android, and their applications should be able to
run on different devices powered by Android
Android API Level And Version

❖ API( Application Programming Interface ) Level is an integer value that uniquely identifies the
framework API revision offered by a version of the Android platform.
❖ Android version indicates the version of Android platform.
❖ Android versions (codenames) are used to describe the various updates for the open source
Android mobile operating system.
Android Architecture

❖ Android operating system is a stack of software components which is roughly divided into five
sections and four main layers as shown below in the architecture diagram.
Linux kernel

❖ At the bottom of the layers is Linux


❖ This provides basic system functionality like process management, memory management, device
management like camera, keypad, display etc.
❖ Also, the kernel handles all the things that Linux is really good at, such as networking and a vast
array of device drivers, which take the pain out of interfacing to peripheral hardware.
Libraries

❖ On top of Linux kernel there is a set of libraries including open-source Web browser engine
WebKit, well known library libc, SQLite database which is a useful repository for storage and
sharing of application data, libraries to play and record audio and video, SSL libraries responsible
for Internet security etc.
Android Runtime

❖ This is the third section of the architecture and available on the second layer from the bottom. This
section provides a key component called Dalvik Virtual Machine which is a kind of Java Virtual
Machine specially designed and optimized for Android.
❖ The Dalvik VM makes use of Linux core features like memory management and multi-threading,
which is intrinsic in the Java language.
❖ The Android runtime also provides a set of core libraries which enable Android application
developers to write Android applications using standard Java programming language.
Application Framework

❖ The Application Framework layer provides many higher-level services to applications in the form
of Java classes.
❖ Application developers are allowed to make use of these services in their applications.
❖ The Android framework includes the following key services :-
➢ Activity Manager − Controls all aspects of the application lifecycle and activity stack.
➢ Content Providers − Allows applications to publish and share data with other applications.
➢ Resource Manager − Provides access to non-code embedded resources such as strings, color settings and
user interface layouts.
➢ Notifications Manager − Allows applications to display alerts and notifications to the user.
➢ View System − An extensible set of views used to create application user interfaces.
Applications

❖ You will find all the Android application at the top layer.
❖ You will write your application to be installed on this layer only.
❖ Examples of such applications are Contacts Books, Browser, Games, etc.
Android Application components

❖ Application components are the essential building blocks of an Android application.


❖ These components are loosely coupled by the application manifest file [Link] that
describes each component of the application and how they interact.
❖ There are following four main components that can be used within an Android application:
➢ Activities
➢ Services
➢ Broadcast Receivers
➢ Content Providers
Activities

❖ An activity represents a single screen with a user interface.


❖ For example, an email application might have one activity that shows a list of new emails, another
activity to compose an email, and one for reading emails.
❖ If an application has more than one activity, then one of them should be marked as the activity that
is presented when the application is launched.
Services

❖ A service is a component that runs in the background to perform long-running operations.


❖ For example, a service might
➢ play music in the background while the user is in a different application,
➢ or it might fetch data over the network without blocking user interaction with an activity.
Broadcast Receivers

❖ Broadcast Receivers simply respond to broadcast messages from other applications or from the
system.
❖ For example, applications can also initiate broadcasts to let other applications know that some data
has been downloaded to the device and is available for them to use, so this is broadcast receiver
who will intercept this communication and will initiate appropriate action.
Content Providers

❖ A content provider component supplies data from one application to others on request.
❖ Such requests are handled by the methods of the ContentResolver class.
❖ The data may be stored in the file system, the database or somewhere else entirely.
Additional Components
Android SDK

❖ The Android SDK (software development kit) is a set of development tools used to develop
applications for the Android platform that has become Apple’s biggest rival in the smartphone
space.
❖ The Android SDK includes the following:
➢ Required libraries.
➢ Debugger.
➢ An emulator.
➢ Relevant documentation for the Android application program interfaces (APIs).
➢ Sample source code.
➢ Tutorials for the Android OS.
Android Debug Bridge (adb)

❖ Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a
device.
❖ The adb command facilitates a variety of device actions, such as the following:
➢ installing
➢ and debugging apps.
❖ It is a client-server program that includes three components:
➢ A client, which sends commands.
■ client runs on your development machine
■ You can invoke a client from a command-line terminal by issuing an adb command.
➢ A daemon (adbd), which runs commands on a device.
■ The daemon runs as a background process on each device
➢ A server, which manages communication between the client and the daemon.
■ The server runs as a background process on your development machine.
Android Emulator

❖ The Android Emulator simulates Android devices on your computer so that you can test your
application on a variety of devices and Android API levels without needing to have each physical
device.
❖ The emulator offers these advantages:
➢ Flexibility
➢ High fidelity
➢ Speed
Layouts

❖ A layout defines the structure for a user interface in your app, such as in an activity.
❖ All elements in the layout are built using a hierarchy of:
➢ View :- usually draws something the user can see and interact with.
➢ ViewGroup :- is an invisible container that defines the layout structure for View and other ViewGroup
objects
Layouts

❖ View objects are usually called "widgets" and can be one of many subclasses, such as Button or
TextView.
❖ ViewGroup objects are usually called "layouts" can be one of many types that provide a different
layout structure, such as LinearLayout or ConstraintLayout .
❖ You can declare a layout in two ways:
➢ Declare UI elements in XML.
➢ Instantiate layout elements at runtime.
❖ The Android framework gives you the flexibility to use either or both of these methods to build
your app's UI.
Write the XML

❖ Using Android's XML vocabulary, you can quickly design UI layouts and the screen elements they
contain, in the same way you create web pages in HTML — with a series of nested elements.
❖ Each layout file must contain exactly one root element, which must be a View or ViewGroup object.
Load the XML resource.

❖ When you compile your app, each XML layout file is compiled into a View resource.
❖ You should load the layout resource from your app code in your [Link]() callback
implementation.
❖ Do so by calling setContentView(), passing it the reference to your layout resource in the form of:
[Link].layout_file_name.
Android Layout Types

❖ There are number of Layouts provided by Android which you will use in almost all the Android
applications to provide different view, look and feel.
➢ LinearLayout
■ LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally.
➢ RelativeLayout
■ RelativeLayout is a view group that displays child views in relative positions.
➢ TableLayout
■ TableLayout is a view that groups views into rows and columns.
➢ AbsoluteLayout
■ AbsoluteLayout enables you to specify the exact location of its children.
➢ FrameLayout
■ The FrameLayout is a placeholder on screen that you can use to display a single view.
➢ ListView
■ ListView is a view group that displays a list of scrollable items.
➢ GridView
■ GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid.
Layout Attributes

❖ Each layout has a set of attributes which define the visual properties of that layout.
❖ There are few common attributes among all the layouts and there are other attributes which are
specific to that layout.
❖ Following are common attributes and will be applied to all the layouts:
➢ android:id :- This is the ID which uniquely identifies the view.
➢ android:layout_width :- This is the width of the layout.
➢ android:layout_height :- This is the height of the layout
➢ android:layout_marginTop :- This is the extra space on the top side of the layout.

You might also like