BluetoothProfile.ServiceListener

This interface is used to notify the BluetoothProfile clients when they are connected or disconnected from the service. The must implemented methods for this interface are onServiceConnected() and onServiceDisconnected().

BluetoothProfile.ServiceListener leServiceListener = new BluetoothProfile.ServiceListener() {     @Override     public void onServiceConnected(int profile, BluetoothProfile proxy) {         //Do something upon receiving a service connection     }     @Override     public void onServiceDisconnected(int profile) {         //Do something upon receiving a service disconnection     } };

Get Building Bluetooth Low Energy Systems now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.