# 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.

> For AI agents: the complete documentation index is at https://nosmai.com/llms/effects.txt

Product: Nosmai Effects
Group: guide
Source: https://nosmai.com/docs/effects/guides/filters/download-a-cloud-filter/android/

## Prerequisites

- A working [Android quickstart](/docs/effects/quickstart/android/)
- Cloud Filters enabled for the project

## Request the catalog

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

```java
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

```java
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

| Symptom | Fix |
| --- | --- |
| Camera UI freezes | Move catalog fetch away from the main thread |
| Old response replaces a new tab | Track request ownership and ignore stale completion |
| Repeated taps create work | Keep a thread-safe in-flight identifier set |

## Next steps

- [Understand Cloud Filters](/docs/effects/concepts/cloud-filters/)
- [Bundle a filter in Android](/docs/effects/guides/filters/bundle-an-asset-store-filter/android/)

## References

- [Android platform guide](/docs/effects/platforms/android/)
