Activity: Practice Android Java Activity Components
You will create 10 different Android activities, each performing specific functions as described in the components. Follow the instructions for each activity, and then you will push the code to GitHub and document it on Hashnode.
1. DisplayHelloWorldActivity
Goal: Display the text "Hello World" on the screen using a variable from the Kotlin/Java file.
Instructions:
Create an activity named
DisplayHelloWorldActivity.Add a
TextViewin the layout.In the activity, set the text of the
TextViewto "Hello World".
2. ShowHelloButtonActivity
Goal: Create a button, and when the user clicks the button, display "Hello World".
Instructions:
Create an activity named
ShowHelloButtonActivity.Add a
Buttonand aTextViewin the layout.Set the
TextViewto display "Hello World" when the button is clicked.
3. DisplayNameActivity
Goal: User inputs their name, and when the button is clicked, their name is displayed on the screen.
Instructions:
Create an activity named
DisplayNameActivity.Add an
EditText,Button, andTextViewin the layout.When the button is clicked, show the user's inputted name in the
TextView.
4. CounterActivity
Goal: Create a counter that increases by 1 when the user clicks a button.
Instructions:
Create an activity named
CounterActivity.Add a
Buttonand aTextViewin the layout.Implement logic to increment the counter every time the button is clicked and display the value in the
TextView.
5. SimpleFormActivity
Goal: Create a form with text inputs and a submit button, display the submitted input data.
Instructions:
Create an activity named
SimpleFormActivity.Add
EditTextfields for the form inputs, aButtonto submit, and aTextViewto display the input data.
6. UserAgeActivity
Goal: Input the user’s birth year, and when the button is clicked, display their age.
Instructions:
Create an activity named
UserAgeActivity.Add an
EditTextto input the birth year, aButton, and aTextView.Calculate and display the user's age when the button is clicked.
7. CalculatorActivity
Goal: Create a simple calculator with add, subtract, multiply, and divide functionalities.
Instructions:
Create an activity named
CalculatorActivity.Add two
EditTextfields to input numbers, fourButtons for the operations, and aTextViewto display the result.Implement the basic arithmetic functions in the activity.
8. EvenOddCheckerActivity
Goal: Input a number and check if it is even or odd.
Instructions:
Create an activity named
EvenOddCheckerActivity.Add an
EditTextto input a number, aButton, and aTextView.Implement logic to check if the number is even or odd and display the result.
9. ShowDateActivity
Goal: Create a button that shows the current date and time when clicked.
Instructions:
Create an activity named
ShowDateActivity.Add a
Buttonand aTextViewin the layout.Implement the logic to show the current date and time when the button is clicked.
10. PalindromeCheckerActivity
Goal: Input a word and check if it's a palindrome.
Instructions:
Create an activity named
PalindromeCheckerActivity.Add an
EditTextto input a word, aButton, and aTextView.Implement logic to check if the word is a palindrome and display the result.
Project Setup and Commit Instructions
Create a New Android Project:
Create a new Android project using Android Studio.
Add 10 activities as per the instructions above.
Implement Each Activity:
For each activity, create a corresponding XML layout and add the necessary UI elements (e.g.,
Button,TextView,EditText).Implement the functionality in the
Kotlin/Javacode based on the component descriptions.
Commit Your Changes to GitHub:
For each activity, create a meaningful commit.
Example commit message:
#1DisplayHelloWorldActivityEnsure there are 10 commits in total, each corresponding to a different activity.
Push the Entire Project to GitHub:
- Once all activities are created, push the project to a GitHub repository.
Don't use AI to generate your code. Instead, focus on mastering and understanding on Android Java
Documentation on Hashnode or Medium.com
Write a Blog Post:
Document the project by explaining the process of creating the 10 Android activities (add output in the screenshot).
Include brief descriptions of each activity and explain how they work.
Provide code snippets where necessary.
Add the link to your GitHub repository in the post so others can access the code.
Share on the Portal:
- Once post is complete, share the link on the appropriate platform.




