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

Download a Cloud Filter in Android

Fetch the Android cloud catalog away from the UI thread, download one identifier, and apply its returned local path.

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

Prerequisites

Request the catalog

NosmaiCloud.fetch can perform network and disk work. Run it away from the main thread:

NosmaiCloud.FilterQuery query = new NosmaiCloud.FilterQuery();
query.filterType = "effects";
query.page = 1;
query.limit = 20;

cloudExecutor.execute(() -> {
    boolean success = NosmaiCloud.fetch(query);
    List<NosmaiCloud.Item> items = success
        ? NosmaiCloud.list()
        : Collections.emptyList();
    mainHandler.post(() -> render(items));
});

Download and apply

NosmaiCloud.download(item.id, (id, success, localPath, error) -> {
    if (success && localPath != null && !localPath.isEmpty()) {
        NosmaiEffects.applyEffect(localPath, effectCallback);
    }
});

Use NosmaiCloud.cachedList() for immediate cached UI, and deduplicate repeated taps by identifier.

Handle cache eviction

The SDK cache has no documented permanent TTL. Check cachedList() or the download result at the time of use. If the package is missing after operating- system storage cleanup, download it again and replace the stored local path. Keep the cloud identifier as the durable application reference.

Verify it worked

Reopen the sheet and apply the cached item without another network download.

Common errors

SymptomFix
Camera UI freezesMove catalog fetch away from the main thread
Old response replaces a new tabTrack request ownership and ignore stale completion
Repeated taps create workKeep a thread-safe in-flight identifier set

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