API for using AR cloud in the SDK
AR Cloud is a client-server solution that helps to save space in your application. This is a product used to store AR filters i.e. masks on a server-side instead of the SDK code. After being selected by the user for the first time, the filter is going to be downloaded from the server and then saved on the phone's memory.
Example of using AR cloudBanuba SDK AR Cloud delivery solution includes the ar-cloud-*.aar
library which should be placed into arcloud-android-kotlin/libs directory.
You can find the AR cloud library here: ar-cloud-*.aar.
#
Follow these steps to configure AR Cloud:#
1. Initialization of the ArCloudKoinModule module in Koinnote
ArCloudKoinModule should be placed before MainKoinModule.
ArCloudKoinModule is the AR Cloud module which should be initialized and placed before MainKoinModule.
MainKoinModule is the Koin module which should be implemented in your application. It is required for configuring AR Cloud dependencies.
#
2. Configuring of AR Cloud dependencies in DI layer#
3. Paste AR Cloud client id valuePaste AR Cloud client id value into strings.xml.
info
Please ask Banuba representative to provide you with client id for the trial period.
Excluding the mentioned modules in the example.
These are additional important classes:
- ArCloudMasksActivity - this is the main UI module that configures BanubaSdkManager with dependent UI components.
- EffectWrapper - is a data class that wraps an effect taken from an AR cloud.
- EffectsAdapter - an adapter for the RecyclerView component used to populate effects data.
- EffectsViewModel - the ViewModel component which is responsible for loading and providing the effect data.
You can use all classes mentioned above as examples or implement your own solution.