Skip to content

Commit 0eb414b

Browse files
committed
docs: expand Android SDK overview with detailed features and benefits
1 parent 62abe32 commit 0eb414b

File tree

9 files changed

+449
-52
lines changed

9 files changed

+449
-52
lines changed

android-sdk/about.mdx

Lines changed: 132 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -5,47 +5,150 @@ slug: /
55
description: Overview of Tolgee Android SDK with Over‑the‑Air (OTA) localization updates and how to get started.
66
---
77

8-
> NOTE:
9-
> For managing static translations in your repository, consider using the [Tolgee CLI](/tolgee-cli/installation).
8+
import SystemCard from '@site/src/component/SystemCard';
9+
import Tolgee from '@site/src/component/Tolgee';
1010

11-
Tolgee Android SDK lets you localize Android apps with dynamic content delivery, Over‑the‑Air (OTA) translation updates, reactive locale changes, and seamless integration with Views and Jetpack Compose.
11+
# Tolgee Android SDK
1212

13-
## Why use it
13+
:::info
14+
For managing static translations in your repository, consider using the [Tolgee CLI](/tolgee-cli/installation).
15+
:::
1416

15-
- __Avoid releases for copy changes__: Ship translation fixes and new languages without a new app build.
16-
- __Faster iteration__: Product/localization teams can push improvements instantly and validate in production.
17-
- __Consistent UX__: UI updates reactively on locale change; fewer stale or mismatched strings.
18-
- __Resilient by default__: Works offline with caching and resource fallbacks; fewer blank strings.
17+
## Overview
1918

20-
## What you can do
19+
Tolgee Android SDK lets you localize Android apps with dynamic content delivery, and lets you provide translations dynamically without needing to publish new app versions.
2120

22-
- __Over‑the‑Air (OTA) updates__: Deliver translations via CDN (Cloud or self‑host) with caching.
23-
- __Views and Compose support__: `stringResource`/`pluralStringResource`, parameters, and reactive updates.
24-
- __Runtime locale API__: Switch locales and react to `Tolgee.changeFlow`.
25-
- __Fallbacks and preloading__: Android resources fallback; preload critical namespaces/locales.
26-
- __Hosting options__: Tolgee Cloud CDN or your own CDN.
21+
**Supports Over‑the‑Air (OTA)** translation updates, seamless integration with multiple systems, Android Views, Jetpack Compose and static translations.
22+
23+
## Why should you try it?
24+
25+
Tolgee platform lets you ship translations and new languages faster and easier without a new app build.
26+
27+
The platform works offline with caching, fallbacks to Android resources when needed, and preloading critical namespaces for a smooth user experience. Additionally, Tolgee keeps UX consistent by updating the UI automatically in response to translation or locale changes. These features result in fewer untranslated or mismatched strings of text.
28+
29+
## Features
30+
31+
### Over‑the‑Air (OTA) updates
32+
33+
Delivers translations via CDN (Cloud or self‑hosting) with caching and offline support.
34+
35+
### Change the app's language at runtime (Runtime locale API)
36+
37+
Use `tolgee.changeFlow` to monitor locale changes and update your UI accordingly.
38+
39+
### Works offline with fallbacks and preloading
40+
41+
Provides fallbacks to Android resources and preloading of critical namespaces.
42+
43+
### Support for Android Views, Jetpack Compose and static translations with CLI
44+
45+
Support for both coding functions `stringResource`, `pluralStringResource` and reactive updates.
46+
47+
### Hosting options
48+
49+
You have multiple hosting options: CDN (Cloud or self‑hosting).
2750

2851
## Demo apps
2952

30-
- __Android Views demo__: https://github.com/tolgee/tolgee-mobile-kotlin-sdk/tree/master/demo/exampleandroid
31-
- __Jetpack Compose demo__: https://github.com/tolgee/tolgee-mobile-kotlin-sdk/tree/master/demo/examplejetpack
53+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-6">
54+
<SystemCard
55+
title="Android Views Demo"
56+
emoji="📱"
57+
description="Complete example implementation using Android Views"
58+
links={[
59+
{ href: "https://github.com/tolgee/tolgee-mobile-kotlin-sdk/tree/master/demo/exampleandroid", label: "View Demo", color: "blue" }
60+
]}
61+
/>
62+
63+
<SystemCard
64+
title="Jetpack Compose Demo"
65+
emoji="🚀"
66+
description="Complete example implementation using Jetpack Compose"
67+
links={[
68+
{ href: "https://github.com/tolgee/tolgee-mobile-kotlin-sdk/tree/master/demo/examplejetpack", label: "View Demo", color: "green" }
69+
]}
70+
/>
71+
</div>
3272

