> For the complete documentation index, see [llms.txt](https://docs.caf.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.caf.io/caf-sdk/android/standalone-modules/document-detector/reduce-sdks-size.md).

# Reduce SDKs size

## **Publication form** <a href="#ecdzhh2htf7o" id="ecdzhh2htf7o"></a>

Currently, Android provides two formats for publishing applications in the Play Store: APK and [Android App Bundle](https://developer.android.com/platform/technology/app-bundle). If you publish using AAB, the size of the SDK will be smaller because Dynamic Delivery technology will make available to your end user only the code directed to the device settings.

**Important:** if you use [DocumentDetector](https://github.com/combateafraude/public-docs/blob/docs-sdks/android/document-detector/getting-started/document-detector/README.md), it is of utmost importance to publish your app via AAB, because the biggest weight of the SDK is caused by the library responsible for document recognition, where each ABI configuration is about 1 MB.

## **Transitive dependencies** <a href="#id-93ifrhw6qb4q" id="id-93ifrhw6qb4q"></a>

Our SDKs use some internal dependencies, such as [CameraX](https://developer.android.com/training/camerax). If your app already uses one of our transitive dependencies, the SDK will not need to download again, reducing the final size.

## **Optimizing SDK size (only for DocumentDetector)**

If you want to reduce the **`DocumentDetector`** SDK size, you can reduce the number of architectures that TensorFlow will be compiled on, but only do this if you are sure that your audience only uses devices with the chosen architectures, otherwise you may get errors when opening the SDK. To do this, add the following setting to your app-level **`build.gradle`**:

```groovy
android {
    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a'
        }
    }
}
```

According to [TensorFlow](https://www.tensorflow.org/lite/guide/android) documentation, this setting covers most modern devices.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.caf.io/caf-sdk/android/standalone-modules/document-detector/reduce-sdks-size.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
