MAD Compiled
MAD Compiled
Data Integration: The process of combining data from different sources into a unified
view. It focuses on bringing data together, often for analysis or a consolidated
application.
i. Android: A mobile operating system based on the Linux kernel, primarily designed for
touchscreen mobile devices such as smartphones and tablets.
ii. Smartphone: A mobile phone with advanced computing capabilities and connectivity
beyond basic calling and texting, often including internet access, app support, and
multimedia features.
iii. Google Play: A digital distribution service operated and developed by Google. It
serves as the official app store for the Android operating system, allowing users to
browse and download apps, games, music, movies, TV shows, and books.
iv. Mobile Application Development: The process of creating software applications that
are designed to run on mobile devices such as smartphones and tablets.
(c) Give the main role of the main activity file in Android development.
The main activity file (typically a .java or .kt file) in Android development is the entry point for
the application's user interface. It defines the initial screen that the user sees when the app is
launched and handles the setup and logic for that screen.
(d) Describe any four basic steps that a developer follows when designing UI elements in an
application.
1. Planning and Wireframing: Sketching out the basic layout and flow of the UI elements
on the screen.
3. Layout Design: Arranging the chosen UI components on the screen using layout
managers (like LinearLayout, ConstraintLayout) to ensure proper positioning and
responsiveness.
4. Styling and Theming: Applying visual styles (colors, fonts, sizes) to the UI elements to
create an appealing and consistent user interface.
(e) What is the function of an Android Virtual Device (AVD) and what is it used for?
An Android Virtual Device (AVD) is an emulator instance that simulates an actual Android device
on your computer. It is used for testing Android applications in a virtual environment without
needing a physical device. [cite: 1]
The Mobile Application Development Life Cycle (SDLC) typically involves the following phases:
1. Planning/Requirement Analysis: Defining the app's goals, target audience, features, and
technical requirements.
2. Design: Creating the app's user interface (UI) and user experience (UX), including
wireframes, mockups, and prototypes.
3. Development/Implementation: Writing the actual code for the app based on the design
specifications.
4. Testing: Thoroughly testing the app for bugs, usability issues, performance, and security
on emulators and real devices.
5. Deployment: Publishing the app to app stores (like Google Play) or deploying it through
other channels.
6. Maintenance: Providing ongoing support, bug fixes, updates, and new features for the
released app.
Local Data Storage: It allows the app to store data directly on the device for offline
access and faster retrieval.
Data Persistence: It ensures that app data is retained even after the app is closed or the
device is restarted.
Structured Data Management: It provides a structured way to organize and manage app
data, making it easier to query and manipulate.
Data Replication: The process of creating and maintaining multiple copies of data across
different storage locations. The primary goal is often to improve data availability, fault
tolerance, and read performance. Synchronization is often a mechanism used to keep
these replicas consistent.
Key difference: Synchronization focuses on data consistency across active systems, while
replication focuses on creating copies for availability and performance, with synchronization
often used to maintain consistency between the replicas and the source.
Native Apps: These are built specifically for a particular mobile operating system (like
iOS or Android) using the platform's native development tools and languages (e.g.,
Swift/Objective-C for iOS, Kotlin/Java for Android). They offer the best performance and
access to all device features.
Web Apps: These are essentially websites optimized for mobile devices. They are
accessed through a web browser and are built using web technologies like HTML, CSS,
and JavaScript. They are platform-agnostic but may have limited access to device
features and can be less performant than native apps.
Hybrid Apps: These are built using web technologies but are packaged within a native
container. Frameworks like Cordova or Ionic enable this. They aim to provide cross-
platform compatibility while still having some access to device features through plugins.
Their performance can vary and might not be as optimal as native apps.
(a) Describe any five functions of a server-side application within a mobile app.
Data Storage and Management: Servers often host the primary database for the mobile
app, managing large datasets and ensuring data integrity.
User Authentication and Authorization: Servers handle user registration, login, and
control access to protected resources and functionalities.
Business Logic and Processing: Complex calculations, data manipulation, and business
rules are often executed on the server for security and efficiency.
Push Notifications: Servers can initiate and manage the sending of push notifications to
mobile devices.
Integration with Third-Party Services: Servers can handle communication and
integration with other APIs and services (e.g., payment gateways, social media).
(b) Mobile app testing is an integral part of mobile app development. Explain five tools used
in app testing across the different operating systems.
Android Studio Emulator/iOS Simulator: Built-in tools within the respective IDEs that
allow developers to test apps on virtual devices with various configurations.
Espresso (Android): A UI testing framework for Android that allows developers to write
automated tests to interact with the app's UI.
XCUITest (iOS): Apple's UI testing framework for iOS that enables automated UI testing
of apps.
Appium: An open-source automation framework that can be used to test native, web,
and hybrid mobile apps across Android and iOS platforms.
Firebase Test Lab: A cloud-based testing service that allows developers to test their apps
on a wide range of real Android and iOS devices.
Pull Synchronization: The client (mobile app) initiates the synchronization process by
requesting updates from the server.
Two-Way Synchronization: Changes made on either the client or the server are
propagated to the other, ensuring both have the latest data.
(b) Provide a detailed comparison between the three data synchronization techniques under
the following key points.
Server needs to be
Client needs to be configured with client Both client and server
v. configured with the server addresses or mechanisms need to be configured for
Configuration address and polling to reach clients (e.g., connection and conflict
schedule. push notification resolution strategies.
services).
Emulator: Software that imitates a mobile device on a computer for testing apps. [cite:
1]
SDK manager: Tool to download and manage Android development tools and libraries.
[cite: 2]
IDE: Software application that provides tools for writing and testing code (e.g., Android
Studio). [cite: 2]
Platform Fragmentation: Supporting various Android versions and device screen sizes.
Security Concerns: Protecting user data and the app from threats.
Battery Consumption: Minimizing the app's impact on device battery life.
(c) Explain two UI design issues that can be considered during apps development.
Poor Navigation: Difficult or confusing ways for users to move through the app.
Python
Node.js
Java
PHP
(e) Explain the following security threats in the mobile environment and counter measures.
Tampering: Unauthorized modification of the app or its data. Counter measure: Code
obfuscation, integrity checks. [cite: 4]
(f) Explain two approaches that Android apps use to send notifications to a user.
Firebase Cloud Messaging (FCM): A Google service for sending push notifications. [cite:
5]
Using a custom server: The app connects to a developer's own server which then
handles notification delivery. [cite: 5]
i. Mobile computing: Using portable computing devices (like smartphones and tablets)
and wireless networks to transmit and access data.
ii. Mobile application (app): Software program designed to run on mobile devices,
offering specific functionalities to users.
iii. Emulators: Software that mimics the hardware and software of a mobile device on a
computer, used for app testing. [cite: 1]
User experience (UX) in mobile computing refers to the overall feeling and satisfaction a user
has while interacting with a mobile app or device. It encompasses aspects like usability,
accessibility, performance, and pleasure of use.
(c) Differentiate between the term thin client and fat client as used in mobile computing.
Thin client: A mobile app or device that relies heavily on a server for processing and data
storage. It typically has minimal local resources and primarily displays information from
the server.
Fat client: A mobile app or device that performs most of the processing and data storage
locally. It can function with limited or no connection to a server.
Limited Resources: Mobile devices have constraints like processing power, battery life,
and storage capacity.
Security Risks: Mobile devices are susceptible to threats like malware, data breaches,
and unauthorized access.
(e) Describe any five design issues related to mobile app design.
Small Screen Size: Designing interfaces that are easy to navigate and view on limited
screen real estate.
Touch Interaction: Optimizing for touch gestures and ensuring adequate touch target
sizes.
Context of Use: Considering that users interact with apps in various environments and
situations.
Responsiveness: Ensuring the app adapts well to different screen sizes and orientations.
(a) Explain mobile application deployment options available to designers.
App Stores (e.g., Google Play Store, Apple App Store): The primary way to distribute
apps to a wide audience.
Sideloading: Installing apps directly onto a device without using an official app store
(common for development and specific use cases).
(b) Describe any three server connection types available to mobile application developers.
RESTful APIs (HTTP): A common architectural style for building web services that mobile
apps can communicate with using standard HTTP methods (GET, POST, PUT, DELETE).
GraphQL: A query language for APIs that allows clients to request specific data, reducing
over-fetching and improving efficiency.
Mobile phones utilize various interaction styles to allow users to engage with applications and
the operating system. Here are some key ones:
1. Direct Manipulation: This involves users directly interacting with objects on the screen
using touch gestures. Examples include tapping icons to open apps, swiping to scroll or
navigate, pinching to zoom, and dragging and dropping items. It provides a feeling of
direct control and immediacy.
2. Gestural Interaction: This style relies on specific finger movements across the screen to
trigger actions. Beyond basic swipes and pinches, this includes gestures like long presses,
double taps, flicking, and more complex multi-finger gestures. Different apps and
operating systems may define unique custom gestures.
3. Voice Interaction: Utilizing voice commands to interact with the device. This includes
voice assistants like Google Assistant or Siri, voice search, dictating messages, and
controlling app features using spoken words.
4. Virtual Keyboards: On-screen keyboards that appear when text input is required. Users
type by tapping on the virtual keys. These keyboards often offer features like auto-
correction, predictive text, and different layouts.
5. Hardware Buttons and Sensors: Physical buttons (like volume controls, power button,
and sometimes dedicated assistant buttons) and device sensors (like accelerometer,
gyroscope, proximity sensor) can be used for interaction. For example, shaking the
phone to undo an action or using the proximity sensor to turn off the screen during a
call.
6. Context Menus: Holding down on an element often brings up a context menu with
actions relevant to that specific element. This provides access to less frequently used
options without cluttering the main interface.
7. Pull-to-Refresh: A common gesture where users swipe down from the top of a list or
feed to trigger a refresh of the content.
8. Carousels and Swiping Tabs: Used for navigating through multiple screens or sections of
content by swiping horizontally.
9. Bottom Navigation and Tab Bars: Persistent on-screen elements that allow users to
quickly switch between different primary sections of an application.
10. Floating Action Buttons (FABs): Circular buttons that typically represent the primary
action within a screen.
1. Intuitive and Easy to Learn: Direct interaction with on-screen objects feels natural and
often requires less explicit instruction. Users can often figure out how to interact
through exploration.
2. Provides a Sense of Direct Control: Users feel like they are directly manipulating the
objects, leading to a greater sense of control and engagement with the interface. Actions
feel immediate and have a clear visual consequence.
3. Faster and More Efficient Interaction for Many Tasks: For tasks like scrolling, zooming,
and rearranging items, direct manipulation can be quicker and more efficient than using
abstract commands or menus.
(c) Describe and clearly show the benefits of good UI design practice.
Good User Interface (UI) design practice focuses on creating interfaces that are visually
appealing, easy to use, and effective in helping users achieve their goals. The benefits of good UI
design are numerous and impact various aspects of a product's success:
Benefits:
2. Increased User Adoption and Satisfaction: When an interface is intuitive and visually
pleasing, new users are more likely to adopt the application, and existing users are more
likely to be satisfied with it. This can lead to positive word-of-mouth and increased app
store ratings.
3. Enhanced Efficiency and Productivity: A clear and well-organized UI allows users to find
information and perform tasks quickly and easily. This can lead to increased productivity,
especially in utility or professional applications.
4. Reduced Learning Curve and Support Costs: An intuitive UI requires less learning and
training. Users can quickly understand how to use the application, reducing the need for
extensive documentation and customer support, thus lowering support costs.
In essence, good UI design is not just about aesthetics; it's about creating a seamless and
effective interaction between the user and the technology, ultimately contributing to the
success and usability of the mobile application.
(a) Using a well-illustrated diagram, Explain in detail the Architecture of Android operating
system.
Unfortunately, I can't directly draw and include a diagram here. However, I can describe the
Android architecture in detail, and you can easily find numerous well-illustrated diagrams online
by searching for "Android Architecture Diagram."
The Android architecture is a layered system comprising several components that work together
to power the device. From bottom to top, these layers are:
1. Linux Kernel:
o Key Functions:
o Description: The HAL acts as a standard interface for the Android framework to
interact with the specific hardware components of a device. It abstracts the
hardware implementation details from the upper layers.
o Key Functions: Each hardware component (like the camera, sensors, etc.) has a
corresponding HAL implementation. These HAL modules are typically
implemented as shared libraries (.so files) and are loaded by the Android system
when needed. The framework communicates with these modules through
standardized interfaces. This allows Android to be adapted to various hardware
configurations without requiring significant changes to the upper layers.
3. Native Libraries:
o Examples:
o Key Features:
5. Application Framework:
6. Applications:
o Description: This is the top layer and includes all the applications installed on the
device. These can be pre-installed system apps (like the Phone, Contacts,
Settings, Browser) or third-party apps downloaded and installed by the user.
User-centered design (UCD) is an iterative design process in which the needs, wants, and
limitations of end-users are given extensive attention at each stage of the design process. It's a
philosophy that prioritizes the user as the primary driver of design and development decisions.
Instead of focusing solely on technical feasibility or business goals, UCD aims to create products
and services that are useful, usable, and desirable for the intended users.
Understanding the User Context: This involves researching and analyzing the target
users, their tasks, their environment, and their goals. Techniques like user interviews,
surveys, and contextual inquiry are used to gain insights.
Focusing on User Needs and Requirements: Design decisions are driven by the
identified user needs and requirements. Features and functionalities are developed
based on what users need to accomplish and how they would naturally interact with the
system.
User Involvement Throughout the Process: Users are actively involved in the design
process through feedback sessions, usability testing, and co-creation activities. This
ensures that the design aligns with their expectations and preferences.
Iterative Design: UCD is an iterative process. Designs are created, tested with users, and
then refined based on the feedback. This cycle of design, testing, and iteration continues
until the product meets the user needs effectively.
Usability Evaluation: Throughout the design process, usability testing is conducted to
evaluate how easily and effectively users can interact with the interface. This helps
identify usability issues and areas for improvement.
The ultimate goal of UCD is to create products and services that are intuitive, efficient, and
satisfying to use, leading to increased user adoption and satisfaction.
(i) Emulator:
An emulator is a software program that mimics the hardware and software of another system.
In Android development, the emulator simulates an actual Android device on your computer. It
provides a virtual environment where you can run and test your Android applications without
needing a physical device. Emulators allow you to test your app on various Android versions,
screen sizes, and hardware configurations. They often offer features like debugging tools, screen
capture, and the ability to simulate different network conditions and device sensors.
The SDK Manager is a tool provided with the Android Software Development Kit (SDK) that
allows you to download, install, and manage the various components of the Android SDK. These
components include different versions of the Android platform (e.g., Android 14, Android 13),
build tools, emulator images (system images for different Android versions and device types),
and other necessary libraries and tools. The SDK Manager ensures that you have the correct
SDK components required for developing and testing your Android applications.
(iii) IDE:
IDE stands for Integrated Development Environment. It is a software application that provides
comprehensive facilities to computer programmers for software development. For Android
development, the primary IDE is Android Studio. An IDE typically includes a source code editor
with features like syntax highlighting and code completion, a compiler or interpreter, build
automation tools, and a debugger. Android Studio also offers Android-specific tools like a visual
layout editor, performance profiler, and integration with the Android SDK and emulator. An IDE
streamlines the development process by providing all the necessary tools in one unified
environment.
The Notification Manager is a system service in Android that manages the display of
notifications to the user. It allows applications to send alerts and information to the user outside
of the app's main UI. Developers use the NotificationManager class to build and send
notifications, specifying their content (title, text, icons), appearance, sound, vibration, and
actions (e.g., opening an activity when tapped). The Notification Manager is responsible for
displaying these notifications in the system's notification shade and handling user interactions
with them.
(c) Explain the layouts that can be used to display widgets on a mobile screen.
Android provides various layout managers that define how the child View objects (widgets) are
arranged on the screen. Here are some key layouts used to display widgets:
RelativeLayout: Arranges child views relative to each other or relative to the parent
layout. You can position views based on the edges of the parent, or based on the
position of other views. This provides more flexibility in positioning but can become
complex for large layouts.
ConstraintLayout: A flexible and powerful layout that allows you to position and size
widgets using constraints relative to other widgets and the parent layout. It's designed
to handle complex layouts efficiently and is the recommended layout for most modern
Android UI development as it minimizes nested views.
FrameLayout: A simple layout that displays child views stacked on top of each other. The
last view added is displayed on top. It's often used as a container for a single complex
view or when you want to overlay elements.
ScrollView: Allows the user to scroll through content that extends beyond the visible
screen area. It can contain only one direct child, which is usually a layout like
LinearLayout or ConstraintLayout containing the scrollable content. There are
HorizontalScrollView and ScrollView for vertical scrolling.
RecyclerView: An advanced and efficient layout for displaying dynamic and potentially
large sets of data. It recycles and reuses view holders as the user scrolls, improving
performance compared to ListView. It requires a LayoutManager (like
LinearLayoutManager, GridLayoutManager, or StaggeredGridLayoutManager) to define
the arrangement of items.
GridLayout: Arranges child views in a grid of rows and columns. You can specify how
many rows and columns the grid should have and how each child should span across
them.
The choice of layout depends on the complexity of the UI, the relationships between the
widgets, and the need for responsiveness across different screen sizes.
(d) Explain the following security threats in reference to mobile environments and suggest
their counter measures.
Here are explanations of the listed security threats in mobile environments and potential
countermeasures:
(i) Eavesdropping:
Counter Measures:
o Use HTTPS: Ensure all communication between the mobile app and the server is
encrypted using HTTPS.
o Avoid Public Wi-Fi for Sensitive Transactions: Advise users to avoid conducting
sensitive activities (like banking or logging into important accounts) on unsecured
public Wi-Fi networks.
o Use VPNs: Virtual Private Networks (VPNs) can encrypt all network traffic from
the device, providing a secure tunnel even on public networks.
(ii) Tampering:
Counter Measures:
o Code Obfuscation: Make the app's code harder to reverse engineer and modify.
o Integrity Checks: Implement mechanisms to verify the integrity of the app's code
and data, both locally and upon receiving data from the server.
o Secure Local Storage: Encrypt sensitive data stored locally to prevent
unauthorized modification.
o Server-Side Validation: Always validate data received from the mobile app on the
server-side to prevent manipulation of data before it's processed.
o Code Signing: Digitally sign your app to ensure its authenticity and integrity.
(iii) Spoofing:
Counter Measures:
o Certificate Pinning (for server spoofing): As mentioned earlier, this helps prevent
the app from communicating with a fake server.
(iv) Impersonation:
Counter Measures:
o Secure Credential Storage: Never store passwords in plain text. Use strong
hashing algorithms with salt.
Name Two advantages and Two disadvantages of native app development and Hybrid app
development.
Advantages:
1. Optimal Performance and User Experience: Native apps are built specifically for a
particular operating system (iOS or Android) using the platform's native programming
languages (Swift/Objective-C for iOS, Kotlin/Java for Android) and SDKs. This allows them
to leverage the device's hardware and software features to their full potential, resulting
in smoother performance, better responsiveness, and a user experience that feels
natural and integrated with the platform.
2. Access to Full Range of Device Features and APIs: Native apps have direct access to all
the features and APIs offered by the underlying operating system and device hardware,
such as the camera, GPS, Bluetooth, sensors, and more. This enables developers to
create rich and feature-complete applications.
Disadvantages:
1. Higher Development Costs and Longer Time: Developing separate native apps for each
platform (iOS and Android) requires different development teams with platform-specific
skills and often involves writing the codebase twice. This leads to higher development
costs and a longer time to market if you want to target both major platforms
simultaneously.
Advantages:
1. Cross-Platform Compatibility and Code Reusability: Hybrid apps are built using web
technologies like HTML, CSS, and JavaScript, often within frameworks like React Native,
Flutter, or Ionic. A significant portion of the codebase can be reused across different
platforms (primarily iOS and Android), reducing development time and costs.
2. Faster Development and Time to Market: With a single codebase for multiple platforms,
the development process can be faster, allowing for a quicker time to market, especially
when targeting both iOS and Android simultaneously.
Disadvantages:
1. Potentially Lower Performance and User Experience: Hybrid apps often rely on a
WebView to render the user interface, which can sometimes lead to lower performance
and a less native-feeling user experience compared to native apps, especially for
graphically intensive applications or complex interactions.
2. Limited Access to Native Features and APIs: While hybrid frameworks provide access to
many native features through plugins, accessing certain platform-specific or advanced
device capabilities might be more complex or require relying on community-developed
plugins that may not always be up-to-date or perform optimally.
(c) As a developer, you must work to make sure that your apps are secure for your users and
protecting user data. Name and explain Four best practices for securing Android applications
and protecting user data.
As an Android developer, ensuring the security of your apps and protecting user data is
paramount. Here are four best practices:
o Why it's important: Protects data in transit, such as login credentials, personal
information, and financial details, from being intercepted and misused.
Certificate pinning helps prevent attackers from using fraudulent certificates to
impersonate your server.
o Explanation: Always validate and sanitize user input on both the client-side
(Android app) and the server-side. This includes checking for data type, format,
length, and preventing injection attacks (like SQL injection or cross-site scripting
if your app interacts with web content). Use parameterized queries or prepared
statements when interacting with databases to prevent SQL injection.
o Why it's important: Prevents malicious users from injecting harmful code or data
into your application, potentially leading to data breaches, unauthorized access,
or application crashes. Server-side validation is crucial as client-side validation
can be bypassed.
o Explanation: Request only the necessary permissions that your app truly needs
to function. Clearly explain to the user why each permission is being requested.
Follow the principle of least privilege. For runtime permissions (dangerous
permissions), request them contextually when the feature requiring the
permission is being used, and handle permission denial gracefully. Be transparent
about how the collected data is used.
o Why it's important: Respects user privacy and reduces the attack surface of your
application. Requesting unnecessary permissions can deter users from installing
your app and can raise security concerns. Handling permission denial gracefully
ensures the app doesn't crash or behave unexpectedly when a permission is not
granted
Android provides several options for storing application data, each suited for different needs:
1. Shared Preferences: A simple key-value storage mechanism for storing small amounts of
primitive data (booleans, integers, floats, strings) and simple data structures. It's useful
for saving user settings, application state, or small configuration details.
2. Internal Storage: A private storage space within the device's file system that is accessible
only by the application that created it. It's suitable for storing application-specific files
that should not be accessible to other apps or the user directly. Data stored here is
deleted when the app is uninstalled.
3. External Storage: This can be either a dedicated external storage (like an SD card) or a
portion of the internal storage that is considered "external" for certain purposes. Files
stored here are generally world-readable and can be modified by the user or other
applications. It's suitable for storing larger files like images, videos, or documents that
the user might want to access or share. However, access to external storage requires
appropriate permissions.
4. SQLite Databases: Android provides built-in support for SQLite, a lightweight and
powerful relational database. This is the preferred option for storing structured data that
requires querying, searching, and complex relationships. You interact with SQLite
databases in Android using the android.database.sqlite package.
5. Network Storage: Applications can store and retrieve data from remote servers using
network requests (e.g., using HTTP). This is essential for data that needs to be shared
across multiple devices or users, or for large datasets that cannot be stored locally.
(b) Discuss the various factors that influence the choice of mobile app data storage method.
Several factors influence the choice of data storage method in a mobile app:
Type and Structure of Data: Simple key-value pairs are well-suited for Shared
Preferences. Structured data requiring relationships and querying benefits from SQLite.
Large, unstructured files are best stored in the file system or on a network.
Size of Data: Small amounts of data can be efficiently stored in Shared Preferences or
SQLite. Larger files are better handled by the file system or cloud storage.
Privacy and Security Requirements: Private app data should be stored in internal
storage or a secure local database. Sensitive data often requires encryption and secure
server-side storage.
Offline Access Requirements: If the app needs to function offline, data must be stored
locally using Shared Preferences, SQLite, or the file system. Synchronization mechanisms
will be needed when the device comes back online.
Development Complexity and Effort: Using Shared Preferences is the simplest. Setting
up and managing an SQLite database or network storage requires more development
effort.
Cost: Cloud-based storage solutions often have associated costs depending on usage and
storage volume.
Efficient: Users can accomplish their tasks quickly and with minimal effort.
Learnable: New users can easily understand how to use the app's features.
Accessible: The app is usable by individuals with a wide range of abilities and disabilities.
Poor mobile HCI can lead to user frustration, abandonment of the app, and negative reviews.
Conversely, a well-designed user interface (UI) and user experience (UX) based on sound HCI
principles can result in:
Increased User Adoption and Retention: A positive experience encourages users to keep
using the app.
Improved User Satisfaction: Users are more likely to be happy with an app that is easy
and enjoyable to use.
Stronger Brand Loyalty: A well-designed app can contribute to a positive brand image.
Reduced Support Costs: Intuitive interfaces minimize the need for user support.
Android provides specific UI guidelines (Material Design) that are rooted in HCI principles.
Following these guidelines helps developers create consistent, familiar, and user-friendly
interfaces. Considering factors like touch targets, navigation patterns, information hierarchy,
feedback mechanisms, and responsiveness across different screen sizes are all crucial aspects of
mobile HCI in Android development.
(d) When designing mobile applications describe the principles that developers should follow
to design effective user interfaces.
Developers should follow several key principles to design effective user interfaces for mobile
applications:
2. Clarity: Ensure that information is presented clearly and unambiguously. Use concise
language, appropriate typography, and visual cues to guide users. Avoid jargon and
provide clear feedback on user actions.
3. Simplicity: Keep the interface clean and uncluttered. Focus on essential features and
avoid overwhelming users with too much information or too many options at once.
Prioritize content and functionality.
4. Feedback: Provide timely and informative feedback to users for their actions. This can
include visual cues (e.g., button presses, progress indicators), auditory feedback, or
haptic feedback. Feedback helps users understand the system's status and whether their
actions were successful.
5. Hierarchy: Establish a clear visual hierarchy to guide the user's attention to the most
important information and actions. Use size, color, contrast, and spacing to indicate the
relative importance of elements.
6. Learnability: Design the interface so that new users can easily understand how to use it.
Use intuitive navigation, clear labeling, and provide helpful onboarding or tutorials when
necessary.
7. Efficiency: Enable users to accomplish their tasks with minimal effort. Use shortcuts,
intelligent defaults, and efficient workflows. Consider common user tasks and optimize
the interface for them.
8. Accessibility: Design the app to be usable by people with disabilities. This includes
providing alternative text for images, ensuring sufficient color contrast, supporting
keyboard navigation, and adhering to accessibility guidelines.
9. Responsiveness: Ensure that the app's layout and functionality adapt gracefully to
different screen sizes, orientations, and resolutions of Android devices. Use flexible
layouts and appropriate UI components.
10. User Control and Freedom: Allow users to easily undo actions, navigate back, and
control their experience. Provide clear exit points and avoid forcing users into unwanted
states.
(e) Using some code examples explain how you can open a specific activity within an Android
application using an intent.
In Android, an Intent is a messaging object you can use to request an action from another app
component. One of the most common uses of intents is to start an Activity. Here's how you can
open a specific activity using an explicit intent with code examples in Kotlin:
Scenario: You have two Activities in your Android app: MainActivity and SecondActivity. You
want to open SecondActivity from MainActivity when a button is clicked.
Kotlin
import android.content.Intent
import android.os.Bundle
import android.widget.Button
import androidx.appcompat.app.AppCompatActivity
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
val openSecondActivityButton: Button = findViewById(R.id.openSecondActivityButton)
openSecondActivityButton.setOnClickListener {
startActivity(intent)
Explanation:
Inside the OnClickListener for the button, we create a new Intent object.
Kotlin
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_second)
Explanation:
This is a simple Activity class. The onCreate() method is where you would typically inflate
the layout and perform initial setup.
activity_main.xml (Example):
XML
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<Button
android:id="@+id/openSecondActivityButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
activity_second.xml (Example):
XML
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".SecondActivity">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Step 4: Register the Activities in AndroidManifest.xml
Ensure that both MainActivity and SecondActivity are declared within the <application> tag in
your AndroidManifest.xml file:
XML
<application
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MyApp">
<activity android:name=".MainActivity"
android:exported="true">
<intent-filter>
</intent-filter>
</activity>
<activity android:name=".SecondActivity"
android:exported="false"/>
</application>
When you run the app and click the "Open Second Activity" button in MainActivity, a new
instance of SecondActivity will be created and displayed.
(f) Explain the steps involved in implementing HTTP requests to retrieve data from a remote
server in an Android app and discuss the advantages and disadvantages of using third-party
libraries.
Implementing HTTP requests in an Android app to retrieve data from a remote server typically
involves these steps:
1. Add Network Permissions: Your app needs permission to access the internet. Add the
<uses-permission android:name="android.permission.INTERNET" /> tag to your
AndroidManifest.xml file.
2. Create a Network Request: Construct the URL of the API endpoint you want to access.
Determine the HTTP method (GET for retrieving data is common).
4. Send the Request: Send the HTTP request to the server. For a GET request, this usually
involves opening the connection and reading the response. For other methods (POST,
PUT, DELETE), you might need to send data in the request body.
5. Receive the Response: Read the response from the server. This typically includes a
status code (indicating success or failure) and the data (often in JSON or XML format).
6. Parse the Response Data: Process the received data into a usable format within your
Android app. For JSON, you might use libraries like org.json (built-in) or Gson. For XML,
you might use org.xml.parsers.SAXParser or other XML parsing libraries.
7. Handle Errors: Implement error handling to gracefully manage network issues, server
errors, or data parsing exceptions.
Simplified API: These libraries provide a higher-level, more convenient API for making
HTTP requests, reducing boilerplate code.
Efficient Connection Management: They often handle connection pooling and other
optimizations for better performance.
Built-in Data Parsing: Some libraries offer built-in support for parsing JSON or XML
responses directly into Java/Kotlin objects.
Error Handling: They often provide mechanisms for easier error handling and retries.
Interceptors and Customization: Libraries like OkHttp allow you to add interceptors to
modify requests and responses, and offer extensive customization options.
Large Community and Support: Popular libraries have large communities, making it
easier to find documentation and get help.
Increased App Size: Adding a library increases the size of your application.
Learning Curve: Developers need to learn the specific API and features of the chosen
library.
Dependency Management: You need to manage the library dependency using Gradle or
Maven.
Define the following terms and explain their significance in Mobile App development:
(i) Cryptography:
Significance in Mobile App Development: While newer data formats like JSON are
increasingly popular, XML still plays a role in mobile app development. It's often used
for:
o Data transfer: Exchanging structured data between the client (mobile app) and
the server, although JSON is more common for this now due to its lighter weight
and easier parsing in JavaScript.
o UI design (in some older Android layouts): Defining the structure and
appearance of user interfaces, although newer approaches like Jetpack Compose
are gaining traction.
(b) State two approaches that Android apps use to send notifications to a user.
2. Using their own custom server implementation: Developers can build their own server
infrastructure to manage and send notifications. This involves the mobile app registering
its device token with the custom server, and the server then uses platform-specific APIs
(like FCM for Android or APNs for iOS) to deliver the notifications. This approach offers
more control but requires significant development and maintenance effort.
(c) State FIVE data storage options available to mobile app developers.
3. Internal/External Storage (File System): Apps can directly read and write files to the
device's internal or external storage. This is suitable for storing larger unstructured data
like images, videos, or documents.
5. Key-Value Stores (e.g., Realm): These databases store data as key-value pairs and often
offer better performance and ease of use compared to traditional relational databases
for certain types of data.
Mobile authentication is the process of verifying the identity of a user trying to access a mobile
application. Robust authentication is crucial for security and protecting user data. Common
methods include:
Token-based Authentication (e.g., JWT): After successful login, the server issues a
temporary token (like a JSON Web Token) to the client. The client then includes this
token in subsequent requests to authenticate the user without needing to re-enter
credentials for every request.
Social Login: Allowing users to authenticate using their existing accounts on platforms
like Google, Facebook, or Apple. This simplifies the registration process for users.
Certificate Pinning: Enhancing the security of HTTPS connections by associating the app
with specific expected certificates, preventing man-in-the-middle attacks.
The choice of authentication method depends on the sensitivity of the data being accessed and
the desired level of security and user experience.
Mobile access control focuses on managing and restricting access to resources and
functionalities within a mobile application based on the authenticated user's identity and their
assigned roles or permissions. It ensures that users can only perform actions and access data
they are authorized to. Key aspects include:
Role-Based Access Control (RBAC): Assigning permissions to roles and then assigning
users to those roles. This simplifies the management of access rights for a large number
of users.
Secure Data Access: Ensuring that even if a user is authenticated, they can only access
the data they are authorized to view or modify. This often involves server-side checks
and data filtering.
API Security: Protecting the backend APIs that the mobile app communicates with,
ensuring that only authorized clients (the mobile app) and authenticated users can
access them. This involves techniques like API keys, token-based authentication, and rate
limiting.
Effective access control is vital for preventing unauthorized data access, maintaining data
integrity, and ensuring the security of the mobile application.
(e) Discuss any three preliminary considerations one considers before starting to develop for
mobile phones.
Before embarking on mobile app development, several preliminary considerations are crucial:
1. Target Audience and Platform:
o What problem does the app solve or what need does it fulfill? Clearly defining
the core functionality and key features of the app is paramount.
o What is the minimum viable product (MVP)? Identifying the essential features
needed for the initial launch helps focus development efforts and get the app to
users quickly for feedback.
o Scalability and future enhancements: While starting with core features, it's
important to consider the potential for future growth and how the app's
architecture can accommodate new features and increased user load.
o What are the technical requirements and limitations? This includes considering
device capabilities (e.g., sensors, processing power, storage), network
connectivity, and platform-specific features.
o What are the available resources (budget, team expertise, time)? These factors
will significantly influence the choice of development approach (native vs. cross-
platform), the complexity of features, and the overall timeline.
o Security and privacy considerations: Planning for data security, user privacy, and
compliance with relevant regulations (e.g., GDPR, CCPA) is crucial from the
outset.
Reduced Development Time: They provide reusable code and components, saving
developers from writing everything from scratch.
Increased Efficiency: Frameworks often offer higher-level abstractions and tools that
streamline development workflows.
Cross-Platform Development (in some cases): Frameworks like React Native and Flutter
enable developers to write code once and deploy it on both iOS and Android.
React Native: A JavaScript framework for building native mobile apps for iOS and
Android.
Flutter: A UI toolkit by Google for building natively compiled applications for mobile,
web, and desktop from a single codebase.
Ionic: An open-source framework for building hybrid mobile apps using web
technologies like HTML, CSS, and JavaScript.
Analytics SDKs (e.g., Google Analytics for Firebase, Mixpanel): Provide tools for tracking
user behavior and app performance.
1. Android: Developed by Google, it's the most widely used mobile OS globally, known for
its open-source nature and customization options.
2. iOS: Developed by Apple, it powers iPhones and iPads, praised for its user-friendliness,
security, and tight integration with Apple's hardware.
4. KaiOS: A lightweight operating system based on Linux, primarily designed for feature
phones with internet access and some smartphone-like functionalities.
(c) Discuss popular server-side scripting languages in and explain why and when do we need
server-side development in Mobile Apps.
Python: Known for its readability, extensive libraries, and frameworks like Django and
Flask, making it versatile for building APIs and backend logic.
Ruby: Known for its elegant syntax and the Ruby on Rails framework, which facilitates
rapid development of web applications and APIs.
Data Persistence and Storage: When an app needs to store data that outlives the
current session or needs to be accessed across multiple devices or users, a server-side
database is essential.
User Authentication and Authorization: Managing user accounts, logins, and ensuring
secure access to data and features requires server-side logic.
Business Logic and Processing: Complex calculations, data manipulation, and business
rules are typically handled on the server to ensure consistency and security.
Integration with Third-Party Services: Connecting to external APIs for services like
payment gateways, social media logins, or mapping often requires server-side
integration.
Scalability and Performance: Offloading heavy processing and data management to the
server can improve the performance and scalability of the mobile app.
Security: Sensitive data and critical business logic should be kept on the server to
prevent unauthorized access or manipulation on the client-side.
Real-time Functionality: Features like chat applications, live updates, and collaborative
tools often rely on server-side technologies to manage real-time communication.