3373
## Compatibility
3474

35-
> NOTE:
36-
> Build configuration examples use Kotlin DSL (`build.gradle.kts`). Groovy DSL may work but is not officially supported/tested.
75+
:::note
76+
To build configuration examples use Kotlin DSL (build.gradle.kts). Groovy DSL may work but is not officially supported/tested.
77+
:::
78+
79+
## Get Started
80+
81+
Ready to integrate Tolgee into your Android project? Follow this step-by-step guide to add dynamic translations to your app.
82+
83+
### Setup Overview
84+
85+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-6">
86+
<SystemCard
87+
title="Installation"
88+
emoji="📦"
89+
description="Set up dependencies and network security configuration"
90+
links={[
91+
{ href: "./installation", label: "Installation Guide", color: "blue" }
92+
]}
93+
/>
94+
95+
<SystemCard
96+
title="Modules Overview"
97+
emoji="🔧"
98+
description="Choose between Core and Compose modules for your project"
99+
links={[
100+
{ href: "./modules", label: "Modules Guide", color: "green" }
101+
]}
102+
/>
103+
</div>
104+
105+
### Choose Your Implementation
106+
107+
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4 my-6">
108+
<SystemCard
109+
title="Jetpack Compose"
110+
emoji="🚀"
111+
description="Modern declarative UI with reactive translations"
112+
links={[
113+
{ href: "/android-sdk/jetpack/overview", label: "Overview", color: "blue" },
114+
{ href: "/android-sdk/jetpack/installation", label: "Installation", color: "green" },
115+
{ href: "/android-sdk/jetpack/usage", label: "Usage", color: "orange" }
116+
]}
117+
/>
118+
119+
<SystemCard
120+
title="Android Views"
121+
emoji="📱"
122+
description="Traditional Android UI with dynamic translations"
123+
links={[
124+
{ href: "./usage", label: "Usage Guide", color: "purple" }
125+
]}
126+
/>
127+
128+
<SystemCard
129+
title="CLI Integration"
130+
emoji=""
131+
description="Generate and manage <strong>static translations</strong>"
132+
links={[
133+
{ href: "/tolgee-cli/installation", label: "Tolgee CLI", color: "cyan" }
134+
]}
135+
/>
136+
</div>
37137

38-
## Get started
138+
### Production Deployment
39139

40-
- __Installation__: Set up dependencies and network security — [Installation](./installation.mdx)
41-
- __Modules overview__: Choose between Core and Compose — [Modules overview](./modules.mdx)
42-
- __Jetpack Compose__: Install, use, and troubleshoot — [Installation](/android-sdk/jetpack/installation), [Usage](/android-sdk/jetpack/usage), [Troubleshooting](/android-sdk/jetpack/troubleshooting)
43-
- __Usage with Views (non‑Compose)__: Simple keys, parameters, plurals, preloading, reactive flows — [Usage](./usage.mdx)
44-
- __Production guide__: Over‑the‑Air (OTA) updates, caching, formatting, testing — [Production guide](./production.mdx)
45-
- __Troubleshooting__: Common issues and diagnostics — [Troubleshooting](./troubleshooting.mdx)
140+
<div className="grid grid-cols-1 gap-4 my-6">
141+
<SystemCard
142+
title="Production Guide"
143+
emoji="🚀"
144+
description="Over‑the‑Air (OTA) updates, caching, formatting, and testing for production apps"
145+
links={[
146+
{ href: "./production", label: "Production Setup", color: "blue" }
147+
]}
148+
/>
149+
</div>
46150

47-
## Next steps
151+
### Need Help?
48152

49-
- Install and configure the SDK: [Installation](./installation.mdx)
50-
- Connect your app to the Tolgee Platform and manage translations collaboratively: [Platform docs](../platform/)
51-
- Generate or manage static strings with CLI: [Tolgee CLI](/tolgee-cli/installation)
153+
- **Manage translations collaboratively**: Connect your app to the Tolgee Platform — [Platform docs](../platform/)
154+
- **Troubleshooting**: Common issues and diagnostics — [Troubleshooting](./troubleshooting.mdx)

