Interface Events
Events
interface enables monitoring of Zello SDK state and property changes-
Method Summary
Modifier and TypeMethodDescriptionvoid
Called when theAppState
changes.void
Called when the the state of theAudio
changes.void
onBluetoothAccessoryStateChanged
(BluetoothAccessoryType type, BluetoothAccessoryState state, String name, String description) Called when a Bluetooth accessory connection state changes.void
Called when theContacts
for the user changes.void
Called when an attempt to start the Zello foreground service fails.void
void
Called when the state of either theMessageOut
orMessageIn
changes.void
Called when an invocation of theZello.beginMessage()
method fails because the microphone permission hasn't been granted.void
Called when the selected contact changes.
-
Method Details
-
onSelectedContactChanged
void onSelectedContactChanged()Called when the selected contact changes.
This method is invoked on the UI thread. To retrieve the newly selected contact, call the
Zello.getSelectedContact(Contact)
method. -
onMessageStateChanged
void onMessageStateChanged()Called when the state of either the
MessageOut
orMessageIn
changes.This method is invoked on the UI thread. To retrieve the current message state, call the
Zello.getMessageIn(MessageIn)
andZello.getMessageOut(MessageOut)
methods. -
onAppStateChanged
void onAppStateChanged()Called when the
AppState
changes.This method is invoked on the UI thread. To retrieve the current
AppState
, call theZello.getAppState(AppState)
method.- See Also:
-
onLastContactsTabChanged
- Parameters:
tab
- The tab that changed.- See Also:
-
onContactsChanged
void onContactsChanged()Called when the
Contacts
for the user changes.This method is invoked on the UI thread. To retrieve the current
Contacts
snapshot, call theZello.getContacts()
method.When dealing with large contact lists (1000+ contacts), the best approach is to run both
getContacts()
and any contact processing in a background thread and then post the result to UI thread for display.- See Also:
-
onAudioStateChanged
void onAudioStateChanged()Called when the the state of the
Audio
changes.This method is invoked on the UI thread. To retrieve the current
Audio
, call theZello.getAudio()
method.- See Also:
-
onMicrophonePermissionNotGranted
void onMicrophonePermissionNotGranted()Called when an invocation of the
Zello.beginMessage()
method fails because the microphone permission hasn't been granted.This method is invoked on the UI thread.
The normal use case for handling this error would be to call
Zello.showMicrophonePermissionDialog()
. However, it is the responsibility of the app using the SDK to determine if they should handle this error or not. For example, if there are multiple apps using the SDK, they will all receive this callback. TheZello.showMicrophonePermissionDialog()
method should likely only be on one of these apps (the one in the foreground). -
onBluetoothAccessoryStateChanged
void onBluetoothAccessoryStateChanged(@NonNull BluetoothAccessoryType type, @NonNull BluetoothAccessoryState state, @Nullable String name, @Nullable String description) Called when a Bluetooth accessory connection state changes.
- Parameters:
type
- Type of the device.state
- New state of the device.name
- Name of the device.description
- A description of the event that can be shown to the user.- See Also:
-
onForegroundServiceStartFailed
Called when an attempt to start the Zello foreground service fails.
This method is invoked on the UI thread.
It is the responsibility of the app using the SDK to determine if and how to handle this error. The most likely cause is that the app connecting to Zello was not displaying any UI at the time when the foreground service was started. In this case, the implementing app may call
Zello.unconfigure()
followed byZello.configure(Context)
(or one of its overloads) once its UI is in the foreground to attempt to start the foreground service again.In Android 14 and above, requirements for foreground services have become stricter. For the most up-to-date information, please refer to the Android documentation.
- Parameters:
t
- The exception that caused the failure if available.
-