Android project requirements
System requirements:- minSdk = 26 (Android 8.0)
- compileSdk = 34
- Android Gradle Plugin 8.1.4
- Kotlin 1.9.22
Installing the library
- Add the maven repository in your project’s
settings.gradle.ktsfile:
- Add the library as a dependency in your
app/build.gradle.ktsfile:
Library dependencies
Impactful dependencies:- Koin 3.2.2, including the implementation for Koin Context Isolation
- Compose BOM 2024.02.00 + Compose Compiler 1.5.9
- Accompanist 0.32.0
- Kotlin Coroutines 1.8.0
- OkHttp BOM 4.11.0
- Retrofit 2.9.0
- Coil Image Library 2.5.0
- Gson 2.10.1
Public API
The SDK library is managed through theFlowxSdkApi singleton instance, which exposes the following methods:
Configuring the library
To configure the SDK, call theinit method in your project’s application class onCreate() method:
Parameters
• Providing the
access token is explained in the authentication section.• The
custom components implementation is explained in its own section.• The implementation for providing a
custom view for the header of the Stepper component is detailed in its own section.
Sample
SdkConfig data for the config parameter above are:
Custom validators
Thecustom validators map is a collection of lambda functions, referenced by name (i.e. the value of the key in this map), each returning a Boolean based on the String which needs to be validated.
For a custom validator to be evaluated for a form field, its name must be specified in the form field process definition.
Using the library
Authentication
To be able to use the SDK, authentication is required. Therefore, before calling any other method on the singleton instance, make sure that the access token provider is set by calling:ai.flowx.android.sdk.FlowxSdkApi.Companion.AccessTokenProvider type, which is actually a functional interface defined like this:
Theming
To be able to use styled components while rendering a process, the theming mechanism must be invoked by calling thesuspend-ing setupTheme(...) method over the singleton instance of the SDK:
Parameters
If the
If the
themeUuid parameter value is empty (""), no theme will be fetched, and the mechanism will rely only on the fallback file, if set.If the
fallbackThemeJsonFileAssetsPath parameter value is null, there will be no fallback mechanism set in place, meaning if fetching the theme fails, the redered process will have no style applied over it’s displayed components.The SDK caches the fetched themes, so if a theme fetch fails, a cached version will be used, if available. Otherwise, it will use the file given as fallback.
Sample
Changing current language
The current language can be also changed after the initial setup, by calling thechangeLanguage function:
Parameters
Sample
Start a FlowX process
After performing all the above steps and all the prerequisites are fulfilled, a new instance of a FlowX process can be started, by using thestartProcess function:
Parameters
Sample
Resume a FlowX process
To resume an existing instance of a FlowX process, after fulfilling all the prerequisites, use thecontinueProcess function:
Parameters
Sample
Custom components
The container application should decide which custom component view to provide using thecomponentIdentifier configured in the UI designer.A custom component receives
data to populate the view and actions available to execute, as described below.
To handle custom components, an implementation of the CustomComponentsProvider interface should be passed as a parameter when initializing the SDK:
- by implementing the CustomComposableComponent interface
- by implementing the CustomViewComponent interface
Sample
CustomComposableComponent
To provide the custom component as a @Composable function, you have to implement theCustomComposableComponent interface:
CustomComposable object is an interface defined like this:
Sample
CustomViewComponent
To provide the custom component as a classical Android View function, you have to implement theCustomViewComponent interface:
CustomView object is an interface defined like this:
Sample
Execute action
The custom components which the container app provides may contain FlowX actions available for execution.These actions are received through the
actions parameter of the populateUi(actions: Map<String, CustomComponentAction>) method.In order to run an action (i.e. on a click of a button in the custom component) you need to call the
executeAction method:
Parameters
Get a substitution tag value by key
key.
It returns:
- the key’s counterpart, if the
keyis valid and found - the empty string, if the
keyis valid, but not found - the unaltered string, if the key has the wrong format (i.e. not starting with
@@)
Get a media item url by key
key.
It returns the URL string of the media resource, or null, if not found.
Custom header view for the STEPPER component
The container application can opt for providing a custom view in order to be used, for all the Stepper components, as a replacement for the built-in header.The custom view receives
data to populate its UI, as described below.
To provide a custom header for the Stepper, an implementation of the CustomStepperHeaderProvider interface should be passed as a parameter when initializing the SDK:
Sample
CustomComposableStepperHeader
To provide the custom header view as a @Composable function, you have to implement theCustomComposableStepperHeader interface:
ComposableStepperHeader object is an interface defined like this:
data parameter received as function argument is an interface defined like this:Sample
Known issues
- shadows are rendered only on Android >= 28 having hardware acceleration enabled
- there is no support yet for subprocesses started using the Call Activity node when configuring a TabBar Navigation Area

