Skip to content

Commit e700985

Browse files
author
Krzysztof Borowy
committed
docs: next storage + room
1 parent e8fdf05 commit e700985

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

website/docs/advanced/Next.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ Current implementation of persistence layer is created using [SQLiteOpenHelper](
1616
a helper class that manages database creation and migrations. Even if this approach is powerful, the lack of compile time query verification and a big boilerplate of mapping SQLite queries to actual values make this implementation prone to many errors.
1717

1818
This Async Storage feature improves the persistence layer, using modern approaches to access SQLite (using [Room](https://developer.android.com/training/data-storage/room)), to reduce possible anomalies to the minimum.
19-
On top of that, it allows to access Async Storage from the native side, useful in [Brownfield integration.](BrownfieldIntegration.md#android)
19+
On top of that, it allows accessing AsyncStorage from the native side, useful in [Brownfield integration.](BrownfieldIntegration.md#android)
2020

2121
### Migration
2222

2323
This feature requires no migration from the developer perspective - the current database will be recreated (based on the current one), meaning user won't lose any data if you decide to opt in.
24-
There's a small drawback to know - the database "recreation" happens **only once**. Unless you want to disable the feature in the future, there's nothing to worry about.
24+
There's a small drawback to know - the database "recreation" happens **only once**.
2525

2626
#### How it works
2727

@@ -36,15 +36,17 @@ If you decide to disable the feature, your users will be back using old database
3636
When you enable the feature again, the new database is **not** recreated, because it already exists, and no data is copied over.
3737

3838

39-
### Enabling
39+
### Enable
40+
41+
See [Configuration](#configuration) section below to learn more about setting different versions of Kotlin or Room.
4042

4143
1. In your project's `android` directory, locate root `build.gradle` file. Add Kotlin dependency to the `buildscript`:
4244

4345
```diff
4446
buildscript {
4547
ext {
4648
// other extensions
47-
+ kotlinVersion = '1.4.21'
49+
+ kotlinVersion = '1.5.31'
4850
}
4951

5052
dependencies {
@@ -55,26 +57,38 @@ buildscript {
5557

5658
```
5759

58-
2. In the same directory (normally `android`) locate `gradle.properties` file (if does not exists, create one) and add the line:
60+
2. In the same directory (normally `android`) locate `gradle.properties` file (if it does not exist, create one) and add the line:
5961

6062
```groovy
6163
AsyncStorage_useNextStorage=true
6264
```
6365

64-
**How to specifying Kotlin version**
66+
### Configuration
67+
68+
**Kotlin version**
6569

66-
Supported Kotlin versions are `1.4.x`. You can specify which one to use in two ways:
70+
Next storage is tested against Kotlin version `1.5.31`.
71+
You can specify different version, in one of two ways:
6772

68-
- having an `kotlinVersion` extension on the `rootProject` (recommended):
73+
- add `kotlinVersion` extension to the `rootProject`:
6974

7075
```groovy
71-
rootProject.ext.kotlinVersion = '1.4.21'
76+
rootProject.ext.kotlinVersion = '1.5.31'
7277
```
7378

7479
- specify `AsyncStorage_kotlinVersion` in `gradle.properties`:
7580

7681
```groovy
77-
AsyncStorage_kotlinVersion=1.4.21
82+
AsyncStorage_kotlinVersion=1.5.31
83+
```
84+
85+
**Room**
86+
87+
Next AsyncStorage uses [Room persistence library](https://developer.android.com/jetpack/androidx/releases/room) to store data.
88+
Currently, tested version is `2.3.0`. You can specify different version, by adding a flag to `gradle.properties`:
89+
90+
```groovy
91+
AsyncStorage_next_roomVersion=2.3.0
7892
```
7993

8094
### Notable changes

0 commit comments

Comments
 (0)