Skip to main content
Version: 3.0.0

Using the Android Renderer

Project requirements

The Android Renderer sdk was built using the following tool versions:

  • Gradle 6.5
  • SDK Build Tools 4.1.2
  • Kotlin 1.5.31
  • Koin 3.1.3

Installing the library

The SDK works with apps that use Koin for DI and LiveData

Add dependency

  • Add Nexus repository details in the project settings.gradle file
maven {
credentials {
username "USERNAME"
password "PASSWORD"

  • Add the dependency in the module-level build.gradle file
implementation ""

Using the library

Configure the process renderer

.tokenCall { YOUR_TOKEN }
.addInterceptor(YOUR_INTERCEPTOR) //optional


Implement ProcessRenderer.Listener and its method display(templateConfig: FXTemplateConfig) and register for listening

class MainViewModel: ProcessRenderer.Listener {

private val flowX: ProcessRenderer by inject()

override fun display(templateConfig: FXTemplateConfig) {
when (templateConfig.componentIdentifier) {
// navigate to the required UI component based on the componentIdentifier

fun register() {

fun unregister() {

It is recommended to unregister from listening in order to avoid unwanted behavior.

Start a process:

flowx.startProcess(processName: String, processData: Any, replaceProcess: Boolean)

processName - the name of the process

processData - request body for starting the process (if needed)

replaceProcess - start a process by replacing the existing process (default is false)

Listen for data

class BaseFXViewModel : BaseViewModel() {

internal val flowX: ProcessRenderer by inject()
var actions: List<Action> = emptyList()
lateinit var data: YOUR_CLASS
private val dataObserver = Observer<JsonObject> {
data = it.toString().fromJson(gson, YOUR_CLASS)

private val actionsObserver = Observer<Array<Action>> {
actions = it.toList()

fun startListening() {
flowX.observeData(YOUR_PROCESS_NAME, YOUR_COMPONENT_NAME) { dataLiveData, actionsLiveData ->


fun clear {
flowX.observeData(YOUR_PROCESS_NAME, YOUR_COMPONENT_NAME) { dataLiveData, actionsLiveData ->

Run an action

The classic way to run an action is:

flowX.executeAction(YOUR_PROCESS_NAME, action, customParams, {
// action executed successfully

}, {
// error

where customParams represents the custom parameters that should be sent for this action; usually a JSONObject

In order to run an internal action, you need to call the following method:

flowX.executeInternalAction(processId, tokenId, actionName, { fxResult-> 
fxResult.handle(onSuccess, onError)


You can dismiss one process by running the following:


You can dismiss all the existing processes and close all the socket connections using:


Was this page helpful?