Flamingo for Android
Finally, a Flamingo build with Android support is out!
Flamingo aims to leverage server-side code when developing apps for new media platforms. In this (Flamingo 2.1) release, the following features for Android have been implemented:
- Server components call
- Conversation support
- Expression service (evaluates el-expressions)
- Dynamic finders and updaters
- Validators
- Callsets
Server Components Call
Let’s look closely at the implementation of one of these Android features…
One of the most appealing Flamingo features is the dynamic binding of client components to the server side (for example, Sping beans or Seam components). This frees developers from routine integration tasks and allows them to concentrate on the business logic.
Seam Component
Let’s take a look in more detail into how an Android client application can make a call to a Seam component like this one.
TestDto.java
public class TestDto { private String value; public void setValue(String v ) { value = v; } public String getValue() { return value; } }
Test.java
public interface ITest { public static final String NAME="testService"; public TestDto echo(TestDto value); }
TestService.java
@Name(Test.NAME) public class TestService implements Test { public TestDto echo(TestDto value) { return value.setValue(“reply:”+value.getValue()); } }
Step 1: Server Configuration
As described in the documentation:
- Copy the required Flamingo JAR files to the
WEB-INF/libdirectory - Configure a Flamingo servlet in the
web.xmlfile
Step 2: Client Configuration
The Android client communicates with a server via HTTP(S), so an end-point has to be configured before any server-side calls are made:
String serverComponentURL = "http://hostname:8080/mywebapp/resource/hessian"; ServiceFactory.initialize(serverComponentURL);
Once an end-point is initialized in the run-time, ServiceFactory takes care of binding client-side components to their implementations on the server side:
Test testService =ServiceFactory.getInstance().getService(Test.class,Test.NAME);
Step 3: The Server-Side Call
Once an end-point is initialized in step 2, a call to the component on the server can be made:
TestDto testValue = new TestDto(); testValue.setValue(“Some text value”); testValue = testService.echo(testValue);
Please note that a JAR file with a definition of the Test interface should be in your Android classpath.
More to Flamingo
Flamingo is more than just the binding of services. It offers developers many more features like:
- Validators
- Dynamic finders and updaters
- Expressions
- Messaging
- Code generation
Download the latest version of Flamingo, Exadel Flamingo 2.1.0, and see for yourself.

[…] This post was mentioned on Twitter by Exadel Updates, Max Katz. Max Katz said: RT @exadel: Andrew Komolov blogs on one new aspect of the just released Exadel Flamingo 2.1 — support for Android http://bit.ly/5cqb1H […]
[…] in December, Andrew Komolov posted Flamingo for Android about a new version of Flamingo with support for mobile clients including Android. To […]
[…] of the iPhone client that works with our Exadel M-Commerce Solution, our great package based on Exadel Flamingo for “mobilizing” existing e-commerce functionality. It should help you get a […]