A simple Android app built using Kotlin, demonstrating user Signup, Login, Validation, and Session Management using SharedPreferences.
✅ User Registration (Signup)
- Stores user details like Name, Email, and Password in SharedPreferences.
- Validates all inputs before saving.
✅ User Login
- Checks user credentials against saved data.
- Prevents login if email or password is incorrect.
- Redirects to Welcome Screen on successful login.
✅ Session Management
- If the user is already logged in, the app directly opens the WelcomeActivity (skipping login screen).
- Session persists until the user logs out.
✅ Logout Functionality
- Clears all saved session data.
- Redirects user back to login screen.
✅ Input Validation
- Ensures name, email, and password are properly entered.
- Validates email format and password length.
- Displays user-friendly Toast messages for errors.
- Language: Kotlin
- IDE: Android Studio
- Storage: SharedPreferences
- Architecture: Simple Activity-based navigation
- UI Layouts: XML using LinearLayout
-
MainActivity (Signup) → User enters name, email, and password → Data validated and saved in SharedPreferences
-
LoginActivity → User enters credentials → Validates and compares with SharedPreferences → If valid → navigates to WelcomeActivity
-
WelcomeActivity → Displays saved user details (Name & Email) → Provides “Logout” button to clear the session
-
CommonUtils.kt → Contains reusable functions like
showToast()andcheckValidation()
-
Clone the repository:
git clone https://github.com/jainabhishek2505/SharedPrefrenceUssingSaveDetaiils.git
-
Open the project in Android Studio
-
Sync Gradle and run the app on an emulator or a real device
- Install the app on your phone using this URL: https://drive.google.com/file/d/1Hl5sJHsmP2cnhCvgS6G5Mf18E9QKI0hs/view?usp=sharing
Abhishek Jain 💬 Android Developer | Kotlin | Java