Trying to integrate proprietary Java/Kotlin SDK with Mendix App

0
I'm currently developing an app that is going to be used in retail stores in self-checkout, or kiosks. So the intent is that customers will scan their own products and pay. For this, i have to use a proprietary SDK which has been developed for Java/Kotlin apps.The initial setup for this 3 .aar fles being placed in the /libs folder of the java project and a number of .json files in the src/main/assets folder. Additionally, some entries need to be added to the build.gradle file for dependencies.A high level implementation from the documentation refers the following steps, after the initia setup:- Create an object that implements the X interface, to receive events from the SDK, or implement the X interface in your main activity.- Create an Y object as global reference on the merchant application start-up. The adapter will immediately do a key store update. After the Y object is initialised it will signal life-cycle events by calling event callbacks defined in the X interface- Initialize Y with configuration by calling the Y.method(...) function, providing as parameters the main activity object of the application and the listener object to receive event callbacks (these may be one and the same if the activity supplied implements the Y interface, in which case the listener parameter can be specified as “null”).i. The SDK will signal that adapter initialization is complete via the Y.method(...) event callbackThere are just the first steps, but I am having trouble to even figure these ones out due to Mendix internal structure. Is this something that is possible to do with Mendix or is it really impossible or too difficult to the point where implementing this in a parallel java project and then expose this as an API to Mendix is the only way to do it? If it is possible, how do i go about it? Thank you very much
asked
1 answers
1

Hi Miguel,

 

I really like these questions, as they're often asked by a solution architect and requires some deep insight into the possibilities of Mendix. And as architects always say: it depends...

 

Implementing custom Java in your Mendix application requires some extra skills. Having these onboard will put you to the question: should I build this fully in Java or can I link this to Low Code like Mendix. What were your considerations to implement this in Mendix?

 

Mendix is easy to implement in combination with REST and Soap API's, some other connectors are available via the Marketplace (like Kafka etc.). If you really need Java SDK's, you're on the path of custom Java Actions, developing your own connector module. You can initialize listeners by triggering some Java in the after startup microflow and trigger 'senders' using Java actions elsewhere. Depending on the structure, I would suggest to keep the custom Java to a minimum and do the most in Mendix, for example: pass along JSON for your connector and do import and export mapping using the native Mendix components.

 

You could also consider middleware, where a separate Java application converts messages from and to REST; this is mainly applicable for communication modules; not sure if this applies to you.

 

If you want to proceed developing in Mendix, you could take a look to the OIDC module for example, to see their Afterstartup microflow registering custom endpoints.

 

Good luck!

Johan

answered