Skip to main content

Banuba SDK Android


Banuba SDK delivery includes the following parts: banuba_sdk.aar and banuba_effect_player.aar.

banuba_effect_player.aar provides a relatively low-level cross-platform API described in the API reference.

banuba_sdk.aar is built on top of banuba_effect_player.aar. This library provides the Android-specific functionality.

banuba_effect_player.aar provided in a compiled form and banuba_sdk.aar in sources are available for your reference and fine-tuning.

The entry point to banuba_sdk.aar library is BanubaSdkManager class. This class provides the following functionality:

  • Configure rendering mode โ€” setDrawSize, setAutoFaceOrientation, setFaceOrientation.
  • Setup the watermark โ€” setWatermarkInfo.
  • Manage camera โ€” openCamera, closeCamera, setCameraFacing, setCameraZoom, notifyGotCameraPermissions.
  • Open GL context management โ€” releaseSurface, attachSurface, onSurfaceCreated, onSurfaceChanged, onSurfaceChanged, onSurfaceDestroyed.
  • Take a screenshot or image with the effect using the camera โ€” takePhoto, processCameraPhoto.
  • Apply the effect to an external image (e.g. from disk) โ€” processImage.
  • Record a video with the effect โ€”startVideoRecording, stopVideoRecording.
  • Continuous photo rendering (i.e. the dynamic effect applied to the frozen image) โ€” startEditingImage, stopEditingImage, takeEditedImage
  • Send frames to other destinations (e.g. via WebRTC) โ€” startForwardingFrames, stopForwardingFrames.

banuba_sdk contains the following packages:

  • โ€” the functionality related to the camera capture. See Camera2 and CameraThread.
  • internal.encoding โ€” audio and video capture and recording.
  • โ€” various Open GL ES utils.
  • โ€” screenshot capture.
  • internal.renderer โ€” rendering thread. See RenderThread.

The Effect component makes up an essential part of the SDK usage. It's represented as a folder with scripts and resources. Please, refer to Android demo app section for more details about effects.

Binaries size#

We include native debug symbols in our .aar archives, so you may find that banuba_effect_player.aar is too big (about 100 MB). These symbols will help us to get clear crash logs. Nevertheless, Android Studio will silently strip them from release apps, and no extra actions are required.

Still have any questions about FaceAR SDK for Android?

Visit our FAQ or contact our support.

Last updated on