I want to handle the Connection and disconnection of Bluetooth devices on my android java app, but i need some help, I must catch the current location, where the disconnection occurs between the stored Bluetooth address and the phone (that has the app) and store it in my database. In my app I already have a database, in which I can store the Bluetooth address of each device.
The question is: How can I catch the current location of the disconnection between app and car and store it in my firestore database ? then how can I call it in order to show it in my MapActivtity?