MOB2 Ass.1 Onboarding Screens
MOB2 Ass.1 Onboarding Screens
Assignment Goal
This assignment will challenge you to build a multi-step user onboarding experience using
Android Fragments. You'll focus on passing data between Fragments through a central Host
Activity and implementing dynamic UI changes based on user interaction.
You'll start with a provided project and add new features to Fragment2 and create Fragment3.
Tasks to Complete
Continue building on the provided starter project:
1. Enhance Fragment2
● Collect More Info: In Fragment2, add UI elements to collect more user details besides their
name. Examples include email, gender, and optionally age or university.
● Send Data to Host: When the 'Continue' button in Fragment2 is tapped, you must send the
user's name (which should be available in Fragment2 from a previous step, or directly from
the Host Activity) to the Host Activity. Use an interface for this communication to ensure
proper app architecture.
● The Host Activity should then switch to Fragment3.
2. Implement Fragment3
● Create Fragment3: Build a new Android Fragment called Fragment3.
● Display Name: In Fragment3, display the user's name that you received from the Host
Activity (which got it from Fragment2).
● Add Confirmation Checkbox: Include a CheckBox on Fragment3's layout. A good label
would be "I confirm I have read and agree to use the app."
● Dynamic Button Behavior:
○ Add a Button (e.g., with text 'Continue') to Fragment3.
○ Initially, this button must be disabled.
○ When the checkbox is checked, the button should immediately enable.
○ When the checkbox is unchecked, the button should immediately disable again.
1
○ You must use an interface to manage this checkbox's state change and its effect on
the button.
○ Button Text Change: When the checkbox is checked, the button's text must also
change from 'Continue' to 'Finish'. No further action is required when the text
changes.
Important Tips & Best Practices
● Fragment-to-Activity Communication: Define an interface inside your Fragments and have
your Host Activity implement it. This is crucial for sending data or events from a Fragment
back to its parent Activity.
● Passing Data to Fragments: Use Bundle and Fragment.setArguments() when creating new
Fragment instances to pass initial data.
● UI Listeners: Use setOnCheckedChangeListener for your CheckBox to detect when its state
changes.
● Fragment Management: Your Host Activity will use FragmentManager and
FragmentTransaction to swap between Fragment2 and Fragment3.
Submission Requirements
You need to submit two links:
1. Short Video (Google Drive):
○ Record a 3-5 minute video explaining your work.
○ Clearly demonstrate the running app, showing all the features: filling out Fragment2,
the name appearing in Fragment3, and the checkbox/button interaction in Fragment3.
○ Upload the video to Google Drive and ensure it's shared so anyone with the link can
view.
2. Source Code (GitHub Repository):
○ In Android Studio, go to File > Export > Export to Zip File....
○ Unzip this file.
○ Create a new, public GitHub repository.
○ Upload all the extracted project files to your GitHub repository. Make sure your
repository is clean and doesn't contain unnecessary build files.
Good luck with Assignment 1!