Start a conversation

How do I take a screenshot using Android SDK?

You need to add a button e.g. "Take Screen Frame" and press it when you need to take a screenshot during the video call.
Pressing this button calls the example method below:

    private void forExampleTakeScreenShot(QBConferenceSurfaceView remoteVideoView) {
        if (remoteVideoView != null) {
            remoteVideoView.addFrameListener(new EglRenderer.FrameListener() {
                @Override
                public void onFrame(Bitmap bitmap) {
                    runOnUiThread(() -> {
                        //
                        // there you can do whatever you want to save bitmap or place it into imageView
                        //
                        remoteVideoView.removeFrameListener(this); // <- this is important 
                    });
                }
            },1);
        }
    }

Please note, that after taking a bitmap of the video frame you need to call:
remoteVideoView.removeFrameListener(this);


Feel free to check our official documentation for more information that will help you to integrate QuickBlox services into your applications / projects or contact our Support team by submitting a ticket if you have any other questions

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Nikolay Zolotarov

  2. Posted
  3. Updated

Comments