383 lines
8.9 KiB
Markdown
383 lines
8.9 KiB
Markdown
# 📱 APK Monitoring Pengering Ikan - FINAL VERSION
|
|
|
|
## 🎯 Aplikasi Monitoring Only (Tanpa Kontrol)
|
|
|
|
---
|
|
|
|
## ✅ Perubahan Terakhir
|
|
|
|
### 1. **Hapus Lamp** 🔦
|
|
- ❌ Lamp dihapus dari tampilan
|
|
- ✅ Hanya 3 device: **Heater, Fan, Exhaust**
|
|
- ✅ Grid 3 kolom (lebih rapi)
|
|
|
|
### 2. **Hapus Semua Kontrol** 🎮
|
|
- ❌ Tidak ada tombol toggle device
|
|
- ❌ Tidak ada floating action button (START/RESET)
|
|
- ✅ **Monitoring Only** - hanya menampilkan status
|
|
- ✅ Device cards tidak bisa diklik
|
|
|
|
### 3. **Auto-Update Data** 🔄
|
|
- ✅ Data update otomatis setiap **5 detik**
|
|
- ✅ Tidak perlu pull-to-refresh manual
|
|
- ✅ Polling dari Railway API
|
|
- ✅ Real-time via MQTT (jika tersedia)
|
|
|
|
### 4. **Notifikasi Push** 🔔
|
|
- ✅ **Pengeringan Siap** (status READY)
|
|
- ✅ **Ikan Terdeteksi** (status BERJALAN)
|
|
- ✅ **Pengeringan Selesai** (status SELESAI)
|
|
- ✅ Notifikasi muncul di dalam & luar aplikasi
|
|
- ✅ Notifikasi tersimpan di history
|
|
|
|
---
|
|
|
|
## 📊 Tampilan Aplikasi
|
|
|
|
### Status Card
|
|
```
|
|
┌─────────────────────────────────────┐
|
|
│ 🟣 SCANNING │
|
|
│ Menunggu deteksi ikan... │
|
|
│ │
|
|
│ Waktu Mulai: 10:30:45 │
|
|
│ Durasi: 00:15:32 │
|
|
└─────────────────────────────────────┘
|
|
```
|
|
|
|
### Metrics
|
|
```
|
|
┌──────────────┐ ┌──────────────┐
|
|
│ 🌡️ Suhu │ │ ⚖️ Berat │
|
|
│ 25.9°C │ │ 2183 g │
|
|
└──────────────┘ └──────────────┘
|
|
|
|
┌──────────────────────────────────┐
|
|
│ 🎯 Target Berat │
|
|
│ 628 g │
|
|
└──────────────────────────────────┘
|
|
```
|
|
|
|
### Device Status (3 Kolom)
|
|
```
|
|
┌──────────┐ ┌──────────┐ ┌──────────┐
|
|
│ 🔥 Heater│ │ 💨 Fan │ │ 🌪️ Exhaust│
|
|
│ ON │ │ ON │ │ OFF │
|
|
└──────────┘ └──────────┘ └──────────┘
|
|
```
|
|
|
|
---
|
|
|
|
## 🔔 Notifikasi
|
|
|
|
### Kapan Notifikasi Muncul?
|
|
|
|
#### 1. **Pengeringan Dimulai** (READY)
|
|
```
|
|
🔵 Pengeringan Dimulai
|
|
Proses pengeringan ikan telah dimulai
|
|
```
|
|
- Trigger: Status berubah ke READY
|
|
- Muncul: Saat ESP32 mulai proses
|
|
|
|
#### 2. **Ikan Terdeteksi** (BERJALAN)
|
|
```
|
|
🔵 Ikan Terdeteksi
|
|
Berat ikan: 2183 gram
|
|
```
|
|
- Trigger: Status berubah ke BERJALAN
|
|
- Muncul: Saat ikan diletakkan di timbangan
|
|
|
|
#### 3. **Pengeringan Selesai** (SELESAI)
|
|
```
|
|
🟢 Pengeringan Selesai
|
|
Target tercapai! Berat akhir: 628 gram
|
|
```
|
|
- Trigger: Status berubah ke SELESAI
|
|
- Muncul: Saat berat mencapai target
|
|
|
|
### Notifikasi di Luar Aplikasi
|
|
- ✅ Muncul di notification bar Android
|
|
- ✅ Dengan suara & vibration
|
|
- ✅ Bisa diklik untuk buka aplikasi
|
|
- ✅ Tersimpan di history notifikasi
|
|
|
|
---
|
|
|
|
## 🔄 Auto-Update Mechanism
|
|
|
|
### Polling Timer (5 Detik)
|
|
```dart
|
|
Timer.periodic(Duration(seconds: 5), (timer) {
|
|
// Fetch latest data dari API
|
|
_loadLatestData();
|
|
|
|
// Cek perubahan status
|
|
if (newStatus != previousStatus) {
|
|
// Trigger notifikasi
|
|
_notificationManager.notify...();
|
|
}
|
|
});
|
|
```
|
|
|
|
### Flow:
|
|
1. **Setiap 5 detik** → Fetch data dari Railway API
|
|
2. **Cek status** → Bandingkan dengan status sebelumnya
|
|
3. **Jika berubah** → Trigger notifikasi
|
|
4. **Update UI** → Tampilkan data terbaru
|
|
|
|
---
|
|
|
|
## 📱 APK Info
|
|
|
|
- **Nama:** PengeringIkan.apk
|
|
- **Lokasi:** Desktop
|
|
- **Ukuran:** 20.65 MB
|
|
- **Build:** Release
|
|
- **Version:** 1.0.0 (Monitoring Only)
|
|
|
|
### Fitur:
|
|
- ✅ Monitoring only (no control)
|
|
- ✅ Auto-update setiap 5 detik
|
|
- ✅ Push notifications
|
|
- ✅ Connection indicators
|
|
- ✅ 3 device cards (Heater, Fan, Exhaust)
|
|
- ✅ Status tracking
|
|
- ✅ Timer durasi
|
|
- ✅ Data dari Railway API
|
|
|
|
---
|
|
|
|
## 🚀 Cara Install & Test
|
|
|
|
### 1. Uninstall APK Lama
|
|
```
|
|
Settings → Apps → Pengering Ikan → Uninstall
|
|
```
|
|
|
|
### 2. Install APK Baru
|
|
```
|
|
File Manager → Desktop → PengeringIkan.apk → Install
|
|
```
|
|
|
|
### 3. Izinkan Notifikasi
|
|
```
|
|
Saat pertama buka, izinkan:
|
|
- ✅ Show notifications
|
|
- ✅ Sound
|
|
- ✅ Vibration
|
|
```
|
|
|
|
### 4. Test Auto-Update
|
|
- Buka aplikasi
|
|
- Tunggu 5 detik
|
|
- Data harus update otomatis
|
|
- Tidak perlu pull-to-refresh
|
|
|
|
### 5. Test Notifikasi
|
|
- Ubah status di ESP32 (READY → BERJALAN → SELESAI)
|
|
- Notifikasi harus muncul otomatis
|
|
- Cek notification bar Android
|
|
- Cek history notifikasi di app
|
|
|
|
---
|
|
|
|
## 🎨 UI Changes
|
|
|
|
### Before (4 Device Cards):
|
|
```
|
|
┌─────────┐ ┌─────────┐
|
|
│ Heater │ │ Fan │
|
|
└─────────┘ └─────────┘
|
|
┌─────────┐ ┌─────────┐
|
|
│ Lamp │ │ Exhaust │
|
|
└─────────┘ └─────────┘
|
|
```
|
|
|
|
### After (3 Device Cards):
|
|
```
|
|
┌────────┐ ┌────────┐ ┌────────┐
|
|
│ Heater │ │ Fan │ │Exhaust │
|
|
└────────┘ └────────┘ └────────┘
|
|
```
|
|
|
|
### Device Card Styling:
|
|
- ✅ Compact design
|
|
- ✅ Icon dengan background color
|
|
- ✅ Status badge (ON/OFF)
|
|
- ✅ Tidak bisa diklik
|
|
- ✅ Responsive 3 kolom
|
|
|
|
---
|
|
|
|
## 🔍 Troubleshooting
|
|
|
|
### Notifikasi Tidak Muncul?
|
|
|
|
**Cek 1: Permission**
|
|
```
|
|
Settings → Apps → Pengering Ikan → Notifications
|
|
- Pastikan "Show notifications" ON
|
|
```
|
|
|
|
**Cek 2: Do Not Disturb**
|
|
```
|
|
Settings → Sound → Do Not Disturb
|
|
- Pastikan OFF atau allow app notifications
|
|
```
|
|
|
|
**Cek 3: Battery Optimization**
|
|
```
|
|
Settings → Battery → Battery Optimization
|
|
- Set "Pengering Ikan" to "Don't optimize"
|
|
```
|
|
|
|
**Cek 4: Status Berubah**
|
|
```
|
|
- Notifikasi hanya muncul saat status berubah
|
|
- Cek ESP32 mengirim status baru
|
|
```
|
|
|
|
### Data Tidak Update?
|
|
|
|
**Cek 1: Connection Icons**
|
|
- WiFi icon hijau? → MQTT OK
|
|
- Cloud icon hijau? → API OK
|
|
|
|
**Cek 2: Backend Status**
|
|
```
|
|
Browser: https://web-production-47eb.up.railway.app/
|
|
Harus return: {"status":"OK",...}
|
|
```
|
|
|
|
**Cek 3: ESP32 Status**
|
|
- ESP32 harus nyala
|
|
- ESP32 harus connect WiFi
|
|
- ESP32 harus publish data
|
|
|
|
**Cek 4: Polling Timer**
|
|
- Tunggu 5 detik
|
|
- Data harus update otomatis
|
|
- Cek timestamp data
|
|
|
|
---
|
|
|
|
## 📊 Status Flow
|
|
|
|
```
|
|
DISCONNECTED
|
|
↓
|
|
CONNECTING
|
|
↓
|
|
READY (🔔 Notif: Pengeringan Dimulai)
|
|
↓
|
|
SCANNING (Menunggu ikan)
|
|
↓
|
|
BERJALAN (🔔 Notif: Ikan Terdeteksi)
|
|
↓
|
|
SELESAI (🔔 Notif: Pengeringan Selesai)
|
|
```
|
|
|
|
---
|
|
|
|
## 🎯 Testing Checklist
|
|
|
|
### Installation
|
|
- [ ] Uninstall APK lama
|
|
- [ ] Install APK baru
|
|
- [ ] Izinkan notifikasi
|
|
- [ ] Buka aplikasi
|
|
|
|
### UI
|
|
- [ ] Hanya 3 device cards (Heater, Fan, Exhaust)
|
|
- [ ] Tidak ada Lamp
|
|
- [ ] Device cards tidak bisa diklik
|
|
- [ ] Tidak ada floating action button
|
|
- [ ] Connection icons terlihat
|
|
|
|
### Auto-Update
|
|
- [ ] Data update setiap 5 detik
|
|
- [ ] Tidak perlu pull-to-refresh
|
|
- [ ] Timestamp berubah
|
|
- [ ] Status update otomatis
|
|
|
|
### Notifikasi
|
|
- [ ] Notif muncul saat status READY
|
|
- [ ] Notif muncul saat status BERJALAN
|
|
- [ ] Notif muncul saat status SELESAI
|
|
- [ ] Notif muncul di notification bar
|
|
- [ ] Notif tersimpan di history
|
|
- [ ] Notif bisa diklik
|
|
|
|
### Monitoring
|
|
- [ ] Suhu update real-time
|
|
- [ ] Berat update real-time
|
|
- [ ] Target terlihat
|
|
- [ ] Status berubah sesuai ESP32
|
|
- [ ] Device status (ON/OFF) update
|
|
- [ ] Timer durasi jalan
|
|
|
|
---
|
|
|
|
## 📝 Technical Details
|
|
|
|
### Auto-Update
|
|
- **Interval:** 5 detik
|
|
- **Method:** Polling via API
|
|
- **Endpoint:** `/api/data/latest`
|
|
- **Fallback:** MQTT real-time
|
|
|
|
### Notifikasi
|
|
- **Library:** flutter_local_notifications
|
|
- **Storage:** SharedPreferences
|
|
- **Trigger:** Status change detection
|
|
- **Types:** Info, Success, Warning, Error
|
|
|
|
### Device Cards
|
|
- **Count:** 3 (Heater, Fan, Exhaust)
|
|
- **Layout:** GridView 3 columns
|
|
- **Aspect Ratio:** 0.9
|
|
- **Interaction:** Display only (no tap)
|
|
|
|
---
|
|
|
|
## 🔄 Update History
|
|
|
|
### Version 1.0.0 - Monitoring Only (1 Juni 2026)
|
|
- ✅ Hapus Lamp dari tampilan
|
|
- ✅ Hapus semua kontrol (monitoring only)
|
|
- ✅ Auto-update data setiap 5 detik
|
|
- ✅ Notifikasi push untuk status
|
|
- ✅ Device cards 3 kolom
|
|
- ✅ Compact UI design
|
|
- ✅ No interaction (display only)
|
|
|
|
---
|
|
|
|
## 💡 Tips
|
|
|
|
1. **Biarkan Aplikasi Berjalan**
|
|
- Auto-update bekerja di background
|
|
- Notifikasi tetap muncul meski app tertutup
|
|
|
|
2. **Cek Notifikasi**
|
|
- Swipe down untuk lihat notification bar
|
|
- Tap notifikasi untuk buka app
|
|
|
|
3. **Monitor Status**
|
|
- Perhatikan perubahan status
|
|
- Notifikasi muncul saat status berubah
|
|
|
|
4. **Connection Indicators**
|
|
- WiFi icon = MQTT status
|
|
- Cloud icon = API status
|
|
- Hijau = Connected, Merah = Disconnected
|
|
|
|
---
|
|
|
|
**Build Date:** 1 Juni 2026
|
|
**Version:** 1.0.0 (Monitoring Only)
|
|
**Status:** ✅ PRODUCTION READY
|
|
|
|
🎉 **Aplikasi siap digunakan untuk monitoring!**
|