Skip to content

Commit

Permalink
Improve datalayer guide (#1856)
Browse files Browse the repository at this point in the history
  • Loading branch information
luizgrp authored Dec 6, 2023
1 parent dfe2437 commit a4afcbb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public class WearDataLayerAppHelper(

private val surfacesInfoDataStore by lazy {
registry.protoDataStore(
path = DataLayerAppHelper.SURFACE_INFO_PATH,
path = SURFACE_INFO_PATH,
coroutineScope = scope,
serializer = SurfacesInfoSerializer,
)
Expand Down
28 changes: 25 additions & 3 deletions docs/datalayer-helpers-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ phone.
seconds: 1680016845
}
}
usage_info {
timestamp {
nanos: 669000000
seconds: 1701708501
}
usage_status: USAGE_STATUS_LAUNCHED_ONCE
usage_status_value: 1
}
)
```
Expand Down Expand Up @@ -161,11 +169,18 @@ phone.
1. **Tracking the main activity has been launched at least once** (Wear-only)
To determine if your main activity has been launched once, use:
To mark that your main activity on the watch app has been launched once, use:
```kotlin
```kotlin
wearAppHelper.markActivityLaunchedOnce()
```
```
To check it on the phone side, use:
```kotlin
val connectedNodes = appHelper.connectedNodes()
// after picking a node, check if value is USAGE_STATUS_LAUNCHED_ONCE:
node.surfacesInfo.usageInfo.usageStatus
```
1. **Tracking the app has been set up** (Wear-only)
Expand All @@ -182,3 +197,10 @@ phone.
wearAppHelper.markSetupNoLongerComplete()
```
To check it on the phone side, use:
```kotlin
val connectedNodes = appHelper.connectedNodes()
// after picking a node, check if value is either USAGE_STATUS_LAUNCHED_ONCE
// or USAGE_STATUS_SETUP_COMPLETE
node.surfacesInfo.usageInfo.usageStatus
```

0 comments on commit a4afcbb

Please sign in to comment.