package com.parentalmonitor.child import android.app.Application import android.app.NotificationChannel import android.app.NotificationManager import android.os.Build import com.parentalmonitor.child.api.ApiClient class ParentalMonitorApp : Application() { lateinit var apiClient: ApiClient private set override fun onCreate() { super.onCreate() instance = this apiClient = ApiClient(this) createNotificationChannels() } private fun createNotificationChannels() { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { val manager = getSystemService(NotificationManager::class.java) val monitoringChannel = NotificationChannel( CHANNEL_MONITORING, "Monitoring Service", NotificationManager.IMPORTANCE_LOW ).apply { description = "Background monitoring service notification" setShowBadge(false) } manager.createNotificationChannel(monitoringChannel) val commandChannel = NotificationChannel( CHANNEL_COMMANDS, "Remote Commands", NotificationManager.IMPORTANCE_HIGH ).apply { description = "Remote command notifications" } manager.createNotificationChannel(commandChannel) val alertChannel = NotificationChannel( CHANNEL_ALERTS, "Alerts", NotificationManager.IMPORTANCE_DEFAULT ).apply { description = "System alerts and messages" } manager.createNotificationChannel(alertChannel) } } companion object { lateinit var instance: ParentalMonitorApp private set const val CHANNEL_MONITORING = "monitoring_service" const val CHANNEL_COMMANDS = "remote_commands" const val CHANNEL_ALERTS = "alerts" } }