App Bundle, In Dynamic Feature Module, Module available before install










3















I try to implement dynamic feature module in my app. I have button in Activity. When user click I check module already installed or not. if not i start Install using startInstall(request). But I always goes to else state.



Code



 if (manager.installedModules.contains("sample")) 
-----> Always go to this block
Toast.makeText(this, "Already Downloaded", Toast.LENGTH_SHORT).show()
Intent().setClassName(packageName, "com.example.sample.SampleActivity")
.also
startActivity(it)

else
// Never came to this state
// Create request to install a feature module by name.
val request = SplitInstallRequest.newBuilder()
.addModule("sample")
.build()
// Load and install the requested feature module.
manager.startInstall(request)



In Dynamic feature module I set onDemand="true"



<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.sample">

<dist:module
dist:onDemand="true"
dist:title="@string/title_sample">
<dist:fusing dist:include="true" />
</dist:module>

<application>
<activity android:name="com.example.sample.SampleActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>











share|improve this question
























  • Because your package name contains "sample". that's why always you got this block, just change and check it.

    – Poovarasan Selvaraj
    Nov 13 '18 at 10:29











  • No @PoovarasanSelvaraj, dynamic feature already exist in my app that why its not crash when i startActivity

    – Magesh Pandian
    Nov 13 '18 at 10:31















3















I try to implement dynamic feature module in my app. I have button in Activity. When user click I check module already installed or not. if not i start Install using startInstall(request). But I always goes to else state.



Code



 if (manager.installedModules.contains("sample")) 
-----> Always go to this block
Toast.makeText(this, "Already Downloaded", Toast.LENGTH_SHORT).show()
Intent().setClassName(packageName, "com.example.sample.SampleActivity")
.also
startActivity(it)

else
// Never came to this state
// Create request to install a feature module by name.
val request = SplitInstallRequest.newBuilder()
.addModule("sample")
.build()
// Load and install the requested feature module.
manager.startInstall(request)



In Dynamic feature module I set onDemand="true"



<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.sample">

<dist:module
dist:onDemand="true"
dist:title="@string/title_sample">
<dist:fusing dist:include="true" />
</dist:module>

<application>
<activity android:name="com.example.sample.SampleActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>











share|improve this question
























  • Because your package name contains "sample". that's why always you got this block, just change and check it.

    – Poovarasan Selvaraj
    Nov 13 '18 at 10:29











  • No @PoovarasanSelvaraj, dynamic feature already exist in my app that why its not crash when i startActivity

    – Magesh Pandian
    Nov 13 '18 at 10:31













3












3








3








I try to implement dynamic feature module in my app. I have button in Activity. When user click I check module already installed or not. if not i start Install using startInstall(request). But I always goes to else state.



Code



 if (manager.installedModules.contains("sample")) 
-----> Always go to this block
Toast.makeText(this, "Already Downloaded", Toast.LENGTH_SHORT).show()
Intent().setClassName(packageName, "com.example.sample.SampleActivity")
.also
startActivity(it)

else
// Never came to this state
// Create request to install a feature module by name.
val request = SplitInstallRequest.newBuilder()
.addModule("sample")
.build()
// Load and install the requested feature module.
manager.startInstall(request)



In Dynamic feature module I set onDemand="true"



<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.sample">

<dist:module
dist:onDemand="true"
dist:title="@string/title_sample">
<dist:fusing dist:include="true" />
</dist:module>

<application>
<activity android:name="com.example.sample.SampleActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>











share|improve this question
















I try to implement dynamic feature module in my app. I have button in Activity. When user click I check module already installed or not. if not i start Install using startInstall(request). But I always goes to else state.



Code



 if (manager.installedModules.contains("sample")) 
-----> Always go to this block
Toast.makeText(this, "Already Downloaded", Toast.LENGTH_SHORT).show()
Intent().setClassName(packageName, "com.example.sample.SampleActivity")
.also
startActivity(it)

else
// Never came to this state
// Create request to install a feature module by name.
val request = SplitInstallRequest.newBuilder()
.addModule("sample")
.build()
// Load and install the requested feature module.
manager.startInstall(request)



In Dynamic feature module I set onDemand="true"



<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="com.example.sample">

<dist:module
dist:onDemand="true"
dist:title="@string/title_sample">
<dist:fusing dist:include="true" />
</dist:module>

<application>
<activity android:name="com.example.sample.SampleActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
</intent-filter>
</activity>
</application>








android android-app-bundle






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 20 '18 at 10:27







