Unit - Ii
Unit - Ii
1. User-Centered Design
• Understand the User: Research your target audience to understand their needs,
preferences, and behaviors.
• Personas & Scenarios: Develop personas and scenarios to guide design decisions,
ensuring the app meets the needs of its users.
• User Flow: Map out the user journey to ensure smooth navigation and interaction within
the app.
3. Responsive Design
• Screen Sizes: Design for various screen sizes and orientations, ensuring the app is usable
on both phones and tablets.
• Density Independence: Use density-independent pixels (dp) and scalable assets to
accommodate different screen densities.
4. Navigation Patterns
5. Accessibility
• Color Contrast: Ensure sufficient contrast between text and background for readability.
• Voice Control & Screen Readers: Support voice control and screen readers by using
semantic elements and providing alternative text for images.
• Touch Targets: Ensure touch targets are large enough and spaced appropriately for easy
interaction.
6. Performance Optimization
• Efficient Layouts: Use efficient layouts to reduce the complexity of the view hierarchy.
• Asset Management: Optimize images, fonts, and other resources to reduce load times.
• Battery and Data Usage: Design with battery life and data usage in mind, optimizing
background processes and network requests.
7. Interaction Design
• Gestures: Incorporate intuitive gestures like swipe, drag, and pinch, where appropriate.
• Animations: Use subtle animations to enhance user experience without overwhelming
the user.
• Feedback: Provide feedback for user actions, such as button presses or form
submissions, to enhance interactivity.
8. Typography
• Readability: Choose fonts that are easy to read, with appropriate size, line spacing, and
contrast.
• Hierarchy: Establish a clear typographic hierarchy to guide users through the content.
• Consistent Styles: Maintain consistency in font styles across the app to reinforce brand
identity.
9. Color Scheme
• Brand Colors: Use colors that align with your brand identity while ensuring they’re
functional within the app’s context.
• Accent Colors: Apply accent colors sparingly to highlight important elements without
overwhelming the user.
• Theming: Implement light and dark themes to cater to user preferences and improve
usability in different lighting conditions.
• Wireframing: Start with wireframes to plan the layout and functionality of each screen.
• Interactive Prototypes: Create interactive prototypes to test the app’s flow and
functionality before development.
• User Testing: Conduct user testing to gather feedback and iterate on the design based on
real user interactions.
• User Feedback: Continuously gather user feedback post-launch to identify areas for
improvement.
• Analytics: Use analytics to monitor app usage, identify pain points, and make data-
driven design decisions.
• Updates: Regularly update the app with new features, improvements, and bug fixes to
maintain user engagement.
An Android application is composed of various components and resources that work together to
provide the user with a seamless experience. Here’s an overview of the anatomy of an Android
application:
• Application Metadata: This file provides essential information about the application,
including the app’s package name, version, permissions, and the components (activities,
services, receivers) that are part of the app.
• App Components Registration: Activities, services, broadcast receivers, and content
providers are declared in the manifest.
• Permissions: Specifies permissions required by the app, such as access to the internet,
camera, or storage.
• Intent Filters: Defines how the app interacts with other apps and system components by
declaring intent filters.
2. App Components
• Activities:
o Represents a single screen with a user interface.
o Manages the UI and user interactions on that screen.
o Activities are defined in Java/Kotlin and their layouts in XML.
• Services:
o Handles background processing tasks without a user interface.
o Examples include playing music, fetching data from the internet, or handling
network operations.
• Broadcast Receivers:
o Responds to broadcast messages from other applications or the system.
o Used to handle events such as system boot, battery low, or incoming SMS.
• Content Providers:
o Manages access to a structured set of data, allowing data sharing between
applications.
o Often used to access data stored in SQLite databases or from external sources like
contacts or media files.
Android terminologies:
Android development comes with its own set of terminologies that are essential to understand.
Here’s a glossary of common Android terms:
1. Activity
• A single screen with a user interface in an Android app. Each activity is an entry point for
interacting with the user.
2. Service
3. Broadcast Receiver
4. Content Provider
• A component that manages shared application data. Content providers allow apps to
share data with other apps securely, often used with databases like SQLite.
5. Intent
• A messaging object used to request actions from other app components, such as starting
an activity, service, or delivering a broadcast.
6. Fragment
• A reusable portion of the user interface that can be embedded within activities. Fragments
help in creating multi-pane UIs.
7. View
• The basic building block for user interface components. Views represent UI elements like
buttons, text fields, images, etc.
8. ViewGroup
• A container that holds other views (child views) and defines their layout properties.
Examples include LinearLayout, RelativeLayout, and ConstraintLayout.
9. Layout
• Defines the structure of the user interface in an activity or fragment. Layouts are typically
defined in XML files.
10. RecyclerView
• A flexible and efficient UI component for displaying large datasets as a list or grid. It
recycles views to improve performance and is the successor to ListView.
11. Adapter
• A bridge between a UI component and the data source. Adapters populate UI components
like RecyclerView and ListView with data.
• A configuration file that contains essential information about the app, including the
components, permissions, and app metadata.
13. Gradle
• A build automation tool used to compile, test, and package Android applications. Gradle
scripts manage dependencies and build configurations.
• The file format used to distribute and install Android applications. An APK contains all
of the program's code, resources, assets, certificates, and manifest file.
15. Resource
• Non-code assets used in an application, such as images, strings, layouts, and colors.
Resources are typically stored in the res directory.
16. R.java
• A generated class that holds references to all resources in the project. Every resource in
the res folder gets an ID in R.java which can be accessed programmatically.
• A collection of software tools and libraries that developers use to create Android
applications. The Android SDK includes the required APIs, tools, and documentation.
• An integer value that corresponds to the version of the Android platform. It defines the
set of available APIs and features an application can use.
• The sequence of states an activity goes through from creation to destruction. Key
lifecycle methods include onCreate(), onStart(), onResume(), onPause(), onStop(),
and onDestroy().
20. Context
22. ProGuard
• A tool used to shrink, optimize, and obfuscate the code in an Android application. It helps
to reduce the size of the APK and protect the code from reverse engineering.
24. Emulator
• A virtual device that simulates an Android device on a computer. Emulators are used for
testing and debugging Android applications.
• Different versions of the app built from the same codebase, often used for creating debug
and release versions, or different product flavors.
27. ViewModel
• A component of the Android Architecture Components that stores and manages UI-
related data in a lifecycle-conscious way. It is designed to survive configuration changes
like screen rotations.
28. LiveData
29. Room
• A persistence library that provides an abstraction layer over SQLite, allowing for easier
database management and access.
30. WorkManager
• An API for managing deferrable, guaranteed background work, such as tasks that need to
be executed even if the app exits or the device restarts.
• A library that allows you to bind UI components in your layouts to data sources in your
app using a declarative format rather than programmatically.
32. Jetpack
• A suite of libraries, tools, and architectural guidance to help developers write high-quality
apps more easily. Jetpack components help in managing background tasks, UI navigation,
and lifecycle management.
33. Navigation Component
• A Jetpack library that helps in managing app navigation, ensuring a consistent user
experience and simplifying the handling of fragment transactions and back stack
management.
• A design system created by Google that provides guidelines for visual, motion, and
interaction design. Material Design components ensure consistency and a modern UI
across apps.
35. Broadcast
• A message that an app can send or receive. Broadcasts are often used to communicate
with other apps or with the system about events like battery low or Wi-Fi connection
changes.
36. Snackbar
• A lightweight and temporary message that appears at the bottom of the screen, providing
feedback to the user without interrupting their current activity.
• A dialog that appears when the UI thread of an application has been blocked for too long,
indicating that the app is not responding to user input.
38. RecyclerView.Adapter
• The adapter that binds data to the RecyclerView and is responsible for creating the
ViewHolder, binding data to it, and managing its lifecycle.
• A script that allows you to run a Gradle build without needing to have Gradle installed on
your system. The wrapper ensures that the correct Gradle version is used.
Permissions:
In Android, permissions are a way to control access to sensitive information and system features.
They help protect user privacy and device security by restricting what an app can do and what
data it can access. Here’s an overview of Android permissions:
1. Types of Permissions
• Definition: Permissions that grant access to data and resources outside the app’s sandbox
but pose minimal risk to the user’s privacy or the operation of other apps.
• Examples:
o Accessing the internet (INTERNET)
o Setting an alarm (SET_ALARM)
o Accessing Wi-Fi state (ACCESS_WIFI_STATE)
• User Interaction: Automatically granted by the system at install time, without prompting
the user.
• Definition: Permissions that provide access to sensitive user data or control over the
device’s operations that could impact the user or other apps.
• Examples:
o Accessing contacts (READ_CONTACTS)
o Accessing the device’s location (ACCESS_FINE_LOCATION,
ACCESS_COARSE_LOCATION)
o Reading external storage (READ_EXTERNAL_STORAGE)
o Accessing the camera (CAMERA)
• User Interaction: The user is prompted to grant or deny these permissions at runtime.
• Definition: Permissions that are only granted to apps signed with the same certificate as
the app that defines the permission. These are often used for communication between
apps from the same developer.
• Example: An app that wants to access the internals of another app from the same
developer.
• Definition: Permissions that provide access to critical system-level features and require
explicit user consent through system settings.
• Examples:
o Draw over other apps (SYSTEM_ALERT_WINDOW)
o Access usage data (PACKAGE_USAGE_STATS)
o Modify system settings (WRITE_SETTINGS)
• User Interaction: The user must explicitly enable these permissions in the device’s
settings.
2. Permission Groups
• Definition: Permissions are categorized into groups, and if a user grants a permission
within a group, all other permissions in that group are automatically granted.
• Examples:
o Contacts Group: Includes READ_CONTACTS, WRITE_CONTACTS,
GET_ACCOUNTS.
o Location Group: Includes ACCESS_FINE_LOCATION,
ACCESS_COARSE_LOCATION.
o Storage Group: Includes READ_EXTERNAL_STORAGE,
WRITE_EXTERNAL_STORAGE.
3. Requesting Permissions
xml
Copy code
<uses-permission android:name="android.permission.CAMERA" />