Skip to main content

Android project requirements

System requirements:
  • minSdk = 26
  • compileSdk = 34
The SDK library was build using:

Installing the library

  1. Add the maven repository in your project’s settings.gradle.kts file:
  1. Add the library as a dependency in your app/build.gradle.kts file:

Library dependencies

Impactful dependencies:

Public API

The SDK library is managed through the FlowxSdkApi singleton instance, which exposes the following methods:

Configuring the library

To configure it, call this method in your project’s application class onCreate() method:
Its params are explained below: The custom components implementation is explained in its own section.

Sample

The configuration properties that should be passed as SdkConfig data for the config parameter above are:

Custom validators

The custom 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. By looking at the example from above - mapOf("exact_25_in_length" to { it.length == 25 }) - if a form element should be validated using this lambda function, in the process definition it must specifiy a custom validator named "exact_25_in_length".

Theming

To override the renderer’s internal theme, the themeTokensJsonFileAssetsPath and themeComponentsJsonFileAssetsPath parameters should contain some values, representing Android assets relative paths to the corresponding JSON file for tokens and components.

For example, their values could look like in the example from above:
For each case, this translates to file://android_asset/..., where ... is the relative path within your project’s assets/ directory.

Using the library

Check renderer compatibility

To check the renderers compatibility with the FlowX deployed services, use the suspend function checkRendererCompatibility:
where the action lambda parameter is where you should put your own logic when compatible or not.

Sample

Start a FlowX process

To start a new instance of a FlowX process, use the startProcess function:

Parameters

This returned @Composable function must be included in its own activity, which is part of (controlled and maintained by) the container application.
This wrapper activity must display only the @Composable returned from the SDK (i.e. it occupies the whole activity screen space).

Sample

Resume a FlowX process

To resume an existing instance of a FlowX process, use the continueProcess function:

Parameters

This returned @Composable function must be included in its own activity, which is part of (controlled and maintained by) the container application.
This wrapper activity must display only the @Composable returned from the SDK (i.e. it occupies the whole activity screen space).

Sample

Handling authorization token changes

When the access token changes, in can be updated in the renderer using the updateAccessToken method:

Custom components

The container application should decide which custom component view to provide using the componentIdentifier configured in the UI designer.
A custom component receives data to populate the view and actions 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:
There are two methods to provide a custom component:
  1. by implementing the CustomComposableComponent interface
  2. by implementing the CustomViewComponent interface

Sample

CustomComposableComponent

To provide the custom component as a @Composable function, you have to implement the CustomComposableComponent interface:
The returned 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 the CustomViewComponent interface:
The returned CustomView object is an interface defined like this:

Sample

Execute action

The custom components which the container app provides will contain FlowX actions to be executed.
In order to run an action you need to call the executeAction method:

Parameters

Get a substitution tag value by key

All substitution tags will be retrieved by the SDK before starting the first process and will be stored in memory. Whenever the container app needs a substitution tag value for populating the UI of the custom components, it can request the substitution tag using the method above, by providing the key. It returns:
  • the key’s counterpart, if the key is valid and found
  • the empty string, if the key is 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

All media items will be retrieved by the SDK before starting the first process and will be stored in memory. Whenever the container app needs a media item url for populating the UI of the custom components, it can request the url using the method above, by providing the key. It returns the URL string of the media resource, or null, if not found.

Known issues

Last modified on July 7, 2026