I've been a zone leader with DZone since 2008, and I'm crazy about community. Every day I get to work with the best that JavaScript, HTML5, Android and iOS has to offer, creating apps that truly make at difference, as principal front-end architect at Avego. James is a DZone Zone Leader and has posted 639 posts at DZone. You can read more from them at their website. View Full User Profile

Powering Mobile Applications With Exadel Flamingo

06.16.2010
| 7086 views |
  • submit to reddit

The mobile app industry is getting a lot of attention from software developers at the moment. I read that Exadel's Flamingo framework can be used for mobile applications recently, so I asked Max Katz from Exadel what it was all about. This could be just what you need to get going in mobile development.


DZone: Hi Max, could you introduce Flamingo for those who don't know what it is?

Max Katz: Exadel Flamingo is an open source framework for connecting rich browser and mobile UI technologies to enterprise Java back end. With Exadel Flamingo, Flex, JavaFX,  Swing, J2ME, iPhone (in development), and Android can easily be glued to Seam, Spring, and Java EE (coming soon via CDI) back ends. Flamingo provides various services to make it simple to connect and reuse existing services.

DZone: Recently you mentioned that Flamingo has a mobile portion, how does this work?

Max Katz: Yes, we recently introduced features and client components that make it very simple to build iPhone (in development), Android and JavaME based applications and connect them to new or existing services (Seam, Spring or Java EE). Let’s say you have a JSF/Seam application. You can now use
Flamingo and build an application for Android and connect to the same back end Seam services.



Using Flamingo mobile we created Exadel M-Commerce Solution. This solution allows quickly to build and deploy services like shopping carts and product catalogs for iPhone and Android phones.

DZone: Does this mean you can have one application for both the iPhone and Android?

Max Katz: You would still use native tools (Objective-C for iPhone and Android SDK for Android) to build the application. Flamingo provides features to make it very simple for developers to connect to back end services.

DZone: How can I get my ObjectiveC/Android app to communicate with the Flamingo service?

Max Katz: There are three general steps:
1) Developers add Flamingo support to into the server application.
2) Define interfaces for services (and domain model) that should be called from mobile client.
3) Add Flamingo client libraries and server-side interfaces into mobile application and start calling the services.

Here's an example of some of the code behind it. First to the server side code:

@Name (“productService”)
public class ProductService {
public Product findById(String productId) {...}
}

For the Android Java client, developers add the jar with interfaces and domain objects into their Android application and start calling services the same way as calling them from the server.

ProductService productService =
FlamingoFactory.create(ProductService.class, “productService”);
Product result = ProductService.findById(productId);

On the iPhone, developers design an Objective-C representation of the server-side interfaces and domain objects. (Note: Java to Objective-C converter is a feature and will be included in one of the future releases).

id<ProductService> productService;
productService = [[ServiceFactory connectToService:[self formatUrl:https
host:host suffix:suffix port:port service:@"productService"]
protocol:@protocol(ProductService)] retain];
id<Product> product;
product = [[ShoppingCart instance].productService findById:productId];


DZone: Does Flamingo do anything for the front end clients?

Max Katz: Yes, it provides client-side (non-visual) components to make it easier to work with existing enterprise back end. For example, there is a validation component for Flex and JavaFX. A developer can use this client-side component to validate against Hibernate Validator (and soon Bean Validation)
on the server-side. In addition, we plan to add services to make life of mobile developers easier such as data list with pagination, server-side image compression and more.

DZone: So I presume it means you always need to have internet access?

Flamingo comes with off-line mode for JavaFX and Flex. It’s possible to disconnect from the Internet and still use the application. Once Internet connection is established, all data will by synchronized with the server. Flamingo distribution comes with such example. Similar features are planned for mobile.