> 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

This page presents some elements that will reduce the size of the SDKs.

## **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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
