Question: Friendship Objectives: Design Layout Utilize Layout Manager Utilize Intent Pass Data among Activities Handle Rotation Outcome: You are required to design two activities. The first

Friendship
Objectives:
Design Layout
Utilize Layout Manager
Utilize Intent
Pass Data among Activities
Handle Rotation
Outcome:
You are required to design two activities. The first will check the users credentials. If the credentials meet the criteria, show the second activity; otherwise, stay on the first activity with an error message.
Description in Detail:
Step 1: Design a Login Page Using ConstraintLayout
Details:
Define two TextViews (one with "User Name" and the other with "Password").
Create two corresponding EditTexts (for User Name and Password).
Add one Button (with "SUBMIT" as its text).
Include an additional TextView for displaying error messages, which will be used in Step 2.
Ensure the password is not shown in clear text.
When rotating the device, ensure that the inputs persist. (This is just a smoke test; do you know why?)
Step 2: Handle the onClick event for the SUBMIT Button
When the SUBMIT button is clicked, check if the User Name is harry potter or hermione granger(all lower-case) and the Password is Ron Weasley(with R and M capitalized).
If the criteria are met, launch the second activity and pass the user name to it (Hint: Use a Bundle with startActivity).
If the credentials are incorrect, display an error message, such as Wrong Credentials. Try again, in the Error TextView defined in Step 1.
Step 3: Design the Second Activity
On the second activity, display a sentence like Welcome XXX, where XXX represents the user name (either "Harry Potter" or "Hermione Granger") passed from the login activity. Do not hard code the user name.
please show step by step in android studio

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!