> 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/builder/messages.md).

# Messages Settings

To use, simply instantiate a **`MessageSettings`** object and use the methods as needed for customization.

| Method                                                          | Description                                                                             | Default Value                                                                 |
| --------------------------------------------------------------- | --------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- |
| `.setPopupDocumentSubtitleMessage(message: Int)`                | Subtitle message in the pop-up showing the document illustration.                       | "Place the document on a desk, center it on the frame, and hold for capture." |
| `.setFitTheDocumentMessage(message: Int)`                       | Message prompting the user to fit the document to the frame.                            | "Fit the document on the frame."                                              |
| `.setHoldItMessage(message: Int)`                               | Message shown during the capture process.                                               | "Keep it steady."                                                             |
| `.setVerifyingQualityMessage(message: Int)`                     | Message displayed during the quality verification request.                              | "Checking document..."                                                        |
| `.setLowQualityDocumentMessage(message: Int)`                   | Message shown when the document capture fails due to low quality.                       | "Couldn't read the information. Please try again."                            |
| `.setUploadingImageMessage(message: Int)`                       | Message shown when saving the captured image to the server.                             | "Uploading image..."                                                          |
| `.setShowOpenDocumentErrorMessage(show: Boolean, message: Int)` | Message shown if an open document is detected.                                          | "Close your document and try again."                                          |
| `.setWaitMessage(show: Boolean, message: Int)`                  | Message displayed when starting the camera.                                             | "Please wait..."                                                              |
| `.setSensorLuminosityMessage(message: Int)`                     | Message shown when the brightness level is too low.                                     | "The area is too dark."                                                       |
| `.setSensorOrientationMessage(message: Int)`                    | Message shown when the orientation threshold is not met.                                | "Point the camera downward."                                                  |
| `.setSensorStabilityMessage(message: Int)`                      | Message shown when the device is not stable enough.                                     | "Hold the device steady."                                                     |
| `.setWrongDocumentTypeMessageResourceId(message: Int)`          | Message shown when the document type is incorrect. Use %1$s for the expected document.  | "This document is not %1$s."                                                  |
| `.setPositiveButtonMessage(message: Int)`                       | Customizes the confirmation button text.                                                | "OK, got it."                                                                 |
| `.setUploadedImageIsTooLargeTitle(message: Int)`                | Title for the upload popup when the file exceeds the max size.                          | "File size exceeded."                                                         |
| `.setUploadedImageIsTooLargeMessage(message: Int)`              | Message for the upload popup when the file exceeds the max size. Use %1$s for max size. | "The file exceeds the max size of %1$d MB. Upload a smaller file."            |
| `.setUploadedImageHasInvalidFormatTitle(message: Int)`          | Title for the upload popup when the file format is invalid.                             | "Invalid format."                                                             |
| `.setUploadedImageNotSupportedFormatMessage(message: Int)`      | Message for unsupported file formats in the upload popup.                               | "Unsupported file format. Use JPG, PNG, or PDF."                              |
| `.setUploadedImageGenericErrorTitle(message: Int)`              | Generic error title for the upload popup.                                               | "Something went wrong."                                                       |
| `.setUploadedImageWrongMessage(message: Int)`                   | Message for an unexpected document in the upload popup.                                 | "This is not the expected document. Upload the correct one."                  |
| `.setUploadedImageLowQualityTitle(message: Int)`                | Title for the upload popup when the image quality is low.                               | "Low quality image."                                                          |
| `.setUploadedImageLowQualityMessage(message: Int)`              | Message for low-quality images in the upload popup.                                     | "The image quality is too low. Upload a better one."                          |
| `.setUploadPopupLoadingMessage(message: Int)`                   | Message shown during file upload in the popup.                                          | "Uploading document..."                                                       |
| `.setPredictorScanDocumentMessage(resId: Int)`                  | Message prompting the user to scan a document.                                          | "Scan a document."                                                            |
| `.setPredictorGetCloserMessage(resId: Int)`                     | Message asking the user to get closer to the document.                                  | "Move closer to the document."                                                |
| `.setPredictorCentralizeMessage(resId: Int)`                    | Message asking the user to center the document.                                         | "Center the document."                                                        |
| `.setPredictorMoveAwayMessage(resId: Int)`                      | Message asking the user to move away from the document.                                 | "Move farther from the document."                                             |
| `.setPredictorAlignDocumentMessage(resId: Int)`                 | Message asking the user to align the document.                                          | "Align the document."                                                         |
| `.setPredictorTurnDocumentMessage(resId: Int)`                  | Message asking the user to rotate the document 90 degrees.                              | "Rotate the document ⤵️."                                                     |
| `.setPredictorCapturedMessage(resId: Int)`                      | Message confirming the document has been captured.                                      | "Document captured."                                                          |
| `.setUnsupportedDocumentMessage(message: Int)`                  | Message for unsupported documents.                                                      | "This document is not supported."                                             |
| `.setDocumentNotFoundMessage(message: Int)`                     | Message when no document is detected.                                                   | "No document found."                                                          |

### Example

```kotlin
val messageSettings = MessageSetings()
    .setFitTheDocumentMessage(R.string.example_resource)
    .setHoldItMessage(R.string.example_resource);
```


---

# 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/builder/messages.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.
