190 lines
4.7 KiB
Markdown
190 lines
4.7 KiB
Markdown
# 📱 Sistem Absensi Akademik
|
|
|
|
Aplikasi mobile berbasis Android untuk sistem absensi mahasiswa dengan validasi lokasi GPS dan pengambilan foto.
|
|
|
|
---
|
|
|
|
## 🎯 Fitur Utama
|
|
|
|
- 🔐 **Login Pengguna** - Autentikasi dengan NPM dan Password
|
|
- 📍 **Pengambilan Lokasi** - Deteksi GPS real-time (Latitude & Longitude)
|
|
- 🏫 **Validasi Radius** - Validasi lokasi dalam radius 100m dari kampus
|
|
- 📸 **Foto Mahasiswa** - Pengambilan foto saat absensi
|
|
- 🕒 **Pencatatan Waktu** - Timestamp otomatis setiap absensi
|
|
- 📄 **Riwayat Kehadiran** - History absensi tersimpan lokal
|
|
- ⚠️ **Notifikasi** - Alert jika absensi ditolak (lokasi tidak valid)
|
|
- 🌐 **Integrasi Server** - Kirim data ke webhook n8n
|
|
|
|
---
|
|
|
|
## 🛠️ Tech Stack
|
|
|
|
- **Language:** Kotlin
|
|
- **UI Framework:** Jetpack Compose
|
|
- **Design:** Material Design 3
|
|
- **Location:** Google Play Services (Fused Location Provider)
|
|
- **Storage:** SharedPreferences
|
|
- **Network:** HttpURLConnection
|
|
- **Min SDK:** API 24 (Android 7.0)
|
|
- **Target SDK:** API 34 (Android 14)
|
|
|
|
---
|
|
|
|
## 📁 Struktur Project
|
|
|
|
```
|
|
app/src/main/java/id/ac/ubharajaya/sistemakademik/
|
|
│
|
|
├── MainActivity.kt # Entry point & navigation
|
|
│
|
|
├── models/
|
|
│ └── DataModels.kt # Data class (User, AbsensiRecord)
|
|
│
|
|
├── utils/
|
|
│ ├── SessionManager.kt # Manajemen sesi login
|
|
│ ├── LocationUtils.kt # Validasi lokasi & radius
|
|
│ ├── NetworkUtils.kt # HTTP request ke server
|
|
│ └── Constants.kt # Konstanta (dummy users)
|
|
│
|
|
└── ui/
|
|
└── screens/
|
|
├── LoginScreen.kt # Halaman login
|
|
├── AbsensiScreen.kt # Halaman absensi utama
|
|
├── RiwayatScreen.kt # Halaman riwayat
|
|
└── ProfilScreen.kt # Halaman profil & logout
|
|
```
|
|
|
|
---
|
|
|
|
## 🚀 Instalasi & Setup
|
|
|
|
### 1. Clone Repository
|
|
```bash
|
|
git clone https://github.com/username/sistem-absensi-akademik.git
|
|
cd sistem-absensi-akademik
|
|
```
|
|
|
|
### 2. Buka di Android Studio
|
|
- Buka Android Studio
|
|
- File → Open → Pilih folder project
|
|
- Tunggu Gradle sync selesai
|
|
|
|
### 3. Konfigurasi
|
|
Edit file `utils/LocationUtils.kt`:
|
|
```kotlin
|
|
const val KAMPUS_LAT = -6.175392 // Koordinat kampus Anda
|
|
const val KAMPUS_LON = 106.827153 // Koordinat kampus Anda
|
|
const val RADIUS_METER = 100.0 // Radius dalam meter
|
|
```
|
|
|
|
Edit file `utils/NetworkUtils.kt`:
|
|
```kotlin
|
|
private const val WEBHOOK_URL = "https://your-webhook-url.com"
|
|
```
|
|
|
|
### 4. Build & Run
|
|
- Sambungkan device Android atau jalankan emulator
|
|
- Run → Run 'app'
|
|
|
|
---
|
|
|
|
## 📱 Cara Penggunaan
|
|
|
|
### Login
|
|
1. Buka aplikasi
|
|
2. Masukkan NPM dan Password
|
|
3. Tekan **Login**
|
|
|
|
**Demo Account:**
|
|
- NPM: `2024001` | Password: `password123`
|
|
- NPM: `2024002` | Password: `password123`
|
|
- NPM: `2024003` | Password: `password123`
|
|
|
|
### Absensi
|
|
1. Izinkan akses **Lokasi** (GPS)
|
|
2. Tunggu hingga lokasi **Valid** (hijau)
|
|
3. Tekan **Ambil Foto**
|
|
4. Izinkan akses **Kamera**
|
|
5. Ambil foto selfie
|
|
6. Tekan **Kirim Absensi**
|
|
|
|
### Riwayat & Profil
|
|
- Tab **Riwayat**: Lihat history absensi
|
|
- Tab **Profil**: Info user & logout
|
|
|
|
---
|
|
|
|
## 🔑 Permissions
|
|
|
|
Aplikasi memerlukan permission berikut:
|
|
- ✅ `INTERNET` - Kirim data ke server
|
|
- ✅ `ACCESS_FINE_LOCATION` - GPS akurasi tinggi
|
|
- ✅ `ACCESS_COARSE_LOCATION` - GPS fallback
|
|
- ✅ `CAMERA` - Ambil foto mahasiswa
|
|
|
|
---
|
|
|
|
## 📊 Data Format (Server)
|
|
|
|
JSON yang dikirim ke webhook:
|
|
```json
|
|
{
|
|
"npm": "202310715043",
|
|
"nama": "Muhammad Rafly Al Fathir",
|
|
"latitude": -6.175392,
|
|
"longitude": 106.827153,
|
|
"timestamp": 1705244400000,
|
|
"foto_base64": "base64_encoded_image...",
|
|
"jarak_meter": 45
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
## 📝 Changelog
|
|
|
|
### Version 1.0.0 (14 Januari 2026)
|
|
- ✨ Implementasi sistem login
|
|
- ✨ Validasi lokasi dengan radius
|
|
- ✨ Pengambilan foto mahasiswa
|
|
- ✨ Riwayat absensi lokal
|
|
- ✨ Integrasi webhook n8n
|
|
- 🐛 Fixed Android 13+ compatibility
|
|
|
|
---
|
|
|
|
## 🤝 Contributing
|
|
|
|
1. Fork repository
|
|
2. Buat branch baru (`git checkout -b feature/AmazingFeature`)
|
|
3. Commit changes (`git commit -m 'Add some AmazingFeature'`)
|
|
4. Push ke branch (`git push origin feature/AmazingFeature`)
|
|
5. Buat Pull Request
|
|
|
|
---
|
|
|
|
## 📄 License
|
|
|
|
Distributed under the MIT License. See `LICENSE` for more information.
|
|
gemini chatgpt claude
|
|
|
|
---
|
|
|
|
## 👨💻 Developer
|
|
|
|
**Universitas Bhayangkara Jakarta Raya**
|
|
- Website: https://ubharajaya.ac.id
|
|
- Email: admin@ubharajaya.ac.id
|
|
|
|
---
|
|
|
|
## 🙏 Acknowledgments
|
|
|
|
- [Jetpack Compose](https://developer.android.com/jetpack/compose)
|
|
- [Material Design 3](https://m3.material.io/)
|
|
- [Google Play Services](https://developers.google.com/android/guides/overview)
|
|
- [n8n Workflow Automation](https://n8n.io/)
|
|
|
|
---
|
|
|
|
**Made with ❤️ for Academic Attendance System** |