Add the SDK
Method A: Maven (recommended)
In the projectbuild.gradle / settings.gradle repositories:
build.gradle:
gradle/libs.versions.toml):
Method B: Local AAR
Download the SDK from Download, copyfacebetter.aar into libs/, then:
Permissions
AndroidManifest.xml:
Request
CAMERA at runtime on API 23+.
Imports
Logging
Logging is off by default. Enable it beforenew BeautyEffectEngine(...).
Create the engine
Credentials: Subscription. Auth details: Auth & License. IflicenseToken is non-empty, it is used (license token / {token} JSON / offline .lic). Otherwise appId + appKey call /facebetter/v2/auth.
null; it throws if config is invalid. Watch EngineEventCode.INITIALIZATION_COMPLETE / INITIALIZATION_FAILED on callbacks for async init.
Beauty
Intensity[0.0, 1.0]. 0 disables the effect. Check ErrorCode.SUCCESS (0).
Reshape
Range[-1.0, 1.0]. 0 is off.
FACE_THIN … BROW_THICKNESS) and positive / negative directions: Parameter enums.
Body reshape
Range[0.0, 1.0]. 0 is off. Register resource_body.fbd with addResourcePack first (not in the AAR). See Parameter enums and Optional resource packs.
Makeup
Set intensity, then style and/or color.Virtual background and chroma key
Blur (0 clears), still image, or chroma-key mask + fill.
clearChromaKey() restores portrait segmentation and does not remove the current blur/image fill.
Filters and stickers
Load a.fbd from a file path or assets. No register step.
resource_3d.fbd pack (not in the AAR). See Optional resource packs. Register it from your app assets, then apply a 3D sticker .fbd:
processImage.
Callbacks and stats
Process frames
SetImageFrame.type to FrameType.IMAGE (still) or FrameType.VIDEO (camera / live). processImage takes only the frame — no extra mode argument.
Bitmap:
getData() / planar accessors, or convert:
Camera pipeline
Typical Camera2YUV_420_888 → engine → display:
External texture (OpenGL ES)
Use this when you already render with OpenGL ES and want to avoid CPU round-trips.GL_TEXTURE_2D:
- Input texture:
GL_TEXTURE_2D, typically RGBA;strideis usuallywidth * 4 - Lazy-create the engine in the first GL callback so the context is current
- Output texture is owned by the SDK; do not
glDeleteTexturesit. Release theImageFrame - If the GL context is lost,
release()the engine and create it again on the new context - Use
FrameType.VIDEOfor live GL pipelines - For TRTC / Agora / LiveKit and similar SDKs: Third-party Integration

