- Overview
- Key Features
- Architecture
- Technologies Used
- Project Structure
- How It Works
- Build Variants
- Installation & Setup
- Usage Guide
- Data Export
- Security & Privacy
- Known Issues
- Development
- Documentation
AttendanceHub is a modern, offline-first Android application designed to streamline classroom attendance management. Built with Jetpack Compose and following Material Design 3 guidelines, the app provides a seamless experience for both teachers and students.
Traditional attendance systems often require:
- Internet connectivity
- Manual roll calls (time-consuming)
- Paper-based records (prone to loss)
- Complex hardware setups
AttendanceHub uses WiFi Direct technology to create a local network where:
- β No internet required - Works completely offline
- β Automatic check-in - Students connect, attendance is logged instantly
- β Real-time tracking - Teachers see students as they connect
- β Digital records - Export to CSV for permanent storage
- β QR code convenience - Scan to connect automatically
- Create WiFi hotspot with one tap
- Automatic credential generation
- Custom SSID with random suffix for security
- Real-time connection monitoring
- Easy start/stop controls
- Create and track attendance sessions
- Session metadata (start time, duration, SSID)
- Persistent storage of all sessions
- Historical session viewing
- Session statistics
- Automatic QR code creation
- Embedded session information
- Encrypted WiFi credentials
- Expiry timestamp for security
- Large, scannable display
- Live list of connected students
- Student details (name, ID, device info)
- Connection timestamps (HH:mm:ss format)
- Student count display
- Visual indicators (avatars, status badges)
- Export attendance to CSV format
- Share via email, messaging, cloud storage
- Session metadata included
- Formatted, readable output
- Android native share integration
- Runs on port 8080
- RESTful API endpoints
- Handles student check-ins
- Real-time data synchronization
- Lightweight implementation
- Camera-based QR scanner
- ML Kit barcode detection
- Automatic WiFi connection
- Session validation
- Error handling
- Connect to teacher's hotspot
- Auto-submit attendance
- Device information collection
- Timestamp recording
- Confirmation feedback
- Enter session details manually
- Input SSID, password, server IP
- Validate and connect
- Useful when QR scanning fails
- User-friendly forms
- Real-time connection feedback
- Session information display
- Error messages
- Retry mechanisms
- Success confirmation
βββββββββββββββββββββββββββββββββββββββββββββββ
β View β
β (Jetpack Compose UI) β
β - HotspotActiveScreen β
β - StudentScannerScreen β
β - SessionHistoryScreen β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β ViewModel β
β - TeacherViewModel β
β - StudentViewModel β
β - State Management (StateFlow) β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Repository Layer β
β - SessionRepository β
β - NetworkManager β
ββββββββββββββββββββ¬βββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββ
β Data Sources β
β - Local Storage (Files) β
β - Network (HTTP Server) β
β - WiFi Direct API β
βββββββββββββββββββββββββββββββββββββββββββββββ
- β Unidirectional Data Flow - Data flows one way through the app
- β Separation of Concerns - Each layer has a single responsibility
- β Reactive Programming - StateFlow for reactive state management
- β Dependency Injection - Manual DI with constructor injection
- β Immutable State - UI state is immutable and predictable
| Technology | Purpose | Version |
|---|---|---|
| Kotlin | Primary programming language | 2.0.21 |
| Jetpack Compose | Modern declarative UI toolkit | 2024.09.00 |
| Material Design 3 | UI components and theming | Latest |
| Coroutines | Asynchronous programming | Latest |
| StateFlow | Reactive state management | Latest |
- ViewModel - UI state management with lifecycle awareness
- Navigation Compose - Type-safe navigation between screens
- Lifecycle - Lifecycle-aware components
- Activity Compose - Compose integration with activities
- CameraX - Camera functionality for QR scanning
- ServerSocket - Custom HTTP server implementation
- WiFi Direct API - Android hotspot management
- Network Callback API - Network connectivity monitoring
- JSON Serialization - kotlinx-serialization for data exchange
- ZXing - QR code generation (Teacher app)
com.journeyapps:zxing-android-embedded:4.3.0
- ML Kit - Barcode scanning (Student app)
com.google.mlkit:barcode-scanning:17.3.0
- Google Code Scanner - Alternative QR scanner
com.google.android.gms:play-services-code-scanner:16.1.0
- File System - Session storage in app files directory
- FileProvider - Secure file sharing
- CSV Export - Manual CSV generation for attendance lists
- Gradle (Kotlin DSL) - Build automation
- Android Gradle Plugin - 8.13.1
- Product Flavors - Multi-variant build system (teacher/student)
- BuildConfig - Build-time configuration
AttendanceHub/
β
βββ π¦ app/ # Main application module
β βββ src/
β β βββ main/ # Shared code
β β β βββ AndroidManifest.xml
β β β βββ java/org/wahid/attendancehub/
β β β β βββ MainActivity.kt
β β β βββ res/ # Shared resources
β β β
β β βββ teacher/ # Teacher variant
β β β βββ AndroidManifest.xml
β β β βββ java/org/wahid/attendancehub/
β β β β βββ ui/
β β β β β βββ screens/
β β β β β β βββ HotspotActiveScreen.kt
β β β β β β βββ SessionHistoryScreen.kt
β β β β β βββ viewmodel/
β β β β β βββ TeacherViewModel.kt
β β β β βββ net/
β β β β β βββ AttendanceServer.kt
β β β β β βββ TeacherHotspotManager.kt
β β β β βββ data/
β β β β β βββ SessionRepository.kt
β β β β β βββ AttendanceSession.kt
β β β β βββ navigation/
β β β β βββ TeacherNavHost.kt
β β β βββ res/
β β β βββ values/strings.xml
β β β βββ xml/file_paths.xml
β β β
β β βββ student/ # Student variant
β β βββ AndroidManifest.xml
β β βββ java/org/wahid/attendancehub/
β β β βββ ui/
β β β β βββ screens/
β β β β β βββ ScannerScreen.kt
β β β β β βββ ManualEntryScreen.kt
β β β β βββ viewmodel/
β β β β βββ StudentViewModel.kt
β β β βββ net/
β β β β βββ AttendanceClient.kt
β β β βββ navigation/
β β β βββ StudentNavHost.kt
β β βββ res/
β β βββ values/strings.xml
β β
β βββ build.gradle.kts # App build configuration
β
βββ π¦ core/ # Shared interfaces module
β βββ src/main/java/com/attendancehub/
β β βββ net/
β β β βββ HotspotManager.kt # Interface
β β β βββ HotspotInfo.kt # Data class
β β βββ models/
β β βββ StudentAttendance.kt
β βββ build.gradle.kts
β
βββ π¦ student/ # Student feature module
β βββ src/main/java/com/attendancehub/net/
β β βββ StudentHotspotManager.kt # Implementation
β βββ build.gradle.kts
β
βββ π build.gradle.kts # Root build file
βββ π settings.gradle.kts # Project settings
βββ π gradle.properties # Gradle properties
β
βββ π Documentation/
βββ PROJECT_README.md # This file
βββ ARCHITECTURE.md
βββ MODULARIZATION_SUMMARY.md
βββ NAVIGATION_COMPLETE.md
βββ HTTP_SERVER_COMPLETE.md
βββ QR_AND_THEME_COMPLETE.md
βββ STUDENT_QR_SCANNING_COMPLETE.md
βββ DOWNLOAD_STUDENT_LIST_COMPLETE.md
βββ CONNECTED_STUDENTS_LIST_BUG_FIX.md
βββ ... (other documentation files)
| Directory | Purpose |
|---|---|
app/src/main/ |
Code and resources shared by both variants |
app/src/teacher/ |
Teacher-specific implementation |
app/src/student/ |
Student-specific implementation |
core/ |
Shared interfaces and models |
student/ |
Standalone student module |
1. Teacher opens app
β
2. Tap "Start Hotspot"
β
3. System creates WiFi hotspot
β
4. QR code generated with:
- SSID
- Password
- Server IP (192.168.49.1)
- Session ID
- Expiry timestamp
β
5. HTTP server starts on port 8080
β
6. Display QR code to students
β
7. Students connect β Server receives check-in
β
8. Real-time UI update with student list
β
9. Teacher taps "Download" to export CSV
β
10. Share attendance via email/cloud
β
11. Tap "End Session" to stop
1. Student opens app
β
2. Camera opens for QR scanning
β
3. Scan teacher's QR code
β
4. App parses session info
β
5. Connect to WiFi hotspot
β
6. Send POST request to server:
POST http://192.168.49.1:8080/join
{
"studentId": "STU123",
"name": "John Doe",
"deviceId": "Samsung-ABC123"
}
β
7. Server responds with success
β
8. Display confirmation to student
{
"ssid": "AndroidShare_3912",
"password": "y9tm7mjfjm9heds",
"serverIp": "192.168.49.1",
"sessionId": "uuid-here",
"expiryTimestamp": 1764578454446
}POST /join HTTP/1.1
Host: 192.168.49.1:8080
Content-Type: application/json
{
"studentId": "STU123",
"name": "John Doe",
"deviceId": "Samsung-ABC123",
"timestamp": 1733040600000
}HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "success",
"message": "Attendance recorded",
"studentName": "John Doe"
}The app uses Gradle product flavors to create two distinct applications:
applicationId: "com.attendancehub.teacher"
Features:
- Hotspot management
- QR code generation
- HTTP server
- Student list display
- CSV exportapplicationId: "com.attendancehub.student"
Features:
- QR code scanning
- WiFi connection
- Attendance submission
- Status display- Debug: Development builds with logging enabled
- Release: Production builds with ProGuard (currently disabled)
| Configuration | Description |
|---|---|
teacherDebug |
Teacher app for testing |
teacherRelease |
Teacher app for production |
studentDebug |
Student app for testing |
studentRelease |
Student app for production |
- Android Studio Otter (2025.2.1) or later
- JDK 11 or higher
- Android SDK 28 or higher
- Gradle 8.13.1 (wrapper included)
# Clone the repository
git clone https://github.com/yourusername/AttendanceHub.git
cd AttendanceHub
# Build all variants
./gradlew build
# Build specific variant
./gradlew assembleTeacherDebug
./gradlew assembleStudentDebug
# Install on device
./gradlew installTeacherDebug
./gradlew installStudentDebugNo additional configuration required. The app will:
- Auto-generate hotspot credentials
- Use default port 8080
- Store sessions in app files directory
No additional configuration required. The app will:
- Request camera permissions on first launch
- Auto-detect session info from QR codes
- Launch the teacher app
- Tap "Start Hotspot" on the home screen
- Wait for QR code to appear (2-3 seconds)
- Display the QR code to students (or share SSID/password manually)
- Monitor the student list as students connect
- Session is now active
- View connected students in real-time
- See student count at the top
- Check connection times for each student
- Download attendance anytime during the session
- Tap "End Session & Disable Hotspot" button
- Session is automatically saved
- Students are disconnected
- Return to home screen
- Tap the download icon (π₯) next to student count
- Choose sharing method (Email, Drive, etc.)
- CSV file is shared with session data
- Launch the student app
- Point camera at teacher's QR code
- Wait for automatic scanning (1-2 seconds)
- App connects to WiFi automatically
- Attendance is submitted
- See confirmation message
- Tap "Enter Manually" on scanner screen
- Enter session details:
- SSID (from teacher's screen)
- Password (from teacher's screen)
- Server IP (usually 192.168.49.1)
- Tap "Connect"
- Submit attendance
Session Name,Session 2025-12-01 08:30
Session ID,4b977823-cdf3-4ffd-ab15-5440df2f3f32
SSID,AndroidShare_3912
Start Time,2025-12-01 08:30:00
End Time,2025-12-01 10:15:00
Total Students,25
No.,Student ID,Name,Device ID,Connected At,Timestamp
1,STU001,John Doe,Samsung-AB,08:40:54,1733040654000
2,STU002,Jane Smith,Pixel-XYZ,08:41:12,1733040672000
3,STU003,Bob Johnson,OnePlus-99,08:41:45,1733040705000
The CSV can be shared via:
- π§ Email (Gmail, Outlook, etc.)
- βοΈ Cloud Storage (Google Drive, Dropbox, OneDrive)
- π¬ Messaging Apps (WhatsApp, Telegram, Slack)
- πΎ Local Storage (Downloads folder)
- π± Nearby Share (Android's built-in sharing)
Exported files are saved to:
/Android/data/com.attendancehub.teacher/files/exports/
attendance_2025-12-01_08-30-00.csv
β WPA2 Encryption - Hotspot uses WPA2 for WiFi security β Random Credentials - Auto-generated passwords for each session β Session Expiry - QR codes expire after session ends β Local-Only Server - No internet connectivity required β Scoped Storage - Files stored in app-specific directories β FileProvider - Secure file sharing with URI permissions
- β No cloud storage - All data stays on device
- β No user accounts - No registration required
- β No tracking - No analytics or telemetry
- β No ads - Completely ad-free
- β Minimal permissions - Only essential permissions requested
ACCESS_WIFI_STATE- Check WiFi statusCHANGE_WIFI_STATE- Create hotspotACCESS_FINE_LOCATION- Required for WiFi APIs (Android 10+)NEARBY_WIFI_DEVICES- WiFi Direct (Android 13+)
CAMERA- QR code scanningACCESS_WIFI_STATE- Check WiFi statusCHANGE_WIFI_STATE- Connect to hotspotACCESS_FINE_LOCATION- Required for WiFi APIs (Android 10+)INTERNET- HTTP requests to local server
| Issue | Status | Date Fixed | Solution |
|---|---|---|---|
| Connected students not displaying | β Fixed | 2025-12-01 | Type mismatch in timestamp conversion |
| Window leak on QR scanner | β Fixed | 2024 | Proper lifecycle management |
| FileProvider resource not found | β Fixed | 2025-12-01 | IDE cache issue, build successful |
| Issue | Priority | Status |
|---|---|---|
| Date constructor deprecation warning | Low | Non-critical |
| Room database migration needed | Medium | Planned |
| PDF export support | Low | Feature request |
For bug reports, please check:
CONNECTED_STUDENTS_LIST_BUG_FIX.mdWINDOW_LEAK_EXPLANATION.md- Other documentation files in the project root
- Language: Kotlin (prefer idiomatic Kotlin)
- Formatting: Default Android Studio formatting
- Naming: camelCase for variables, PascalCase for classes
- Comments: Clear, concise documentation
# Run all tests
./gradlew test
# Run specific variant tests
./gradlew testTeacherDebugUnitTest
./gradlew testStudentDebugUnitTestEnable verbose logging:
// In TeacherViewModel or StudentViewModel
private val TAG = "YourTag"
Log.d(TAG, "Your debug message")# Build release APK
./gradlew assembleTeacherRelease
./gradlew assembleStudentRelease
# APKs will be in:
# app/build/outputs/apk/teacher/release/
# app/build/outputs/apk/student/release/| File | Description |
|---|---|
PROJECT_README.md |
This file - comprehensive overview |
ARCHITECTURE.md |
Detailed architecture documentation |
MODULARIZATION_SUMMARY.md |
Module structure explanation |
NAVIGATION_COMPLETE.md |
Navigation implementation details |
HTTP_SERVER_COMPLETE.md |
Server implementation guide |
QR_AND_THEME_COMPLETE.md |
QR code and theming documentation |
STUDENT_QR_SCANNING_COMPLETE.md |
QR scanning implementation |
DOWNLOAD_STUDENT_LIST_COMPLETE.md |
Export feature documentation |
CONNECTED_STUDENTS_LIST_BUG_FIX.md |
Bug fix documentation |
CAMERA_DEBUG_GUIDE.md |
Camera troubleshooting |
QR_DEBUG_GUIDE.md |
QR code debugging |
TeacherViewModel
class TeacherViewModel(application: Application) : AndroidViewModel(application) {
// State
val uiState: StateFlow<TeacherUiState>
// Actions
fun startHotspot()
fun stopHotspot()
fun downloadStudentList()
}AttendanceServer
class AttendanceServer(private val port: Int = 8080) {
val connectedStudents: StateFlow<List<StudentAttendance>>
fun startServer(): Result<Unit>
fun stopServer()
fun clearStudents()
}StudentViewModel
class StudentViewModel(application: Application) : AndroidViewModel(application) {
val uiState: StateFlow<StudentUiState>
fun connectToSession(sessionInfo: SessionInfo)
fun submitAttendance(studentInfo: StudentInfo)
}- Primary Use: Daily classroom attendance tracking
- Benefits: Fast, automated, no manual roll call
- Capacity: Supports 30+ students per session
- Use: Track participants in workshops
- Benefits: Professional attendance records
- Export: Easy sharing with organizers
- Use: Monitor student presence in labs
- Benefits: Timestamp-based tracking
- Records: Permanent digital records
- Use: Attendee check-in at events
- Benefits: Quick QR-based check-in
- Analytics: Real-time attendance numbers
Contributions are welcome! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
feature/amazing-feature) - Commit your changes with clear messages
- Push to your branch
- Open a Pull Request
- Clone the repository
- Open in Android Studio
- Sync Gradle files
- Run
assembleDebugto ensure everything builds - Make your changes
- Test thoroughly on both variants
- Submit PR
MIT LICENCE [LICENCE]
- Developer: WAHID-QANDIL
- GitHub: [Repository Link]
- Email: [[email protected]]
- Android Team - Jetpack Compose and modern Android development
- ZXing - QR code generation library
- Google ML Kit - Barcode scanning capabilities
- Material Design - UI/UX guidelines and components
| Aspect | Status |
|---|---|
| Development | β Active |
| Teacher App | β Functional |
| Student App | β Functional |
| CSV Export | β Complete |
| QR Scanning | β Complete |
| Documentation | β Comprehensive |
| Testing | |
| Release | π Pending |
- β Basic hotspot management
- β QR code generation and scanning
- β Real-time attendance tracking
- β CSV export
- β Material Design 3 UI
- π PDF export support
- π Session history UI
- π Statistics and analytics
- π Dark mode improvements
- π Multi-language support
- π Room database integration
- π Offline sync
- π Advanced reporting
- π Customizable themes
- π Attendance analytics
Made with β€οΈ using Kotlin & Jetpack Compose
Last Updated: December 1, 2025
Version 1.0.0
