My first question is where should I put my BroadcastReceiver class in a clean architecture project ? (Right now I put it inside data layer)
My project packages defined as below
├──data
└──repositories
├──di
├──domain
└── repository
└── use_cases
├──presentation
├──utils
My second question is how to send/get data received in the BroadcastReceiver class to ViewModel following the clean architecture ?
class ResponseReceiver: BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
// received data
}
}
and this is the declaration in the manifest file
<receiver
android:name=".data.ResponseReceiver"
android:enabled="true"
android:exported="true">
...
</receiver>