A sustainable hostel management Android application designed to help students manage food waste, donate clothes, report water cooler issues, and learn about eco-friendly practices.
- Report food waste from different hostels
- Track food items and quantities
- Submit reports to NGOs
- View previous food waste reports
- Donate unused clothes with detailed information
- Specify cloth type, size, and quantity
- Submit donations to NGOs
- Track donation history
- Report water cooler issues
- Select hostel, floor, and cooler number
- Choose problem type (leaking, not working, etc.)
- View complaint history
- Read educational blogs about sustainable living
- Learn about reducing carbon footprint
- Get tips on zero-waste lifestyle
- Understand the importance of sustainable living
- Secure login with college email (@iiitm.ac.in)
- Google Apps Script backend integration
- Password validation
- Language: Java
- Platform: Android (API 24+)
- UI: Material Design Components
- Networking: OkHttp
- Storage: SharedPreferences with Gson
- Backend: Google Apps Script (for login and data submission)
- Android Studio (latest version recommended)
- JDK 11 or higher
- Android SDK (API 24+)
- Internet connection for backend services
-
Clone the repository
git clone https://github.com/princexpoddar/HostelAid.git cd HostelAid -
Open in Android Studio
- Open Android Studio
- Select "Open an existing project"
- Navigate to the cloned repository folder
- Click "OK"
-
Configure Backend URLs
- Open
LoginActivity.javaand update thescriptUrlwith your Google Apps Script URL - Open
FoodWasteActivity.javaand update thescriptUrlfor food waste submissions - Open
ClothesDonationActivity.javaand update thescriptUrlfor clothes donation - Open
CoolerComplaintActivity.javaand update thescriptUrlfor cooler complaints
- Open
-
Sync Gradle
- Android Studio will automatically sync Gradle files
- If not, go to
File > Sync Project with Gradle Files
-
Build and Run
- Connect an Android device or start an emulator
- Click the "Run" button or press
Shift + F10
HostelAid/
├── app/
│ ├── src/
│ │ ├── main/
│ │ │ ├── java/com/example/hostelaid/
│ │ │ │ ├── Activities/
│ │ │ │ │ ├── SplashActivity.java
│ │ │ │ │ ├── LoginActivity.java
│ │ │ │ │ ├── MainActivity.java
│ │ │ │ │ ├── FoodWasteActivity.java
│ │ │ │ │ ├── ClothesDonationActivity.java
│ │ │ │ │ ├── CoolerComplaintActivity.java
│ │ │ │ │ ├── BlogListActivity.java
│ │ │ │ │ ├── BlogDetailActivity.java
│ │ │ │ │ └── Previous*Activity.java
│ │ │ │ ├── Adapters/
│ │ │ │ ├── Models/
│ │ │ │ └── DataStorageHelper.java
│ │ │ ├── res/
│ │ │ │ ├── layout/
│ │ │ │ ├── values/
│ │ │ │ └── drawable/
│ │ │ └── AndroidManifest.xml
│ └── build.gradle.kts
├── gradle/
└── README.md
This app uses Google Apps Script for backend services. To set up:
- Create a Google Apps Script project
- Deploy as a web app
- Update the script URLs in the respective activity files
- Configure the script to handle POST requests and store data in Google Sheets
Example Apps Script structure:
function doPost(e) {
const data = JSON.parse(e.postData.contents);
// Process data and save to Google Sheets
return ContentService.createTextOutput("success");
}Replace the placeholder URLs in these files:
LoginActivity.java- Line 33FoodWasteActivity.java- Line 25ClothesDonationActivity.java- Line 25CoolerComplaintActivity.java- Line 18
Update hostel names in:
FoodWasteActivity.java- Line 41ClothesDonationActivity.java- Line 41CoolerComplaintActivity.java- Line 32
- All submissions are saved locally using SharedPreferences
- Data persists even if backend sync fails
- View previous submissions anytime
- Background sync every 30 minutes (WorkManager) pulls latest data from backend
- On app open, a one-time foreground sync runs to refresh local cache
- Backend must support GET
?action=list&type=<food_waste|clothes_donation|cooler_complaint>&email=<user> - Replace placeholder URLs in
BackendConfig.javawith your Apps Script endpoints
- App works offline for viewing previous submissions
- Backend sync happens when online
- Failed syncs are handled gracefully
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Backend URLs need to be configured before use
- Some features may require additional backend setup
- Quiz feature for eco-awareness
- Eco game for engagement
- Push notifications for complaint status
- Statistics dashboard
- Multi-language support
- Dark mode