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: DynamicFeatures/README.markdown
+18-26Lines changed: 18 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,28 +12,22 @@ The sample contains several modules.
12
12
13
13
The `MainActivity` class demonstrates how to use the API to load and launch features.
14
14
15
-
The `BaseSplitActivity` abstract class implements the required `SplitCompat.Install()` call
16
-
in the `attachBaseContext` method. This allow to launch an activity from a freshly downloaded
17
-
dynamic module without having the restart the application.
15
+
The `BaseSplitActivity` abstract class implements the required `SplitCompat.Install()` call in the `attachBaseContext` method. This allow to launch an activity from a freshly downloaded dynamic module without having the restart the application.
18
16
19
17
`features/*` -> Contains features which can be downloaded on demand using the PlayCore API.
20
18
`instant/*` -> Contains instant enabled features which can be downloaded using the PlayCore API or via Url.
21
19
22
20
Each feature as some distinctly unique characteristics.
23
21
24
-
`features/assets` -> Feature containing only assets.
25
-
`features/kotlin` -> Feature written in Kotlin.
26
-
`features/java` -> Feature written in Java.
27
-
`features/maxSdk` -> Conditionally delivered feature based on max sdk version
28
-
`features/native` -> Feature written in Kotlin using JNI.
29
-
`instant/split` -> Instant Feature without an URL route. Loaded using Split
30
-
Install API
31
-
`instant/url` -> Instant Feature with a URL route
22
+
-`features/assets` -> Feature containing only assets.
23
+
-`features/kotlin` -> Feature written in Kotlin.
24
+
-`features/java` -> Feature written in Java.
25
+
-`features/maxSdk` -> Conditionally delivered feature based on max sdk version
26
+
-`features/native` -> Feature written in Kotlin using JNI.
27
+
-`instant/split` -> Instant Feature without an URL route. Loaded using SplitInstall API
28
+
-`instant/url` -> Instant Feature with a URL route
32
29
33
-
The `AndroidManifest` files in each feature show
34
-
how to declare a feature module as part of a dynamic app. Any module with the
35
-
instant attribute is instant enabled. In this sample these can be found in the
36
-
`instant/` folder:
30
+
The `AndroidManifest` files in each feature show how to declare a feature module as part of a dynamic app. Any module with the instant attribute is instant enabled. In this sample these can be found in the `instant/` folder:
37
31
38
32
```
39
33
<dist:module
@@ -47,24 +41,23 @@ instant attribute is instant enabled. In this sample these can be found in the
47
41
48
42
## Getting Started
49
43
50
-
Clone this repository, enter the top level directory and run <code>./gradlew tasks</code>
51
-
to get an overview of all the tasks available for this project.
44
+
Clone this repository, enter the top level directory and run <code>./gradlew tasks</code> to get an overview of all the tasks available for this project.
52
45
53
46
## Testing dynamic delivery
54
47
55
-
To test dynamic delivery with this sample, you'll need to upload it to the Google Play Store's
56
-
internal testing channel.
57
-
58
-
Before uploading, make sure to change the `applicationId` in `app/build.gradle`.
48
+
To test dynamic delivery with this sample, you can follow any of the below steps:
49
+
* Upload the aab to the Google Play Store's internal testing channel. Before uploading, make sure to change the `applicationId` in `app/build.gradle`.
50
+
* Locally test the dynamic delivery by using [FakeSplitInstallManager](https://developer.android.com/guide/app-bundle/test/testing-fakesplitinstallmanager) and [bundletool](https://developer.android.com/studio/command-line/bundletool>bundletool):
51
+
1. Build a set of APKs: `bundletool build-apks --local-testing --bundle=<path_to_aab> --output=<path_to_apks>`. _Make sure to include --local-testing flag_
52
+
2. Connect to the device/emulator
53
+
3. Deploy app to the device: `bundletool install-apks --apks=<path_to_apks>`
59
54
60
55
## Running instrumentation tests
61
56
62
57
In order to run instrumentation tests, parallel builds have to be turned off at the moment.
63
58
This means you can run them via `./gradlew connectedAndroidTest --no-parallel`.
64
59
65
-
Tooling support for this is being worked on – currently it's not possible to run
66
-
instrumentation tests for dynamic-feature modules from Android Studio directly.
67
-
Use the command line instead.
60
+
Tooling support for this is being worked on – currently it's not possible to run instrumentation tests for dynamic-feature modules from Android Studio directly. _Use the command line instead._
68
61
69
62
## Support
70
63
@@ -74,6 +67,5 @@ If you've found an error *in this sample*, please file an issue:
74
67
75
68
https://github.com/android/app-bundle/issues
76
69
77
-
Patches are encouraged, and may be submitted by forking this project and
78
-
submitting a pull request through GitHub.
70
+
Patches are encouraged, and may be submitted by forking this project and submitting a pull request through GitHub.
0 commit comments