Direct answer
ML Kit Translation has two related but distinct lifecycles. A Translator is a client object configured for a source and target language; the translation guide says to call downloadModelIfNeeded with DownloadConditions and wait for completion before calling translate. Separately, RemoteModelManager can enumerate downloaded TranslateRemoteModel objects, check whether a specified model is downloaded, and delete a specified remote model. Treat a successful download task, the model registry, and a successful translation request as different observations: none of the first two proves the output met a task rubric. The model documentation describes translation assets as language-specific and models as downloaded on demand when required. TranslateRemoteModel represents a model associated with a language, and the official reference says English is built in and must not be treated as a downloadable or deletable model. Do not infer that every configured language pair maps to two separate files or that one registry row alone proves a direction works. Inspect the actual registry and then translate a fresh sample using the exact TranslatorOptions. Client cleanup is not the model-management API. ML Kit instructs apps to call Translator.close when that Translator object is no longer used; remote model removal is a separate RemoteModelManager.deleteDownloadedModel operation. Do not use close as evidence that a language model was deleted, and do not delete a model merely because a screen or client closes. Conversely, if storage cleanup requires removing a model, perform the documented model deletion deliberately and recheck registry state. Avoid deleting English, which the TranslateRemoteModel reference identifies as built-in. A disciplined workflow records source and target language, TranslatorOptions, DownloadConditions, the result or exception from downloadModelIfNeeded, and the RemoteModelManager registry before and after. Then disable ordinary networking and issue a new, non-cached translation task to test the prepared workflow. A model appearing in the registry does not establish language quality, pair support, or offline task success. If a model is deleted, test what the next translation attempt does under the chosen network condition; do not promise automatic re-download or a particular failure message without observing it. The documented model APIs expose operations and language-associated model objects, not a public private-file path or a cryptographic digest interface. Do not write cleanup code that reaches into ML Kit's private storage or describe its assets as hash-verified from these APIs. ARCH-01 defines where inference executes; PRIVACY-01 cautions that local inference does not prove the application makes no other network requests. Model setup downloads, app telemetry, and the translation request are separate data-flow events and should be tested and disclosed separately. This guide covers ML Kit Translation Android, not Cove's custom downloader or LiteRT-LM integration. Record public client and model operations, test a fresh offline task, and make no universal size, language, quality, or compatibility claim.
A Translator screen closes but its language asset remains
An Android team builds a text translation screen with ML Kit Translation. A Fragment creates a Translator for one language pair, prepares models on Wi-Fi, translates a new sentence, and closes the client when the screen ends. A storage review asks whether the downloaded language model was also removed and whether the same offline task will work when the screen opens again.
Decision
Track Translator client lifetime and SDK-managed model state independently. Inspect the downloaded-model registry, use the documented delete operation only for a model intentionally being removed, and run a fresh translation after reopening under the intended network condition.
Expected outcome
The team can report client closure, model registry state, and translation-task outcome as separate facts. It does not infer model deletion from close, or offline support from a registry entry.
Evidence to collect
The claim becomes reviewable only when the following evidence is attached to the same artifact and test run:
- Resolved Translation API and language configuration
- Download and model-registry observations
- Client-close, model-delete and offline-task results
A completed byte stream is not enough. Final placement, integrity, runtime load, and recovery must also pass.
Implementation workflow
- Pin the library and task configuration. Record the exact ML Kit Translation dependency, Android build, source and target language, and TranslatorOptions. Use official documentation for that API version; do not transplant behavior from LiteRT-LM or another Google model service.
- Prepare the requested translation resources. Create the Translator and call downloadModelIfNeeded with the selected DownloadConditions. Record whether the task completed or failed before allowing translation; a dismissed progress UI or earlier session is not a readiness check.
- Inspect the SDK model registry. Use RemoteModelManager.getDownloadedModels for TranslateRemoteModel and isModelDownloaded for a specific remote model when needed. Record language-associated objects, noting that English is built in and must not be enumerated as a downloadable asset.
- Run a new translation task. With the intended network state established, submit a fresh synthetic string using the exact TranslatorOptions. Record translation success, exception, and task-level acceptance separately from download-task completion and registry contents.
- Close the client and verify model state. Call Translator.close when the client is no longer used, then query the model registry again. Do not treat client closure as model deletion; verify the SDK-managed model remains or changes according to observed API state.
- Delete only through the model manager. When removal is an explicit storage policy, call RemoteModelManager.deleteDownloadedModel for the intended non-English model, observe completion, and query registry state again. Then test a fresh translation with network disabled and enabled; do not assume re-download behavior or a fixed repair prompt.
Keep each transition observable. A failure should identify the stage, artifact, runtime, and recovery action without logging private user content.
Acceptance criteria
- The record names the ML Kit Translation dependency, TranslatorOptions, DownloadConditions, and the exact task rather than a generic language-pair label.
- Download task completion, RemoteModelManager registry membership, Translator.close, explicit model deletion, and fresh translation success are reported as separate states.
- English is treated as built-in per the official TranslateRemoteModel reference; the test does not infer an asset count from source and target labels or promise all pairs are supported.
- No private model path, hash-verification capability, universal size, language compatibility, translation quality, or Cove ML Kit integration is claimed without separate evidence.
Decision table
| Dimension | Choice or evidence | How to interpret it |
|---|---|---|
| Translator client | Create for selected TranslatorOptions and close when no longer used | Manages client/session resources; do not equate close with deleting language model files. |
| Remote model registry | Query TranslateRemoteModel objects and a specific model state | Shows SDK-reported downloaded-model state; it does not prove a translation task or quality. |
| Explicit model deletion | Call RemoteModelManager.deleteDownloadedModel for the intended model | A model-management action distinct from client lifecycle; verify completion and recheck the registry. |
| Fresh offline translation | Submit new text after setup with connectivity disabled | Tests the configured workflow; prior model state or cached translation alone is insufficient. |
Failure patterns to prevent
- Treating client close as model deletion
- Inferring task success or file identity from model registry state
Also prevent silent fallback, unpinned artifacts, missing cancellation, and conclusions that combine unlike configurations. Store unsuccessful runs alongside successful ones.
Minimum reproducibility record
| Layer | Record |
|---|---|
| Device | Manufacturer, model, chipset, RAM class, operating-system build |
| Software | Application version and git commit |
| Model | Family, variant, revision, format, file length, hash, quantization |
| Runtime | Name, revision, requested backend, observed backend evidence |
| Workload | Fixture revision, input hash, prompt hash, output policy |
| Outcome | Completed, failed, cancelled, fallback, and privacy-safe diagnostics |
Release checklist
- ☐ The primary query is answered without an unsupported number.
- ☐ Every artifact and runtime is pinned.
- ☐ The representative task and failure policy are explicit.
- ☐ Lifecycle, cancellation, cleanup, and fallback are tested.
- ☐ User-content and network boundaries are documented.
- ☐ Result wording applies only to the recorded configuration.
- ☐ The page links to raw method or evidence when results are added.
Sources and related evidence
- On-device AI architecture overview
- Google ML Kit: Translate text with ML Kit on Android
- Google ML Kit API reference: RemoteModelManager
- Google ML Kit API reference: TranslateRemoteModel
Chinese deployment and troubleshooting content is organized in the .奇连 AI 端侧专题.
Frequently asked questions
Does Translator.close remove the downloaded language model?
The documentation presents close as cleanup for a Translator object and exposes model deletion separately through RemoteModelManager.deleteDownloadedModel. Treat them as distinct operations and check registry state instead of inferring deletion.
Does every source-target language pair require two downloaded files?
Do not infer a file count from the pair. The API exposes language-associated TranslateRemoteModel objects, and its reference says English is built in. Inspect the SDK-reported registry and test the configured direction.
Does a downloaded model prove offline translation works?
No. Registry state is one observation. Prepare the configured Translator, disconnect, submit new text, and record translation success or failure separately; do not treat an old cached result as a fresh task.
Can I hash or inspect ML Kit's private model file?
The cited public model-management APIs expose downloaded state and delete operations, not a model-file path or digest contract. Avoid accessing private SDK storage and do not claim cryptographic verification from registry status.