Scriptmad

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 5

Hello everyone we back again, Welcome to our Android App Game.

Today, we're diving


into the XML layouts screens in our app and how it works. Let's create a stylish
screen and a clean, minimalist layout.
First up, through our Guessing Game app, we begin with `MainActivity`, the gateway
to a captivating world of number guessing. A welcoming `LinearLayout` graces the
login screen, painted with the captivating background '@drawable/pg1bg.' Here, the
'Login' and 'Sign Up' buttons, meticulously styled, beckon users with a modern
touch."

lets go to `MainActivity2`,. A distinctive `LinearLayout` takes center stage,


adorned in the visual finesse of '@drawable/page2bg.' Its clean and minimalist
design creates a serene backdrop for yet another crucial screen in our
application."

"Stepping into `MainActivity3`, we encounter an intriguing `RelativeLayout`


hosting a personalized user profile. The layout includes a circular image view and
text elements, creating a visually appealing and informative user interface."

"In `MainActivity4`, a vibrant narrative unfolds within a nested `LinearLayout`


structure . Themed around user profiles, it boasts a dynamic background
'@drawable/page3wc,' setting the stage for engaging content. CircleImageView and
TextViews harmonize, creating a visually pleasing user display."

"As we delve into `MainActivity5`, a versatile `RelativeLayout` unfolds. Designed


for dashboard navigation, it integrates seamlessly with '@drawable/page3wc.'
GridCards host icons and text, presenting a visually appealing dashboard to guide
users through various app functionalities."

"Transitioning to `MainActivity6`, a rich `RelativeLayout` takes center stage,


dedicated to individual user profiles. The layout features a unique navigation bar,
allowing users to effortlessly navigate back. CardViews showcase user details,
providing a delightful and informative user experience."

"Entering `MainActivity7`, the spotlight shifts to an `ImageView` and a grand


`ScrollView` within a `RelativeLayout`. The background '@drawable/page3wc'
complements the theme. TextViews reveal insights about the app, and a scrollable
grid unveils essential information about the app's creators."

"Moving to `MainActivity8`, a strategic `RelativeLayout` hosts a grid layout with


an informative CardView. The elegant design offers an insight into the app's rules,
guiding users through the gameplay. A 'Start' button beckons, inviting users to
embark on their guessing adventure."

"Concluding to our last XML files which is `MainActivity9`, a vibrant


`LinearLayout` creates the final act. Featuring a dynamic CardView within a
GridLayout, the layout defines the core gameplay. From input fields to point
trackers, it provides an interactive space for users to engage in the thrilling
number guessing challenge."

"Throughout this app exploration, 'match_parent' dimensions and vertical


orientations ensure a seamless, responsive, and visually cohesive user experience.
Each layout, meticulously crafted, contributes to the overall aesthetic and
functionality of the Guessing Game application."

Now let's proceed to the Java Code


We go into the main activity of our Android application. Extending the
AppCompatActivity class, our code sets the layout using setContentView in the
onCreate method. Key buttons, name LoginBtn and SignUpBtn, are initialized and
linked to XML elements via findViewById in the initialize method. The Up and In
methods handle the login and sign-up button clicks, respectively, triggering
intents to navigate to MainActivity2 and MainActivity3. A crucial check ensures
button text is not empty before initiating the intent, promoting data validity.

Next MainActivity2 Java class! This dynamic activity manages user authentication
through a visually appealing interface. We've crafted an intuitive layout with text
views for login instructions, username, and password, along with secure input
fields and a stylish 'Login' button. The code includes an alert dialog for a
seamless redirection to the registration screen in MainActivity3 upon clicking 'Not
yet registered? Click here.' The authentication process, triggered by the 'Login'
button, checks against predefined usernames and passwords, offering a personalized
experience for pre-registered users who are redirected to their dashboard in
MainActivity4. The code also features robust error handling, addressing scenarios
like empty username or password fields and providing informative toast messages.