Magesh Pandian

















asked Nov 13 '18 at 10:17









Magesh PandianMagesh Pandian

1,99621128




1,99621128












  • Because your package name contains "sample". that's why always you got this block, just change and check it.

    – Poovarasan Selvaraj
    Nov 13 '18 at 10:29











  • No @PoovarasanSelvaraj, dynamic feature already exist in my app that why its not crash when i startActivity

    – Magesh Pandian
    Nov 13 '18 at 10:31

















  • Because your package name contains "sample". that's why always you got this block, just change and check it.

    – Poovarasan Selvaraj
    Nov 13 '18 at 10:29











  • No @PoovarasanSelvaraj, dynamic feature already exist in my app that why its not crash when i startActivity

    – Magesh Pandian
    Nov 13 '18 at 10:31
















Because your package name contains "sample". that's why always you got this block, just change and check it.

– Poovarasan Selvaraj
Nov 13 '18 at 10:29





Because your package name contains "sample". that's why always you got this block, just change and check it.

– Poovarasan Selvaraj
Nov 13 '18 at 10:29













No @PoovarasanSelvaraj, dynamic feature already exist in my app that why its not crash when i startActivity

– Magesh Pandian
Nov 13 '18 at 10:31





No @PoovarasanSelvaraj, dynamic feature already exist in my app that why its not crash when i startActivity

– Magesh Pandian
Nov 13 '18 at 10:31












3 Answers
3






active

oldest

votes


















2





+25









Currently the only way to test your implementation of onDemand delivery is by uploading the .aab to the PlayStore.



The standard deployment from Android Studio deploys all modules to the attached device.



In a development environment the flow is correct, that the module is already installed when it's deployed to device.



As for code, take a look at the sample app, in particular the download and listener implementation of MainActivity.






share|improve this answer

























  • is any official documentation ?

    – Magesh Pandian
    Nov 21 '18 at 5:46











  • There is documentation on PlayCore but that currently doesn't mention the upload requirement.

    – keyboardsurfer
    Nov 21 '18 at 8:59


















0















add split="dynamic-feature-test" in your manifest
split="split_name" : Defines the name of the module, which your app specifies when requesting an on demand module using the Play Core Library.





share|improve this answer























  • I added split="sample" but not work

    – Magesh Pandian
    Nov 13 '18 at 12:57



















0














use <dist:fusing dist:include="false" /> in order to exclude the feature module.



this is only required devices with API level < 20 ...in case the minSdkVersion permits this.



see the documentation, below paragraph 6 c.






share|improve this answer























  • my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

    – Magesh Pandian
    Nov 20 '18 at 10:26











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278707%2fapp-bundle-in-dynamic-feature-module-module-available-before-install%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























3 Answers
3






active

oldest

votes








3 Answers
3






active

oldest

votes









active

oldest

votes






active

oldest

votes









2





+25









Currently the only way to test your implementation of onDemand delivery is by uploading the .aab to the PlayStore.



The standard deployment from Android Studio deploys all modules to the attached device.



In a development environment the flow is correct, that the module is already installed when it's deployed to device.



As for code, take a look at the sample app, in particular the download and listener implementation of MainActivity.






share|improve this answer

























  • is any official documentation ?

    – Magesh Pandian
    Nov 21 '18 at 5:46











  • There is documentation on PlayCore but that currently doesn't mention the upload requirement.

    – keyboardsurfer
    Nov 21 '18 at 8:59















2





+25









Currently the only way to test your implementation of onDemand delivery is by uploading the .aab to the PlayStore.



The standard deployment from Android Studio deploys all modules to the attached device.



In a development environment the flow is correct, that the module is already installed when it's deployed to device.



As for code, take a look at the sample app, in particular the download and listener implementation of MainActivity.






share|improve this answer

























  • is any official documentation ?

    – Magesh Pandian
    Nov 21 '18 at 5:46











  • There is documentation on PlayCore but that currently doesn't mention the upload requirement.

    – keyboardsurfer
    Nov 21 '18 at 8:59













2





+25







2





+25



2




+25





Currently the only way to test your implementation of onDemand delivery is by uploading the .aab to the PlayStore.



The standard deployment from Android Studio deploys all modules to the attached device.



In a development environment the flow is correct, that the module is already installed when it's deployed to device.



As for code, take a look at the sample app, in particular the download and listener implementation of MainActivity.






share|improve this answer















Currently the only way to test your implementation of onDemand delivery is by uploading the .aab to the PlayStore.



