├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── values │ │ │ │ ├── colors.xml │ │ │ │ ├── feature_names.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── values-pl │ │ │ │ └── strings.xml │ │ │ ├── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ │ ├── drawable │ │ │ │ └── ic_launcher_background.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── android │ │ │ │ └── samples │ │ │ │ └── dynamicfeatures │ │ │ │ ├── BaseSplitActivity.kt │ │ │ │ ├── MyApplication.kt │ │ │ │ └── MainActivity.kt │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── google │ │ └── android │ │ └── samples │ │ └── dynamicfeatures │ │ └── MainActivityTest.kt ├── proguard-rules.pro └── build.gradle ├── instant ├── url │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── res │ │ │ ├── values-pl │ │ │ │ └── strings.xml │ │ │ ├── values │ │ │ │ └── strings.xml │ │ │ └── layout │ │ │ │ └── activity_url_instant_module.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── android │ │ │ │ └── samples │ │ │ │ └── instantdynamicfeatures │ │ │ │ └── UrlInstantModuleActivity.kt │ │ │ └── AndroidManifest.xml │ └── build.gradle └── split │ ├── .gitignore │ ├── src │ └── main │ │ ├── res │ │ ├── values-pl │ │ │ └── strings.xml │ │ ├── values │ │ │ └── strings.xml │ │ └── layout │ │ │ └── activity_split_install_instant.xml │ │ ├── java │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ └── samples │ │ │ └── instantdynamicfeatures │ │ │ └── SplitInstallInstantActivity.kt │ │ └── AndroidManifest.xml │ └── build.gradle ├── features ├── assets │ ├── .gitignore │ ├── src │ │ └── main │ │ │ ├── assets │ │ │ └── assets.txt │ │ │ └── AndroidManifest.xml │ ├── proguard-rules.pro │ └── build.gradle ├── java │ ├── .gitignore │ ├── proguard-rules.pro │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ └── strings.xml │ │ │ │ ├── values-pl │ │ │ │ │ └── strings.xml │ │ │ │ └── layout │ │ │ │ │ └── activity_feature_java.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── google │ │ │ │ │ └── android │ │ │ │ │ └── samples │ │ │ │ │ └── dynamicfeatures │ │ │ │ │ └── ondemand │ │ │ │ │ └── JavaSampleActivity.java │ │ │ └── AndroidManifest.xml │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ └── samples │ │ │ └── dynamicfeatures │ │ │ └── ondemand │ │ │ └── JavaSampleActivityTest.java │ └── build.gradle ├── kotlin │ ├── .gitignore │ ├── proguard-rules.pro │ ├── src │ │ ├── main │ │ │ ├── res │ │ │ │ ├── values │ │ │ │ │ └── strings.xml │ │ │ │ ├── values-pl │ │ │ │ │ └── strings.xml │ │ │ │ └── layout │ │ │ │ │ └── activity_feature_kotlin.xml │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── google │ │ │ │ │ └── android │ │ │ │ │ └── samples │ │ │ │ │ └── dynamicfeatures │ │ │ │ │ └── ondemand │ │ │ │ │ └── KotlinSampleActivity.kt │ │ │ └── AndroidManifest.xml │ │ └── androidTest │ │ │ └── java │ │ │ └── com │ │ │ └── google │ │ │ └── android │ │ │ └── samples │ │ │ └── dynamicfeatures │ │ │ └── ondemand │ │ │ └── KotlinSampleActivityTest.kt │ └── build.gradle └── native │ ├── .gitignore │ ├── src │ ├── main │ │ ├── cpp │ │ │ ├── CMakeLists.txt │ │ │ └── hello-jni.c │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── android │ │ │ │ └── samples │ │ │ │ └── dynamicfeatures │ │ │ │ └── ondemand │ │ │ │ └── NativeSampleActivity.kt │ │ └── res │ │ │ └── layout │ │ │ └── activity_hello_jni.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── google │ │ └── android │ │ └── samples │ │ └── dynamicfeatures │ │ └── ondemand │ │ └── NativeSampleActivityTest.kt │ ├── proguard-rules.pro │ └── build.gradle ├── screenshots └── main.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── README.markdown ├── .gitignore ├── NOTICE ├── settings.gradle ├── .google └── packaging.yaml ├── gradle.properties ├── CONTRIBUTING.md ├── gradlew.bat ├── gradlew └── LICENSE /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /instant/url/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /features/assets/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /features/java/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /features/kotlin/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /features/native/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /instant/split/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /screenshots/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/screenshots/main.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /features/assets/src/main/assets/assets.txt: -------------------------------------------------------------------------------- 1 | This text originates from a dynamically loaded feature. 2 | The source can be found in features/assets/assets/assets.txt. -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/googlearchive/android-dynamic-features/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /README.markdown: -------------------------------------------------------------------------------- 1 | # PlayCore API sample 2 | 3 | This repo has been migrated to [github.com/android/app-bundle][1]. Please check that repo for future updates. Thank you! 4 | 5 | [1]: https://github.com/android/app-bundle 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/libraries 5 | /.idea/modules.xml 6 | /.idea/workspace.xml 7 | /.idea 8 | .DS_Store 9 | /build 10 | /captures 11 | .externalNativeBuild 12 | release 13 | /.cxx 14 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Mar 04 12:19:37 GMT 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip 7 | -------------------------------------------------------------------------------- /features/native/src/main/cpp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.4.1) 2 | 3 | add_library(hello-jni SHARED 4 | hello-jni.c) 5 | 6 | # Include libraries needed for hello-jni lib 7 | target_link_libraries(hello-jni 8 | android 9 | log) 10 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | This sample uses the following software: 2 | 3 | Copyright 2018 Google LLC. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | -------------------------------------------------------------------------------- /instant/url/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | To jest funkcja instant załadowana poprzez url. 19 | 20 | 21 | -------------------------------------------------------------------------------- /instant/url/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | This is an instant dynamic feature, loaded with a url. 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /features/assets/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /features/java/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /features/kotlin/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /features/native/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /features/java/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | This is a dynamic feature, written in \nJava\n which can be loaded on demand. 19 | 20 | -------------------------------------------------------------------------------- /instant/split/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | To jest funkcja instant załadowana przy pomocy Split Install API. 19 | 20 | 21 | -------------------------------------------------------------------------------- /features/kotlin/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | This is a dynamic feature, written in \nKotlin\n which can be loaded on demand. 19 | 20 | -------------------------------------------------------------------------------- /instant/split/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | This is an instant dynamic feature, downloaded using the Split Install API. 19 | 20 | 21 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | include ':app', 18 | ':features:java', 19 | ':features:kotlin', 20 | ':features:assets', 21 | ':features:native', 22 | ':instant:split', 23 | ':instant:url' 24 | -------------------------------------------------------------------------------- /features/kotlin/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | To jest dynamiczna funkcja napisana w \nKotlinie\n, która może być załadowana na żądanie. 19 | 20 | -------------------------------------------------------------------------------- /features/java/src/main/res/values-pl/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | To jest dynamiczna funkcja napisana w \nJavie\n, która może być załadowana na żądanie. 20 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | #008577 20 | #00574B 21 | #D81B60 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /features/assets/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: 'com.android.dynamic-feature' 18 | 19 | android { 20 | 21 | compileSdkVersion versions.compileSdk 22 | 23 | defaultConfig { 24 | minSdkVersion versions.minSdk 25 | targetSdkVersion versions.targetSdk 26 | } 27 | } 28 | 29 | dependencies { 30 | 31 | implementation project(':app') 32 | } 33 | -------------------------------------------------------------------------------- /.google/packaging.yaml: -------------------------------------------------------------------------------- 1 | # GOOGLE SAMPLE PACKAGING DATA 2 | # 3 | # This file is used by Google as part of our samples packaging process. 4 | # End users may safely ignore this file. It has no relevance to other systems. 5 | --- 6 | status: DRAFT 7 | technologies: [Android] 8 | categories: [Dynamic Apps] 9 | languages: [Kotlin, Java, Native] 10 | solutions: [Mobile] 11 | 12 | github: googlesamples/android-dynamic-features 13 | 14 | level: INTERMEDIATE 15 | 16 | apiRefs: 17 | - google:com.google.android.play.core.splitinstall.SplitInstallManager 18 | - google:com.google.android.play.core.splitinstall.SplitInstallManagerFactory 19 | - google:com.google.android.play.core.splitinstall.SplitInstallRequest 20 | - google:com.google.android.play.core.splitinstall.SplitInstallSessionState 21 | - google:com.google.android.play.core.splitinstall.SplitInstallStateUpdatedListener 22 | - google:com.google.android.play.core.splitinstall.model.SplitInstallSessionStatus 23 | 24 | license: apache2 25 | -------------------------------------------------------------------------------- /instant/split/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: 'com.android.dynamic-feature' 18 | apply plugin: 'kotlin-android' 19 | apply plugin: 'kotlin-android-extensions' 20 | 21 | android { 22 | 23 | compileSdkVersion versions.compileSdk 24 | 25 | defaultConfig { 26 | minSdkVersion versions.minSdk 27 | targetSdkVersion versions.targetSdk 28 | } 29 | } 30 | 31 | dependencies { 32 | 33 | implementation project(':app') 34 | } 35 | -------------------------------------------------------------------------------- /instant/url/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | apply plugin: 'com.android.dynamic-feature' 18 | apply plugin: 'kotlin-android' 19 | apply plugin: 'kotlin-android-extensions' 20 | 21 | android { 22 | 23 | compileSdkVersion versions.compileSdk 24 | 25 | defaultConfig { 26 | minSdkVersion versions.minSdk 27 | targetSdkVersion versions.targetSdk 28 | } 29 | } 30 | 31 | dependencies { 32 | 33 | implementation project(':app') 34 | } 35 | -------------------------------------------------------------------------------- /instant/url/src/main/java/com/android/samples/instantdynamicfeatures/UrlInstantModuleActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.android.samples.instantdynamicfeatures 18 | 19 | import android.os.Bundle 20 | import com.google.android.samples.dynamicfeatures.BaseSplitActivity 21 | 22 | class UrlInstantModuleActivity : BaseSplitActivity() { 23 | 24 | override fun onCreate(savedInstanceState: Bundle?) { 25 | super.onCreate(savedInstanceState) 26 | setContentView(R.layout.activity_url_instant_module) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /instant/split/src/main/java/com/google/android/samples/instantdynamicfeatures/SplitInstallInstantActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.samples.instantdynamicfeatures 18 | 19 | import android.os.Bundle 20 | import com.google.android.samples.dynamicfeatures.BaseSplitActivity 21 | 22 | class SplitInstallInstantActivity : BaseSplitActivity() { 23 | 24 | override fun onCreate(savedInstanceState: Bundle?) { 25 | super.onCreate(savedInstanceState) 26 | setContentView(R.layout.activity_split_install_instant) 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /features/kotlin/src/main/java/com/google/android/samples/dynamicfeatures/ondemand/KotlinSampleActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.samples.dynamicfeatures.ondemand 18 | 19 | import android.os.Bundle 20 | import com.google.android.samples.dynamicfeatures.BaseSplitActivity 21 | import com.google.android.samples.dynamicfeatures.ondemand.kotlin.R 22 | 23 | /** A simple Activity displaying some text, written in Kotlin. */ 24 | class KotlinSampleActivity : BaseSplitActivity() { 25 | 26 | override fun onCreate(savedInstanceState: Bundle?) { 27 | super.onCreate(savedInstanceState) 28 | setContentView(R.layout.activity_feature_kotlin) 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/res/values/feature_names.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | kotlin 20 | java 21 | assets 22 | large 23 | native 24 | split 25 | http://uabsample-405d6.firebaseapp.com/url 26 | url 27 | url_instant_module_activity 28 | -------------------------------------------------------------------------------- /features/assets/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 22 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /features/java/src/main/java/com/google/android/samples/dynamicfeatures/ondemand/JavaSampleActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.samples.dynamicfeatures.ondemand; 18 | 19 | import android.os.Bundle; 20 | import com.google.android.samples.dynamicfeatures.BaseSplitActivity; 21 | import com.google.android.samples.dynamicfeatures.ondemand.java.R; 22 | 23 | import androidx.annotation.Nullable; 24 | 25 | /** A simple activity displaying text written in Java. */ 26 | public class JavaSampleActivity extends BaseSplitActivity { 27 | 28 | @Override 29 | protected void onCreate(@Nullable Bundle savedInstanceState) { 30 | super.onCreate(savedInstanceState); 31 | setContentView(R.layout.activity_feature_java); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2018 Google LLC. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # Project-wide Gradle settings. 18 | # IDE (e.g. Android Studio) users: 19 | # Gradle settings configured through the IDE *will override* 20 | # any settings specified in this file. 21 | # For more details on how to configure your build environment visit 22 | # http://www.gradle.org/docs/current/userguide/build_environment.html 23 | # Specifies the JVM arguments used for the daemon process. 24 | # The setting is particularly useful for tweaking memory settings. 25 | org.gradle.jvmargs=-Xmx1536m 26 | # When configured, Gradle will run in incubating parallel mode. 27 | # This option should only be used with decoupled projects. More details, visit 28 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 29 | org.gradle.parallel=true 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/google/android/samples/dynamicfeatures/BaseSplitActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2018 Google LLC. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | 17 | package com.google.android.samples.dynamicfeatures 18 | 19 | import android.content.Context 20 | import androidx.appcompat.app.AppCompatActivity 21 | import com.google.android.play.core.splitcompat.SplitCompat 22 | 23 | /** 24 | * This base activity unifies calls to attachBaseContext as described in: 25 | * https://developer.android.com/guide/app-bundle/playcore#invoke_splitcompat_at_runtime 26 | */ 27 | abstract class BaseSplitActivity : AppCompatActivity() { 28 | 29 | override fun attachBaseContext(newBase: Context?) { 30 | val ctx = newBase?.let { LanguageHelper.getLanguageConfigurationContext(it) } 31 | super.attachBaseContext(ctx) 32 | SplitCompat.install(this) 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 16 | 17 | 18 | 19 | 20 | 26 | 27 | 31 | 32 |