Next one is MainActivity3 Java class! This dynamic activity facilitates user
registration with an engaging interface. The code orchestrates various elements,
including date picking with a DatePickerDialog, image capture through the device's
camera, and a detailed form for user information input. The 'Return' button
seamlessly navigates back to MainActivity, ensuring a smooth user experience.
Additionally, the 'Submit' button triggers a comprehensive validation process,
ensuring that all required fields are filled, passwords match, and unique options
are selected in the spinners. The code intelligently handles errors with alert
dialogs and provides a detailed summary of the user's input upon successful
registration. The selected gender, hobbies, and image are captured, and users are
redirected to MainActivity2 with their personalized details.

Next one is MainActivity4 Java class! This activity showcases a personalized


dashboard upon successful user login, providing a warm welcome with the user's name
and a displayed profile image. The user interface, designed with a LinearLayout
background, incorporates interactive elements like the 'Click Anywhere' text,
initiating a seamless transition to MainActivity5 upon a click event. The code
extracts user details, such as first name, last name, and profile image, passed
from the previous activity. Users are greeted with a personalized welcome message
and their profile image upon entry. The 'Click Anywhere' feature intelligently
checks for user interaction, triggering a redirection to MainActivity5 while
carrying over the user's information.

Next one is MainActivity5 Java class! This activity serves as the hub for user
navigation, providing options to explore different features. The code establishes
interactive elements represented by LinearLayouts—each corresponding to distinct
functionalities. Users can seamlessly transition to MainActivity6 to view and edit
their profile by clicking on the 'Profile' section. The 'About' section initiates a
journey to MainActivity7, offering more information about the application. For
gaming enthusiasts, the 'Game' section opens up the exciting world of
MainActivity8. The 'Logout' section prompts users with an alert dialog to confirm
their logout intent. Upon confirmation, users are gracefully redirected to the
login screen in MainActivity.

Next one is MainActivity6 Java class! This activity offers users an immersive view
of their profile details. The user interface, adorned with a CircleImageView for
the profile picture, showcases various TextViews presenting information such as
username, full name, email, date of birth, gender, contact number, address, and
hobbies. Users can seamlessly navigate back to the previous screen by clicking the
'Back' button (BackDM). The code intelligently extracts and displays user data
passed from the previous activity, enabling a seamless and personalized user
experience.

Next one is MainActivity7 Java Class! This activity dedicated to providing


information about the app. The minimalist user interface features an 'About'
section with an ImageView (BackAbout) serving as the back button. Users can easily
return to the previous screen by tapping the back button. The code ensures a smooth
user experience by implementing a click listener on the back button, executing the
finish() method to close the current activity.

Next we go to MainActivity8 class to Delve into the functionalities of this Android


app, an activity designed to present rules or instructions for the app's game
feature. The interface features an ImageView (BackRule) for navigation back to the
previous screen and a Button (BtnStart) to initiate the game. The code is designed
for a seamless user experience, allowing users to start the game by tapping the
'Start' button and return to the previous screen using the back button. The click
listeners are efficiently implemented to handle these interactions.

Last is the MainActivity9 Class where users attempt to guess a randomly generated
number within a specified range. The interface consists of a title (TitleGuess), an
input field (InputNumber) for user guesses, a hint display (Hint), and buttons
(BtnGuess) to submit guesses. The game incorporates a limited number of attempts
(MAX_ATTEMPTS) and awards points for correct guesses, with a maximum points
threshold (MAX_POINTS). The code efficiently handles user interactions, displays
informative alerts for different game outcomes, and allows users to continue or
return to the main screen.

Let's move on to the Java Code now. We enter the main activity of our Android
application, where our code, extending the AppCompatActivity class, defines the
layout using setContentView in the onCreate method. The LoginBtn and SignUpBtn
buttons are initialized and linked to XML elements through findViewById in the
initialize method. The Up and In methods manage the login and sign-up button
clicks, respectively, triggering intents to navigate to MainActivity2 and
MainActivity3. A crucial check ensures that the button text is not empty before
initiating the intent, ensuring data validity.

