Skip to content
This repository was archived by the owner on Jan 31, 2022. It is now read-only.

Commit ba02944

Browse files
author
Clément Le Provost
committed
Update documentation
Android context now required during initialization.
1 parent f33e197 commit ba02944

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

doc/offline-mode.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,12 @@ Offline features are brought by Algolia's **Offline SDK**, which is actually com
5454
3. When initializing your client, instantiate an `OfflineClient` instead of a `Client`. This requires you to specify an additional argument: the directory in which local indices will be stored:
5555
5656
```java
57-
client = new OfflineClient("YOUR_APP_ID", "YOUR_API_KEY", new File(context.getFilesDir(), "algolia"));
57+
client = new OfflineClient(context, "YOUR_APP_ID", "YOUR_API_KEY");
5858
```
5959
60+
... where `context` is a valid Android `Context`.
61+
62+
By default, the client will store data for local indices in an `algolia` subdirectory of the application's files directory. Alternatively, you may specify it during the instantiation of the client.
6063
*Warning: although using the cache directory may be tempting, we advise you against doing so. There is no guarantee that all files will be deleted together, and a partial delete could leave an index in an inconsistent state.*
6164
6265
4. **Enable offline mode**:

0 commit comments

Comments
 (0)