Jump to content

How to deploy a large Android app (150+ MB) using "Play Feature Delivery"?

Recommended Posts

Our Android App is rejected by Play Store because it exceeds the 150 MB limit. It is not an option to make it smaller as it includes a large 170 MB file with audio samples, which is required by our app. 
The way to handle large app is to use the "Play Feature Delivery" option:  https://developer.android.com/guide/playcore/feature-delivery


However, the instructions to use the "Feature Delivery" is highly tied up on having a project in Android Studio. We could probably do it by setting up a dummy app in Android Studio, but I guess it will take some time without any knowledge about Android Studio.

Anyone having found a way to deploy a large Delphi app to Play Store?

Share this post

Link to post

Can you download these audio samples after installation from your server(s)? The same way as offline maps are downloaded by apps... And probably stored to SD cards instead of internal storage (user is asked where to store them).

  • Like 1

Share this post

Link to post
13 hours ago, Dave Nottage said:


Hi Dave,

Thanks, and of course I should have checked your Kastri library of additional implementations. I guess I didn't find it because I was only searching for "Play Feature Delivery", and not for "Play Assets Delivery", which Google describe as being ONLY for games. However, having read more details about it, I think it matches our needs perfectly well.

So I'll look further into your demo.

Share this post

Link to post

Hi Dave

I've managed to successfully build and install the AssetDeliveryDemo. Building/deploying the Android 64bit Release Application Store target with Asset Packs (Build.. and Install using the Codex 1.5.1 Tools) using our own keystore.


However, when running the AssetDeliveryDemo App on the device, only an empty startup screen is displayed, e.g. I don't see any Assets (expecting 3 video files). I've investigated the system log and see 
  info "FMX: AssetDeliveryDemo: Asset pack: ondemand_assetpack required space: 2MB..."
  info "FMX: AssetDeliveryDemo: Asset pack: fastfollow_assetpack required space: 1MB..."

Meaning the AssetDeliveryAssetPackStateUpdateHandler is called with TAssetPackAction:TAssetPackAction.Query for both the fastfollow and ondemand asset packs 
However, no further calls are coming thru to the AssetDeliveryAssetPackStateUpdateHandler.


Further I've investigated the app filesystem and in the base directory there's an "split_installtime_assetpack.apk" asset pack with the other split apks etc., but the content (video file) has not been extrated to /files as expected.
I've tried calling the FAssetDelivery.GetAssetPackPath('installtime_assetpack'), however, it only returns an empty string since FAssetPackManager.getPackLocation is nil


For our app we only interested in using the installtime asset, so I've incorporated this in our app and building that asset into our bundle and get the same results. Meaning the "split_installtime_assetpack.apk" is placed in to base directory and contains the asset, but it's not extracted.
Note, I've tried both building the app bundle with the automatic (codex) tools and manual scripts 


This version of the app bundle has also been uploaded and installed from Google Play Store to test if it was only a problem in local-testing mode, but the result is the same.


My Configuration
RAD Studio 11 Patch 1
Android SDK \Embarcadero\Studio\22.0\CatalogRepository\AndroidSDK-2525-22.0.42600.6491\platforms\android-30
NDK \Embarcadero\Studio\22.0\CatalogRepository\AndroidNDK-21-22.0.42600.6491\android-ndk-r21
Java tools from Android Studio 2020.3.1 Patch 3

Edited by Hans♫

Share this post

Link to post
20 hours ago, Hans♫ said:

However, when running the AssetDeliveryDemo App on the device, only an empty startup screen is displayed

While experimenting with the code (or for some other reason) it seems I had not reverted the code to use the Fetch method (which was commented out) rather than Query (in the IdleMessageHandler). Can you check whether changing this works for you?


Share this post

Link to post

Hi Dave,


Thanks for your reply, it's greatly appreciated.

Now Video1 and Video3 get downloaded when adding the call to FAssetDelivery.Fetch in the IdleMessageHandler. So the fast-follow & on-demand delivery modes both work correctly. And the videos are playing as well.


However, the install-time asset Video2 still does not show up. But I wouldn't have expected that the above fix would have solved that either. You write in the code:

//!!!! Install time packs are just "normal" assets

Do you see Video2 showing up in your app?


Maybe I'm wrong but as I read the android developer documentation the install-time asset pack will be available immediately at app launch, but that's only the apk and you need to access the assets in it thru the AssetManager API. See this diagram


I assume the solution in our case could be to use AssetManager API stream interface to make a copy of the file in a temporary location.

Do you agree?


Thanks again for your help!

Share this post

Link to post
3 hours ago, Hans♫ said:

you need to access the assets in it thru the AssetManager API.

That's correct. I have a method in TAssetDelivery called GetAssets that will enumerate them (note: this also enumerates any folders contained in the assets) at the top-level by passing a blank value for the path.


As per the AssetManager docs, there are methods for accessing the files, however as you may notice from those docs these are not methods that you can use in a traditional Delphi-like manner.


One way around this could be to use the open method of AssetManager to return an InputStream and (ultimately) save it to a file that can be accessed using traditional file methods, however it seems a bit of overkill - you might as well use a fast-follow pack.


If you're playing videos, you could re-write TMediaPlayer (or at least the Android part) to deal with assets accessed via AssetManager however I'm yet to find a way of using these in a VideoView that works.




Share this post

Link to post

Thanks Dave!

To achieve the best user experience we would like to use the install-time assets. We need to extract a 150 MB binary file to be accessed using traditional file methods, and had hoped that your demo app also supported install-time assets. As you mention, the only part missing is to extract and save the file using AssetManager.

Any chance that this could find it way into your demo project?

Edited by Hans♫

Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now