Question: Friendship Using Java in Android Studio Objectives: Design Layout Utilize Layout Manager Utilize Intent Pass Data among Activities Handle Rotation Outcome: You are required to
Friendship
Using Java in Android Studio
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 : 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
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 : Handle the onClick event for the SUBMIT Button
When the SUBMIT button is clicked, check if the User Name is harry potter or hermione grangerall lowercase and the Password is Ron Weasleywith 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
Step : 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
