The newest Android App Bundle updates, together with further language API
Posted by Wojtek Kaliciński, Promoter Lawyer, Android
Final 12 months, we launched Android App Bundles and Google Play Dynamic Supply to introduce modular growth, scale back utility dimension, and simplify the publishing course of. Since then, builders have shortly adopted this new utility mannequin in additional than 60,000 manufacturing purposes. We’re happy to see that builders are reaching vital financial savings in utility dimension and decreasing the time required to handle every launch. We’ve got additionally documented these advantages in case research with Duolingo and RedBus.
Thanks to everybody who took the time to share their suggestions on our preliminary launch. We’re at all times open to new concepts and right this moment we’re joyful to announce new enhancements based mostly in your recommendations:
A brand new API for putting in further languages, which helps language selectors constructed into the applying
A profile publishing course of for immediately activated utility bundles
A brand new registration choice for signing of the app by Google Play
The power to completely uninstall dynamic perform modules which can be included within the preliminary set up of your utility
API for extra languages
Once you set Android App Bundle because the publishing format in your app, Google Play can optimize the set up by solely offering the language sources that correspond to the locale settings of the system system. If a person modifications the locale of the system after the set up of the applying, Play robotically downloads the required sources.
Some builders select to decouple the applying show language from the system locale by including a built-in language selector to the applying. With the most recent model of the Play Core Library (model 1.four.zero), we introduce a brand new, further language API that means that you can create in-application language selectors whereas retaining all the advantages of smaller installations offered to utilizing bundles of purposes.
With the extra language API, purposes can now ask the Play Retailer to put in sources for a brand new on-demand language configuration and begin utilizing it instantly.
Get an inventory of put in languages
The appliance can get an inventory of languages already put in utilizing the SplitInstallManager # getInstalledLanguages () technique.
val splitInstallManager = SplitInstallManagerFactory.create (context)
val langs: Set
Request further languages
Requesting a further language is equal to requesting a module on demand. To do that, you possibly can specify a language within the request through SplitInstallRequest.Builder # addLanguage (java.util.Locale).
val installRequestBuilder = SplitInstallRequest.newBuilder ()
installRequestBuilder.addLanguage (Locale.forLanguageTag ("pl"))
splitInstallManager.startInstall (installRequestBuilder.construct ())
The appliance may also monitor the success of the set up with reminders and monitor the obtain standing with a listener, corresponding to when requesting an on-demand module.
Don’t forget to handle the state SplitInstallSessionStatus.REQUIRES_USER_CONFIRMATION. Observe that a current API change has been made in a current model of Play Core, which signifies that it’s essential to use the brand new SplitInstallManager # startConfirmationDialogForResult () with Exercise # onActivityResult (). The earlier technique of utilizing SplitInstallSessionState # resolutionIntent () with startIntentSender () was deprecated.
See the up to date documentation for the Play Core Library for extra info on accessing newly put in language sources in your exercise.
We’ve got additionally up to date our instance of dynamic options on GitHub with the extra languages API, together with the storage process of the person's language choice and its utility to your startup actions.
Please observe that, whereas the extra language API is now accessible to all builders, the on-demand modules are at the moment in closed beta. You’ll be able to experiment with on-demand modules in your inside, open and closed check tracks as we work with our companions to make sure that this function is prepared for manufacturing purposes.
Lot of apps activated immediately
In Android Studio three.three, we launched a solution to create bundles of apps containing each the put in customary model of your app and a Google Play Prompt expertise for modules marked with the dist attribute: instantaneous = "true" of their AndroidManifest.xml file. :
Even if you happen to might use a single undertaking to construct the put in and instantaneous variations of your utility, to this point, builders nonetheless had to make use of product variants to create two separate units of purposes and obtain them. each on Play.
We’re happy to announce that now we have eliminated this restriction. It’s now doable to obtain a single unified utility utility artifact, containing modules enabled for an instantaneous expertise. This function is now accessible to everybody.
When you've created a set of instantaneous apps, obtain it to any observe within the Play Console and also you'll be capable of choose it when creating a brand new instantaneous app model. It additionally signifies that the put in and instantaneous variations of your utility not want totally different model codes, which is able to simplify the workflow.
Allow app signing by Google Play
You could allow Google Play app signing to publish your app with the assistance of a set of Android apps and robotically profit from dynamic supply optimizations. That is additionally a safer solution to handle your signing key, which we suggest to everybody, even if you wish to proceed publishing regular APK information for the time being.
Primarily based in your suggestions, now we have reorganized the registration stream for brand spanking new purposes to make it simpler to initialize the important thing you need to use for signing your utility.
Builders can now explicitly select to obtain their current key with out having to obtain a self-signed artifact beforehand. You may also select to start out with a key generated by Google Play, in order that the important thing used to signal your utility group regionally can turn into your obtain key.
Study extra in regards to the new feed.
Everlasting uninstallation of the set up modules
We’ve got now added the flexibility to completely uninstall dynamic function packages included within the preliminary set up of your utility.
There’s a conduct change, which suggests that you would be able to now name the prevailing SplitInstallManager # deferredUninstall () API on modules that set onDemand = "false". The module shall be completely uninstalled even when the applying is up to date.
This provides builders new prospects to additional scale back the scale of the put in utility. For instance, now you can uninstall a big signup module or different integration content material as soon as the person has completed. If the person accesses a bit of your utility that has been uninstalled, you possibly can reinstall it with the assistance of the usual on-demand modules set up API.
We hope you get pleasure from these enhancements and check them in your purposes. Preserve sharing your feedback as we work to make these options much more helpful for you!
How did you discover this weblog helpful?