Now, onto the MainActivity2 Java class! This dynamic activity oversees user
authentication through an aesthetically pleasing interface. We've designed an
intuitive layout featuring text views for login instructions, username, and
password, along with secure input fields and a stylish 'Login' button. The code
includes an alert dialog for a seamless redirection to the registration screen in
MainActivity3 upon clicking 'Not yet registered? Click here.' The authentication
process, triggered by the 'Login' button, checks against predefined usernames and
passwords, providing a personalized experience for pre-registered users redirected
to their dashboard in MainActivity4. The code also incorporates robust error
handling, addressing scenarios like empty username or password fields and
displaying informative toast messages.

Moving on to the MainActivity3 Java class! This dynamic activity facilitates user
registration with an engaging interface. The code coordinates various elements,
including date picking with a DatePickerDialog, image capture through the device's
camera, and a detailed form for user information input. The 'Return' button
smoothly navigates back to MainActivity, ensuring a user-friendly experience.
Additionally, the 'Submit' button triggers a comprehensive validation process,
ensuring all required fields are filled, passwords match, and unique options are
selected in the spinners. The code intelligently handles errors with alert dialogs
and provides a detailed summary of the user's input upon successful registration.
The selected gender, hobbies, and image are captured, and users are redirected to
MainActivity2 with their personalized details.

Next is the MainActivity4 Java class! This activity showcases a personalized


dashboard upon successful user login, offering a warm welcome with the user's name
and a displayed profile image. The user interface, designed with a LinearLayout
background, incorporates interactive elements like the 'Click Anywhere' text,
initiating a seamless transition to MainActivity5 upon a click event. The code
extracts user details, such as first name, last name, and profile image, passed
from the previous activity. Users are greeted with a personalized welcome message
and their profile image upon entry. The 'Click Anywhere' feature intelligently
checks for user interaction, triggering a redirection to MainActivity5 while
carrying over the user's information.

Next in line is the MainActivity5 Java class! This activity serves as the hub for
user navigation, providing options to explore different features. The code
establishes interactive elements represented by LinearLayouts—each corresponding to
distinct functionalities. Users can seamlessly transition to MainActivity6 to view
and edit their profile by clicking on the 'Profile' section. The 'About' section
initiates a journey to MainActivity7, offering more information about the
application. For gaming enthusiasts, the 'Game' section opens up the exciting world
of MainActivity8. The 'Logout' section prompts users with an alert dialog to
confirm their logout intent. Upon confirmation, users are gracefully redirected to
the login screen in MainActivity.

Moving on to the MainActivity6 Java class! This activity provides users with an
immersive view of their profile details. The user interface, adorned with a
CircleImageView for the profile picture, showcases various TextViews presenting
information such as username, full name, email, date of birth, gender, contact
number, address, and hobbies. Users can seamlessly navigate back to the previous
screen by clicking the 'Back' button (BackDM). The code intelligently extracts and
displays user data passed from the previous activity, enabling a seamless and
personalized user experience.

Next up is the MainActivity7 Java Class! This activity is dedicated to providing


information about the app. The minimalist user interface features an 'About'
section with an ImageView (BackAbout) serving as the back button. Users can easily
return to the previous screen by tapping the back button. The code ensures a smooth
user experience by implementing a click listener on the back button, executing the
finish() method to close the current activity.

Now, let's explore the MainActivity8 class to delve into the functionalities of
this Android app, an activity designed to present rules or instructions for the
app's game feature. The interface features an ImageView (BackRule) for navigation
back to the previous screen and a Button (BtnStart) to initiate the game. The code
is designed for a seamless user experience, allowing users to start the game by
tapping the 'Start' button and return to the previous screen using the back button.
The click listeners are efficiently implemented to handle these interactions.

Finally, we reach the MainActivity9 Class where users attempt to guess a randomly
generated number within a specified range. The interface consists of a title
(TitleGuess), an input field (InputNumber) for user guesses, a hint display (Hint),
and buttons (BtnGuess) to submit guesses. The game incorporates a limited number of
attempts (MAX_ATTEMPTS) and awards points for correct guesses, with a maximum
points threshold (MAX_POINTS). The code efficiently handles user interactions,
displays informative alerts for different game outcomes, and allows users to
continue or return to the main screen.

You might also like