Android Exam Prep: Key Design Principles
Android Exam Prep: Key Design Principles
Absolutely! I'd love to help you ace your Android Programming exam. Just share the list of
topics you want to cover, and I’ll explain each one in detail with examples, diagrams (if
needed), and exam-focused tips.
Great! Let's dive deep into Mobile Software Engineering – Design Principles, which is a
foundational topic for Android development and often appears in exams. Here's a detailed
breakdown:
Key Points:
Focus on simplicity and clarity.
1/35
Example:
An app with buttons too small to tap on a phone screen fails UCD. Buttons must be finger-
friendly (minimum 48dp in Android).
✅ 2. Responsive Design
The UI must adapt to different screen sizes and orientations.
Key Concepts:
Use ConstraintLayout or Responsive UI patterns.
Use [Link] for different screen densities ( hdpi , xhdpi , xxhdpi , etc.).
Example:
Create different layouts:
plaintext
res/layout/main_activity.xml
res/layout-land/main_activity.xml
res/layout-sw600dp/main_activity.xml (for tablets)
✅ 3. Performance Efficiency
Mobile devices have limited resources — optimize memory, CPU, and battery usage.
Practices:
Avoid memory leaks (use WeakReference, avoid static references to Context ).
2/35
✅ 4. Battery Optimization
A power-hungry app will get uninstalled fast.
Tips:
Use JobScheduler, WorkManager for background tasks.
Best Practices:
Store data securely (SharedPreferences with encryption or
EncryptedSharedPreferences ).
Example:
Follow MVVM architecture.
3/35
✅ 7. Consistency and Feedback
Keep the UI predictable and provide user feedback.
Tips:
Use Material Design components for consistency.
✅ 8. Offline Functionality
Users may lose connectivity — apps should still work.
Ideas:
Use Room database for local storage.
✅ 9. Scalability
Design your app to grow — more users, features, or data.
Strategies:
Use modular code structure.
4/35
✅ 10. Internationalization and Localization
Support multiple languages and regions.
Example:
Use [Link] :
xml
<string name="welcome">Welcome</string>
Create versions:
values-fr/[Link] (French)
values-hi/[Link] (Hindi)
Performance Efficiency Optimize memory and CPU Use RecyclerView, background threads
5/35
📘 Exam Tips:
Define each principle clearly.
For long answers, group related principles (like performance + battery + offline).
Use keywords like "Material Design," "ViewModel," "ConstraintLayout" for bonus points.
Would you like flashcards or a quiz based on this topic for revision? Or should we move on to
the next topic?
Perfect! Let’s now cover Mobile Software Engineering – Development in detail, tailored for
your Android Programming exam. This topic focuses on the phases, tools, and practices
involved in building mobile applications.
For your exam, we will focus on Android development, covering phases from idea to
deployment.
6/35
Phases:
Phase Description
📘 Requirement Analysis Gather client/user requirements. E.g., "A note-taking app with cloud sync."
Android Studio Official IDE for Android. Offers emulator, layout editor, logcat, profiler.
ADB (Android Debug Bridge) Command-line tool to interact with devices (install APKs, access logs).
pgsql
MyApp/
├── manifests/ -> [Link]
├── java/ -> Source code (Activities, Fragments, ViewModels)
├── res/
7/35
│ ├── layout/ -> XML UI layouts
│ ├── values/ -> [Link], [Link], [Link]
│ └── drawable/ -> Images, icons
├── [Link] -> Module-level Gradle build file
🧱 4. App Components
Android apps are built using four major components:
🏗 5. Application Architecture
A well-designed architecture improves scalability, testability, and readability.
Popular Patterns:
MVVM (Model–View–ViewModel): Recommended for modern Android.
MVP (Model–View–Presenter)
MVVM Structure:
Layer Purpose Example
8/35
📡 6. APIs and Backend Communication
Most mobile apps need to communicate with servers:
Common APIs:
REST APIs: Use Retrofit, Volley, or OkHttp to fetch/send data.
@GET("users")
fun getUsers(): Call<List<User>>
🧪 8. Testing in Android
Type Tool Purpose
9/35
Type Tool Purpose
📤 9. App Deployment
Steps:
1. Generate Signed APK/AAB using Android Studio.
10/35
Area Key Details
📌 Exam Tips
Write step-by-step lifecycle in 6 points.
Would you like diagrams or sample code files for any part? Or shall we move to the next
topic?
Great! Let's now dive into the “Mobile Software Engineering – Testing Methodologies for
Mobile Applications” in detail. This topic is frequently asked in Android exams and is vital
for ensuring mobile apps are stable, reliable, and user-friendly across devices and OS
versions.
11/35
📱 Mobile Software Testing Methodologies
🔍 What Is Mobile Application Testing?
It is the process of testing mobile apps for functionality, usability, performance, security,
and consistency across different devices, screen sizes, and OS versions (Android/iOS).
2 UI/UX Testing Tests user interface and user experience. Robolectric, Espresso
4 Performance Tests app under load, speed, memory Android Profiler, JMeter
Testing usage.
5 Security Testing Identifies vulnerabilities, data leaks, etc. MobSF, OWASP Mobile
Top 10
6 Usability Testing Tests ease of use, navigation, user Manual testing, feedback
satisfaction. tools
9 Localization Verifies support for different languages and Manual testing with
Testing regions. locale changes
12/35
# Methodology Description Tools Used
13/35
Criteria Manual Testing Automated Testing
Firebase Test Lab Cloud Runs tests on real devices in the cloud
onView(withId([Link].login_button))
.perform(click())
.check(matches(isDisplayed()));
This test checks if the login button works and the next screen appears.
14/35
2. Integration Tests – Check interactions between components.
📚 Summary Table
Topic Summary
15/35
💡 Exam Writing Tips
Start with a definition of mobile app testing.
Add real-world example like “login button not working across Android 8–12 →
Compatibility bug.”
Would you like diagrams, a flowchart, or help with sample test cases too? Or shall we move
to the next topic?
Let’s break it down clearly, deeply, and visually so you can easily recall it in your exam.
bash
MyApplication/
├── app/
│ ├── manifests/
│ ├── java/
│ └── res/
├── build/
├── gradle/
├── .gradle/
├── [Link] (Project)
16/35
├── [Link]
└── [Link]
a. manifests/
Contains [Link]
Declares:
b. java/
c. res/ (Resources)
Folder Description
17/35
Folder Description
✅ 2. build/
✅ 3. .gradle/
✅ 4. gradle/
✅ 5. [Link] (Project-level)
Contains:
18/35
✅ 6. [Link] (App-level)
Located in app/[Link] :
Includes:
compileSdkVersion
minSdkVersion
dependencies { ... }
plugins { id '[Link]' }
✅ 7. [Link]
✅ 8. [Link]
19/35
📊 Visual Summary (Tabular)
Section Path Purpose
Would you like a diagram (tree structure or visual map)? Or shall we move to the next topic?
20/35
Each folder serves a specific purpose and automatically maps to code via generated [Link]
references like [Link] , [Link].activity_main .
🗂️ 1. drawable/
Purpose: Stores bitmap images, vector graphics, and XML drawable files.
Example: [Link]
🗂️ 2. layout/
Purpose: Holds UI layout XML files for activities, fragments, dialogs, etc.
Example: [Link].activity_main
🗂️ 3. values/
Purpose: Contains XML files that define key-value pairs used across the app.
Common Files:
21/35
Example: [Link].app_name , [Link]
🗂️ 4. mipmap/
Example: [Link].ic_launcher
🗂️ 5. menu/
Purpose: Stores XML files that define app menus (action bar, context menus).
Example: [Link].main_menu
🗂️ 6. raw/
Purpose: Holds arbitrary raw files like audio, video, or custom text files.
Example: [Link].intro_music
22/35
🗂️ 7. anim/
Example: [Link].fade_in
🗂️ 8. animator/
Example: [Link]
🗂️ 9. xml/
Used For: Preferences, network policies, file provider, navigation graphs, etc.
Example: [Link]
🗂️ 10. font/
Example: [Link]
23/35
📚 Summary Table
Folder Description Example
Would you like a diagram or flashcards for revision? Or shall we move to the next topic?
Great! Let’s now dive deep into one of the most important resource folders in Android
development: the values/ folder. This topic is very common in Android viva, theory exams,
and practical interviews — so let's make sure you master it!
24/35
📁 values/ Folder in Android
📌 Location:
css
app/src/main/res/values/
The values/ folder stores key-value resource XML files that define elements used across
the app to support:
UI consistency
Internationalization (i18n)
Reusability
These resources are not hardcoded in layouts or code. Instead, they are referenced via R
class like:
java
[Link].app_name
[Link]
[Link].margin_small
1. [Link]
Stores all textual strings used in the app.
25/35
Supports localization by creating different versions like values-hi/[Link] for
Hindi.
🔹 Example:
xml
<resources>
<string name="app_name">MyApp</string>
<string name="welcome_msg">Welcome to MyApp!</string>
</resources>
2. [Link]
Defines color values used for UI elements.
🔹 Example:
xml
<resources>
<color name="primaryColor">#6200EE</color>
<color name="accentColor">#03DAC5</color>
</resources>
3. [Link] (Dimensions)
Stores size values like margins, paddings, font sizes.
🔹 Example:
xml
26/35
<resources>
<dimen name="text_size_large">18sp</dimen>
<dimen name="padding_small">8dp</dimen>
</resources>
4. [Link]
Defines reusable UI themes and styles.
🔹 Example:
xml
<resources>
<style name="AppTheme" parent="[Link]">
<item name="colorPrimary">@color/primaryColor</item>
<item name="colorAccent">@color/accentColor</item>
</style>
</resources>
🔹 Example:
xml
<resources xmlns:tools="[Link]
<style name="[Link]" parent="[Link]">
<item name="colorPrimary">@color/primaryColor</item>
27/35
</style>
</resources>
6. [Link]
Stores integer constants used in the app.
🔹 Example:
xml
<resources>
<integer name="max_items">10</integer>
</resources>
7. [Link]
Stores boolean values (true/false flags).
🔹 Example:
xml
<resources>
<bool name="isTablet">false</bool>
</resources>
8. [Link]
Defines string or integer arrays.
🔹 Example:
xml
28/35
<resources>
<string-array name="planets_array">
<item>Mercury</item>
<item>Venus</item>
<item>Earth</item>
</string-array>
</resources>
9. [Link] (Optional)
Used to define custom attributes for custom views or themes.
📊 Summary Table
File Purpose Example Reference
29/35
✍️ Exam Line to Remember:
“The values/ folder in Android contains XML resource files such as strings, dimensions,
styles, and colors that promote maintainability, localization, and a consistent user
interface design.”
Would you like flashcards or a quiz on this topic? Or shall we continue with the next topic for
your exam?
Let’s break down Leveraging Android XML — a very important Android programming
concept that helps create robust, maintainable, and UI-consistent mobile applications.
UI layouts
Manifest declarations
Leveraging Android XML means making full and efficient use of XML to separate concerns
between UI design and functionality (Java/Kotlin code), ensuring clarity, modularity,
reusability, and maintainability.
30/35
Location: res/layout/
These define how the UI looks – buttons, text fields, images, containers, etc.
🔹 Example:
xml
<LinearLayout xmlns:android="[Link]
android:orientation="vertical"
android:padding="16dp"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:id="@+id/titleText"
android:text="@string/app_name"
android:textSize="24sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
👉 Benefits:
Easy visualization
These include:
[Link] – Text
[Link] – Colors
👉 Benefits:
31/35
Avoid hardcoding
3. [Link]
Defines core app structure and permissions:
Permissions
Intents
App theme
🔹 Example:
xml
<manifest package="[Link]">
<application
android:icon="@mipmap/ic_launcher"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="[Link]"/>
<category android:name="[Link]"/>
</intent-filter>
</activity>
</application>
</manifest>
4. Animation XML
Used in res/anim/ or res/animator/ to create transitions and effects.
🔹 Example: slide_in.xml
xml
32/35
<translate
xmlns:android="[Link]
android:fromXDelta="-100%" android:toXDelta="0%"
android:duration="300"/>
5. Drawable XML
Location: res/drawable/
Used for:
Shapes
Gradients
🔹 Example:
xml
<selector xmlns:android="[Link]
<item android:state_pressed="true" android:drawable="@color/pressedColor"/>
<item android:drawable="@color/defaultColor"/>
</selector>
6. Menu XML
Location: res/menu/
Used to define menu items in the UI.
🔹 Example:
xml
<menu xmlns:android="[Link]
<item android:id="@+id/action_settings"
android:title="Settings"
android:icon="@drawable/ic_settings"
33/35
android:showAsAction="ifRoom"/>
</menu>
34/35
Would you like to revise this with flashcards or jump to the next topic?
35/35