android-sdk/get-started.mdx

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
id: get-started
3+
title: Get Started
4+
slug: /get-started
5+
description: Quick start guide for integrating Tolgee Android SDK into your project
6+
---
7+
8+
import SystemCard from '@site/src/component/SystemCard';
9+
10+
# Get Started with Tolgee Android SDK
11+
12+
Follow these steps to integrate Tolgee into your Android project and start localizing your app with dynamic translations.
13+
14+
## Quick Setup Overview
15+
16+
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 my-6">
17+
<SystemCard
18+
title="Installation"
19+
emoji="📦"
20+
description="Set up dependencies and network security configuration"
21+
links={[
22+
{ href: "./installation", label: "Installation Guide", color: "blue" }
23+
]}
24+
/>
25+
26+
<SystemCard
27+
title="Modules Overview"
28+
emoji="🔧"
29+
description="Choose between Core and Compose modules for your project"
30+
links={[
31+
{ href: "./modules", label: "Modules Guide", color: "green" }
32+
]}
33+
/>
34+
</div>
35+
36+
## Integration Path
37+
38+
1. **[Installation](./installation)** - Add Tolgee SDK to your project
39+
2. **[Modules Overview](./modules)** - Understand Core vs Compose modules
40+
3. **Choose your implementation:**
41+
- **[Android Views](./usage)** - For traditional Android UI
42+
- **[Jetpack Compose](./jetpack/installation)** - For modern Compose UI
43+
4. **[Production Setup](./production)** - Configure for production deployment
44+
45+
## What You'll Achieve
46+
47+
After completing the setup, your app will have:
48+
49+
-**Dynamic translations** delivered via CDN
50+
-**Offline support** with local caching
51+
-**Runtime language switching** without app restart
52+
-**Fallback support** to bundled Android resources
53+
-**Over-the-Air updates** for translations without app republishing
54+
55+
## Need Help?
56+
57+
- Check our **[Troubleshooting Guide](./troubleshooting)** for common issues
58+
- Explore **[Demo Apps](./about#demo-apps)** for complete examples
59+
- Review **[Production Guide](./production)** for deployment best practices

android-sdk/installation.mdx

Lines changed: 80 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,78 @@ title: Installation
44
description: How to install Tolgee Android SDK in your Android project
55
---
66

7-
> **NOTE:**
8-
> For managing static translations, we recommend using [Tolgee CLI](https://github.com/tolgee/tolgee-cli).
7+
:::info
8+
For managing static translations, we recommend using [Tolgee CLI](https://github.com/tolgee/tolgee-cli).
9+
:::
910

1011
## Requirements
1112

12-
- **Android API Level**: 21+ (Android 5.0+)
13+
<div className="grid grid-cols-1 gap-4 my-6">
14+
<div className="border border-gray-200 dark:border-gray-700 rounded-lg p-4 bg-blue-50 dark:bg-blue-900/20">
15+
<div className="flex items-center gap-3">
16+
<span className="text-2xl">📱</span>
17+
<div>
18+
<h4 className="text-lg font-semibold mb-1 text-blue-800 dark:text-blue-200">Android API Level</h4>
19+
<p className="text-sm text-blue-700 dark:text-blue-300 mb-0">Minimum <a href="https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels" className="text-blue-600 dark:text-blue-400 hover:underline">API Level 21+</a> (Android 5.0 and above)</p>
20+
</div>
21+
</div>
22+
</div>
23+
</div>
1324

1425
## Quickstart (Views)
1526

27+
:::info
28+
Using **Version Catalog** is recommended to keep your versions aligned, especially in bigger projects. This provides **readability, centralization, and consistency**.
29+
:::
30+
1631
1. Add dependency (Core):
1732

18-
Using Version Catalog is recommended to keep your versions aligned.
33+
In `gradle/libs.versions.toml` <u>add an alias for Tolgee library</u>.
1934

2035
```toml
2136
# gradle/libs.versions.toml
2237
[libraries]
2338
tolgee = { group = "io.tolgee.mobile-kotlin-sdk", name = "core", version.ref = "tolgee" }
2439
```
2540

41+
Then, in `build.gradle.kts`, <u>use the created alias</u>.
42+
2643
```kotlin
2744
// build.gradle.kts (module)
2845
dependencies {
2946
implementation(libs.tolgee)
3047
}
3148
```
3249

33-
If you use Jetpack Compose, see the Compose variant: [Jetpack Installation](/android-sdk/jetpack/installation)
34-
35-
2. (If needed) Ensure repositories include Maven Central:
50+
For **smaller projects** you can also add dependency directly (the old way).
3651

3752
```kotlin
38-
// settings.gradle.kts or build.gradle.kts
39-
pluginManagement { repositories { gradlePluginPortal(); google(); mavenCentral() } }
40-
dependencyResolutionManagement { repositories { google(); mavenCentral() } }
53+
// build.gradle.kts
54+
dependencies {
55+
implementation("io.tolgee.mobile-kotlin-sdk:core:tolgee")
56+
}
4157
```
4258

59+
:::note
60+
If you use **Jetpack Compose**, see the Compose variant: [Jetpack Installation](/android-sdk/jetpack/installation)
61+
:::
62+
63+
2. (If needed) Ensure repositories include Maven Central:
64+
65+
```kotlin
66+
// settings.gradle.kts or build.gradle.kts
67+
pluginManagement { repositories { gradlePluginPortal(); google(); mavenCentral() } }
68+
dependencyResolutionManagement { repositories { google(); mavenCentral() } }
69+
```
70+
To use the library, **you need to have proper repositories configured** in your project.
71+
Otherwise an error like:
72+
73+
```text
74+
Could not find io.tolgee.mobile-kotlin-sdk:core
75+
```
76+
might pop up.
77+
Make sure **Maven Central** is set up properly so the dependency can be resolved.
78+
4379
3. Allow CDN networking (required when using Tolgee Cloud CDN):
4480

4581
Create a network security config file `network_security.xml` in your `res/xml` folder:
@@ -62,8 +98,9 @@ Add network security config to your `AndroidManifest.xml`:
6298
</application>
6399
```
64100

65-
> NOTE:
66-
> Allowing `tolgee.io` and `tolg.ee` domains is required when using Tolgee Cloud CDN. If you only access your own self-hosted CDN, include your domain(s) accordingly.
101+
:::note
102+
Allowing `tolgee.io` and `tolg.ee` domains is required when using Tolgee Cloud CDN. If you only access your own self-hosted CDN, include your domain(s) accordingly.
103+
:::
67104

68105
## Initialization and configuration
69106

@@ -83,19 +120,43 @@ class MyApplication : Application() {
83120
}
84121
```
85122

86-
How to get your CDN URL prefix (Content Delivery):
87-
- Open Tolgee Platform → your Project → Developer settings → Content Delivery.
88-
- Copy the full CDN URL prefix. You can use different prefixes per environment (dev/staging/prod).
89-
- Optional: Verify connectivity locally:
123+
When your app boots up, Tolgee is globally initialized. The translations are downloaded from CDN and cached locally. Other parts of your app (such as activities and fragments) can now use Tolgee without additional configuration.
124+
125+
***Make sure that your app knows where to download translations***:
126+
127+
For your app to download translation files, you need to provide a CDN URL prefix specific to your project. This prefix points to the catalog that contains your app’s translations.
128+
129+
### How to get your CDN URL prefix (Content Delivery):
130+
1. Open Tolgee Platform → your Project → Developer settings → Content Delivery.
131+
2. Copy the full CDN URL prefix.
132+
3. You can use different prefixes per environment (dev/staging/prod).
133+
134+
### Optional: Verify connectivity locally:
90135

91136
```bash
92137
curl -I "https://cdn.tolg.ee/your-cdn-url-prefix/en.json"
93138
```
94139

95-
You should receive a 200 response. If you get 403/404, double‑check the prefix.
140+
You should receive a 200 response.
141+
If you get 403 (Forbidden) or 404 (Not found), double‑check the prefix.
142+
143+
:::tip
144+
Dynamic updates without republishing
145+
:::
146+
147+
To receive fresh translations without needing to publish new app versions, wrap the base context in your Activities.
148+
This way, APIs like getString() will use Tolgee dynamically.
149+
150+
- With wrapped context → fresh translations from the Tolgee CDN will be provided automatically.
151+
152+
- Without wrapped context → only the translations already bundled or previously cached will be available.
153+
154+
See the step-by-step guide in Usage.
155+
156+
:::note
157+
If you have a different integration setup (for example, using tolgee-cli and bundling JSON translation files in assets), the initialization may look different.
158+
:::
96159

97-
> TIP:
98-
> For Activities, wrap the base context so `getString` and similar APIs use Tolgee. See step-by-step in [Usage](./usage.mdx).
99160

100161
## Next steps
101162

0 commit comments

Comments
 (0)