I am coming from the embedded world and I am quite new to Kotlin. I know there is some mechanism I can inherit and use in my class, but I don't know the name exactly for this mechanism for Android.
What I am looking for is:
- I have my Activity and this one instantiates my CustomClass
- My CustomClass perform some background tasks like handling BLE asynchronous communication
- CustomClass does not know when some packets will be received.
- Once the package is received, the CusomClass should call back the Activity and give the data by means of this mechanism.
What would be the best option to perform these callbacks?
P.s.: My apologies, I looked extensively but I don't even know the name to start my search.