Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play asset delivery for Cordova for android. #1755

Open
Mr-Kumar-Abhishek opened this issue Dec 29, 2024 · 1 comment
Open

Play asset delivery for Cordova for android. #1755

Mr-Kumar-Abhishek opened this issue Dec 29, 2024 · 1 comment

Comments

@Mr-Kumar-Abhishek
Copy link

Feature Request

Play asset delivery for Cordova for android typically install-time play asset delivery

Motivation Behind Feature

A lot of apps especially games which are ported from web utilize a lot of big assets. Since google only allows 200 MB of app size unless its assets are delivered by Play Asset Delivery, it will be very helpful if Cordova would have this feature while build time.

Feature Description

Typically Cordova should have play asset delivery setup configuration in its build configuration of build.json file, where a user can configure install-time fast-follow or on-demand play asset delivery for android.

Alternatives or Workarounds

I couldn't find any proper alternatives or work around

@breautek
Copy link
Contributor

breautek commented Jan 1, 2025

I reviewed https://developer.android.com/guide/playcore/asset-delivery to try to determine how large or small this task might be and I think there's quite a bit involved.

It's not as simple as providing a module that is served as an asset pack for example.

At a high level, integrating Play assets would require:

  1. Setting up a module in the native project for the asset pack(s). Each pack needs it's own android module.
  2. Naturally copying the assets to the pack's resource folders.
  3. Install-time assets are immediately available upon install, so install-time assets I don't think requires any additional special logic, but for fast-follow or on-demand will require APIs additonal APIs to:
  4. check asset pack versions and download updates when necessary, an app update and asset pack versions may become out of sync, it's the app's responsibility to check and download the updates if necessary via android APIs.
  5. Large asset packs (packs that are greater than 200mb requires user consent to download, so handling the user prompt is necessary)
  6. Naturally, error handling will also be a requirement to gracefully error unknown asset packs or asset packs that hasn't been downloaded yet, or networking issues, etc.
  7. Lastly I'm not sure if asset packs are accessible via the typical file:///android_assets or if we will need additional mappings so that webview can use assets from asset packs.

Due to the nature of adding in APIs for app updates and version checks, it would be much better if this was a plugin in my opinion, which can be updated more easily and independently of the core platform, but I'm not sure if a plugin can implement everything needed, it may require changes in the core platform too, particularly around the gradle build system management.

To be clear this isn't any acceptance or rejection of the feature request. This is just an initial analysis of what is likely needed to provide the feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants