This is a simple Android application demonstrating how to pass data (Name and Age) between two activities using Intents in Android Studio. The user inputs their name and age on the first screen, and upon clicking the "Send Data" button, the information is displayed on the second screen.
- Collect user input using EditText
- Navigate between activities
- Transfer data using Intents
- Display personalized message on the second screen
- Java
- Android Studio
- XML (for UI design)
- Android SDK 29 (API Level 29)
Amarjeet Kumar
UID: 21BCS10768
Department of Computer Science & Engineering
Chandigarh University
Portfolio: https://amarjeetkr.vercel.app/
LinkTree: https://linktr.ee/AmarjeetKumarJyotish
GitHub: https://github.com/AmarjeetJyotis
LinkedIn: https://www.linkedin.com/in/amarjeet-jyotish/
GeeksforGeeks: https://www.geeksforgeeks.org/user/amarjeetjyotish/
LeetCode: https://leetcode.com/u/AmarjeetJyotish/
app/ ├── java/ │ └── com.example.exp21/ │ ├── MainActivity.java │ └── SecondActivity.java ├── res/ │ ├── layout/ │ │ ├── activity_main.xml │ │ └── activity_second.xml │ └── values/ │ └── strings.xml
bash Copy Edit
- Clone this repository:
git clone https://github.com/your-username/android-intent-demo.git
Open the project in Android Studio.
Run the app on an emulator or physical device.
🧠 How It Works MainActivity.java:
Collects user input.
Sends it to SecondActivity using an Intent.
SecondActivity.java:
Receives the data via getIntent().getStringExtra(...).
Displays it in TextViews.
📌 Requirements Android Studio Arctic Fox or newer
Android device or emulator (API 29+)
Java 8+
📝 License This project is licensed under the MIT License - see the LICENSE file for details.