Nosmai  Effects Nosmai  Moderation Nosmai Try-ons coming soon
Docs menu Android
How-to guide

Add an AR face mask in Android

Apply a face-tracked .nosmai mask to a Camera2 preview, wait for the callback, and remove its typed package.

Platform Android SDK version 3.0.4 Updated Aug 22, 2026 Time 5 min

Prerequisites

Obtain the mask

Use a compatible package from the Asset Store flow, either bundled or downloaded through Cloud Filters.

Apply it

NosmaiEffects.applyEffect(maskPath, new NosmaiEffects.EffectCallback() {
    @Override public void onSuccess() {
        // Update selected state after success.
    }

    @Override public void onError(String message) {
        Log.e("Nosmai", message);
    }
});

Remove it

NosmaiEffects.removeEffect(maskInfo);

Use the typed item returned by getFilters or the cloud catalog.

Verify it worked

Test face loss, reacquisition, fast movement, glasses, partial occlusion, both cameras, and device rotation.

Common errors

SymptomFix
Callback reports failurePass a discovered or downloaded path and verify package compatibility
Mask is not selected in UIUpdate selection only from apply success and pipeline state
Frame rate fallsTest the package at 720p and 30 FPS in a Release build

Next steps

References

Was this page helpful?

Your response helps us prioritize documentation improvements.

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved