You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: PlayCoreKtx/README.markdown
+16-4Lines changed: 16 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,17 @@ This is an API sample to showcase the following parts of the Play Core library i
11
11
The sample app is a "flashlight" app that lets you light up the screen with a yellow background.
12
12
You can also pick a color for the flashlight from a photo, by using the camera.
13
13
14
+
The photo color picker is an on-demand module, and will be installed only after the user clicks
15
+
on the floating action button.
16
+
17
+
In-app reviews are triggered only after the user selects a color from a photo,
18
+
and then turns the flashlight off.
19
+
20
+
Pay attention to the requirements for testing the in-app reviews dialog as described [here](https://developer.android.com/guide/playcore/in-app-review/test).
21
+
Notably, the user must have downloaded the app from Play Store, which means you need to change
22
+
the sample's `applicationId` and upload it to Play Console, and the user must not have reviewed
23
+
the app previously.
24
+
14
25
## Implementation
15
26
The app is designed to show how to use the respective Play Core APIs using by using the Play Core KTX artifact, which provides coroutine (`suspend` and `Flow`) versions of all Play Core APIs.
16
27
@@ -22,7 +33,7 @@ Important parts of the code to look at are:
22
33
*`PaletteFragment` - this fragment is in an on-demand dynamic feature module (`features/picure`) and takes care of requesting the camera to take a photo and extracting the colors from it. The color is stored in the `ColorViewModel` which is scoped to the Activity and is shared between both Fragments
23
34
24
35
## Usage
25
-
To test the sample locally, you can use the following Gradle task:
36
+
To test the on-demand feature module installation locally, you can use the following Gradle task:
26
37
```
27
38
./gradlew debugInstallApksForLocalTesting
28
39
```
@@ -34,10 +45,11 @@ At runtime, based on the local testing meta-data set in the Manifest by `bundlet
34
45
`SplitInstallManager` will load dynamic feature modules from local storage instead of connecting to
35
46
the Play Store.
36
47
37
-
If you wish to test real behavior, including in-app updates and in-app reviews, you can use
38
-
[internal app sharing](https://support.google.com/googleplay/android-developer/answer/9303479?hl=en) on the Play Store.
48
+
If you wish to test real behavior, *including in-app updates and in-app reviews*, you can use
The task described above comes from a custom Gradle plugin that can be found in the `buildSrc` directory. It uses the new [Android Gradle plugin Variant API](https://medium.com/androiddevelopers/new-apis-in-the-android-gradle-plugin-f5325742e614) to read the final location of the produced Android App Bundle file, then extracts APKs from it and installs them on the device.
42
54
43
55
While not the focus of this sample, if you're interested in learning more about custom Gradle tasks and using the Variant API, you're encouraged to look at the code or copy it to your project, however please note that this plugin is not production-ready and will not be supported.
0 commit comments