The standard deployment from Android Studio deploys all modules to the attached device.



In a development environment the flow is correct, that the module is already installed when it's deployed to device.



As for code, take a look at the sample app, in particular the download and listener implementation of MainActivity.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 21 '18 at 11:18

























answered Nov 20 '18 at 15:42









keyboardsurferkeyboardsurfer

10.6k34572




10.6k34572












  • is any official documentation ?

    – Magesh Pandian
    Nov 21 '18 at 5:46











  • There is documentation on PlayCore but that currently doesn't mention the upload requirement.

    – keyboardsurfer
    Nov 21 '18 at 8:59

















  • is any official documentation ?

    – Magesh Pandian
    Nov 21 '18 at 5:46











  • There is documentation on PlayCore but that currently doesn't mention the upload requirement.

    – keyboardsurfer
    Nov 21 '18 at 8:59
















is any official documentation ?

– Magesh Pandian
Nov 21 '18 at 5:46





is any official documentation ?

– Magesh Pandian
Nov 21 '18 at 5:46













There is documentation on PlayCore but that currently doesn't mention the upload requirement.

– keyboardsurfer
Nov 21 '18 at 8:59





There is documentation on PlayCore but that currently doesn't mention the upload requirement.

– keyboardsurfer
Nov 21 '18 at 8:59













0















add split="dynamic-feature-test" in your manifest
split="split_name" : Defines the name of the module, which your app specifies when requesting an on demand module using the Play Core Library.





share|improve this answer























  • I added split="sample" but not work

    – Magesh Pandian
    Nov 13 '18 at 12:57
















0















add split="dynamic-feature-test" in your manifest
split="split_name" : Defines the name of the module, which your app specifies when requesting an on demand module using the Play Core Library.





share|improve this answer























  • I added split="sample" but not work

    – Magesh Pandian
    Nov 13 '18 at 12:57














0












0








0








add split="dynamic-feature-test" in your manifest
split="split_name" : Defines the name of the module, which your app specifies when requesting an on demand module using the Play Core Library.





share|improve this answer














add split="dynamic-feature-test" in your manifest
split="split_name" : Defines the name of the module, which your app specifies when requesting an on demand module using the Play Core Library.






share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 13 '18 at 11:10









mina shakermina shaker

12




12












  • I added split="sample" but not work

    – Magesh Pandian
    Nov 13 '18 at 12:57


















  • I added split="sample" but not work

    – Magesh Pandian
    Nov 13 '18 at 12:57

















I added split="sample" but not work

– Magesh Pandian
Nov 13 '18 at 12:57






I added split="sample" but not work

– Magesh Pandian
Nov 13 '18 at 12:57












0














use <dist:fusing dist:include="false" /> in order to exclude the feature module.



this is only required devices with API level < 20 ...in case the minSdkVersion permits this.



see the documentation, below paragraph 6 c.






share|improve this answer























  • my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

    – Magesh Pandian
    Nov 20 '18 at 10:26
















0














use <dist:fusing dist:include="false" /> in order to exclude the feature module.



this is only required devices with API level < 20 ...in case the minSdkVersion permits this.



see the documentation, below paragraph 6 c.






share|improve this answer























  • my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

    – Magesh Pandian
    Nov 20 '18 at 10:26














0












0








0







use <dist:fusing dist:include="false" /> in order to exclude the feature module.



this is only required devices with API level < 20 ...in case the minSdkVersion permits this.



see the documentation, below paragraph 6 c.






share|improve this answer













use <dist:fusing dist:include="false" /> in order to exclude the feature module.



this is only required devices with API level < 20 ...in case the minSdkVersion permits this.



see the documentation, below paragraph 6 c.







share|improve this answer












share|improve this answer



share|improve this answer










answered Nov 20 '18 at 7:56









Martin ZeitlerMartin Zeitler

15.2k33963




15.2k33963












  • my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

    – Magesh Pandian
    Nov 20 '18 at 10:26


















  • my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

    – Magesh Pandian
    Nov 20 '18 at 10:26

















my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

– Magesh Pandian
Nov 20 '18 at 10:26






my problem when i installed and try first time module already contains in installedModules so its show Already Downloaded toast. if i set <dist:fusing dist:include="false" /> same flow happen

– Magesh Pandian
Nov 20 '18 at 10:26


















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53278707%2fapp-bundle-in-dynamic-feature-module-module-available-before-install%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







這個網誌中的熱門文章

What does pagestruct do in Eviews?

Dutch intervention in Lombok and Karangasem

Channel Islands