Skip to main content

The usage of the Banuba SDK resources externally on Android

The usage of the Banuba SDK resources externally

By default, the SDK contains all the needed resources as a part of banuba_effect_player.aar. But there is an option to use the Banuba SDK resources externally, in other words, to separate the resources from the application. They can be external packages or downloaded resources. This allows you to reduce the size of your application.

You can request a special build of the SDK with already separated resources or you can extraсt them manually.

To extract resources manually you should follow the steps below:

  1. Change the extension of the BanubaEffectPlayer/banuba_effect_player-release.aar from .aar to .zip.

  2. Unzip the BanubaEffectPlayer/banuba_effect_player-release.zip.

  3. Make a backup of resources folder bnb-resources from here: BanubaEffectPlayer/banuba_effect_player-release/assets.

  4. Delete the bnb-resources files from the BanubaEffectPlayer/banuba_effect_player-release/assets folder.

  5. Go to the BanubaEffectPlayer/banuba_effect_player-release folder and compress its content.

    note

    It is important to compress the content of the folder, but not the folder itself.

    image

  6. Move the resulting archive to BanubaEffectPlayer folder.

  7. Rename the archive to banuba_effect_player-release.aar.

To use external resources, please follow the steps below:

  1. Copy resource packages to application resources or implement the logic to download resources online during the application execution.

  2. Update the path to the resources that you will pass into the initialization of the BanubaSdkManager image

or the UtilityManager. image

note

If you want to use both repacking and external resources, you should first repack the SDK and only then extract resources.

note

You should take care to check the resources version while using external resources.