Using the Miniview with the Android SDK
This document is the tutorial for enabling the miniview feature on Android. This feature was first made available in version 3.0.2.
- Ensure that you return
true
for the new HLClientDelegate methodisMinimizeCallEnabled()
- remember to call
HLClient.setHLClientDelegate(your_delegate)
-
Create a View to display the call information:
-
observe LiveData from HLClient:
// Observer miniview data
HLClient.INSTANCE.getMinimizedCall().observe(getViewLifecycleOwner(), new Observer<OngoingCallInfo>() {
public void onChanged(OngoingCallInfo ongoingCallInfo) {
if (ongoingCallInfo != null) {
ongoingCallMiniView.setCallInfo(ongoingCallInfo.getMiniView(), ongoingCallInfo.getCallTitle());
} else {
ongoingCallMiniView.setCallInfo(null, null);
}
}
});
OngoingCallInfo
is a simple data class with 2 properties:
- miniView: View
- callTitle: String The miniView is the shared view of the call. The sdk will handle updating the view. You can put it whereever you want. The callTitle gives some indication about who is in the call. This might say “Guest”, “Active session with …”, or “Waiting for [pariticipant] to join”.

- Tie functionality back to the HLClient. You have the ability to
endActiveCall(<FragmentActivity>)
andreturnToActiveCall()
.endActiveCall
will remove yourself from the call.returnToActiveCall
will maximize the call Activity again.
ongoingCallMiniView.setOngoingCallListener(new OngoingCallListener() {
public void onMaximizeCall() {
HLClient.INSTANCE.returnToActiveCall();
}
public void onEndCall() {
HLClient.INSTANCE.endActiveCall(getActivity());
}
});
- If you are extending
InCallService
, you must callsuper
ononCallEnded
.
/**
* Called when a call has ended.
*
* @param call The call that ended.
* @param reason The reason the call ended.
*/
@Override
public void onCallEnded(HLCall call, String reason) {
super.onCallEnded(call, reason);
}