---
title: "AssetLibrary"
description: "AssetLibrary"
url: "https://www.contentstack.com/docs/developers/sdks/content-delivery-sdk/android/reference/assetlibrary"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-20"
---

# AssetLibrary

## AssetLibrary

In Contentstack, any files (images, videos, PDFs, audio files, and so on) that you upload get stored in your repository for future use. This repository of uploaded files is called Assets.

## sort

The sort method sorts the asset library based on order criteria.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.sort(keyOrderBy, ORDERBY.ASCENDING);
```

the key order by

the orderby can be applied using ORDERBY enums

## includeCount

The includeCount method includes the total count of assets in the asset library response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.includeCount();
```

## includeRelativeUrl

The includeRelativeUrl method includes the relative URLs of assets in the asset library response.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.includeRelativeUrl();
```

## includeMetadata

The includeMetadata method includes the asset library metadata along with the response body.

```
Stack stack = Contentstack.stack(context, "apiKey", "deliveryToken", environment_name);
AssetLibrary assets = stack.assetLibrary();
assets.includeMetadata();
```

## setHeader

The setHeader method adds a header to the request using the specified key and value.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.setHeader(key, value);
```

The key you want to remove from the header

Value of the header against the key

## removeHeader

The removeHeader method removes a header associated with the specified key.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.removeHeader(key);
```

The key you want to remove from the header

## includeFallback

The includeFallback method includes the fallback language content in the asset response when the specified locale content is unavailable.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.includeFallback()
```

## getCount

The getCount method returns the total number of assets available in the stack.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.getCount()
```

## fetchAll

The `fetchAll` method retrieves all the assets available in the stack without applying any filters.

```
import com.contentstack.sdk.*;

Stack stack = Contentstack.stack(context, apiKey, deliveryToken, environment);
AssetLibrary assets = stack.assetLibrary()
assets.fetchAll(new FetchAssetsCallback({

});
```

The callback of type FetchAssetsCallback

## where

The where method retrieves assets from the stack by applying filter conditions on any field UID associated with the assets.

```
Example:
   import com.contentstack.sdk.*;
   Stack stack = Contentstack.stack(apiKey, deliveryToken, environment);
   AssetLibrary assets = stack.assetLibrary().where("field_name","value");
   assets.fetchAll(new FetchAssetsCallback(){
    @Override
    public void onCompletion(ResponseType responseType,List<Asset> assets,Error 
    error)
{ 
  System.out.println(assets);
 }});
```

Enter the field UID of the asset

Enter the value

## AssetLibrary | Android Delivery SDK | Contentstack

AssetLibrary retrieves the media files uploaded to your Contentstack repository through the Android Delivery SDK, fetching collections of assets.