If you develop with Flash Builder and use WebORB, read on, you will greatly enjoy this new functionality. The functionality is not entirely new, we had the plugin for quite some time. The main problem most users have encountered with the plugin was the installation process. We have fully reimplemented the plugin and added better integration support in the product itself.
The plugin now can be installed using Eclipse’s standard plugin installation process. To get started, make sure to download and install the latest nightly build of the product (or version 4.5 once it becomes available). To install the plugin:
From the main menu select Help and then ‘Install New Software’
Enter the following address for the plugin’s “update site” and press Enter:
http://dev.themidnightcoders.com/fb
Select the checkbox next to “WebORB plugins for Flash Builder”. The window in Eclipse/Flash Builder should look as shown in the image below:
Click through the installation wizard to complete the installation.
Click OK if you get a security warning saying the software is unsigned.
Once the installation is complete Flash Builder/Eclipse will offer a choice of applying the changes or restarting the application. Make sure to choose the restart option.
For the instructions on how to use the plugin, see WebORB documentation:
We have updated our product build system to deliver nightly product builds to you. When you login to our download center and select WebORB for .NET or WebORB for Java, you will see a list of the nightly builds available for download. The nightly builds deliver all the latest updates and bug fixes we’re adding while working toward the next product release. Please keep in mind that the nightly builds are not certified by our QA as “production ready” code, however, the code delivered through the nightly builds does pass our minimally required set of tests.
We need your feedback
When you download and try a nightly build, please report any problems you encounter through our discussion forum (.NET forum, Java forum) or the bug tracking system.
Flex provides many benefits and advantages over alternative client-side technologies. In my opinion one of the most powerful features available in Flex (and Flash) is the support for video streaming and recording. To make it easier for developers to include these (and many other RTMP-based) features, we added a very cool code generator into the latest releases of WebORB for Java and .NET. With a few mouse clicks the code generator can instantly create a complete Flex project containing all the ActionScript code enabling video recording, video broadcast, communication via remote shared objects and server-side data push. The video linked below provides an overview of this fantastic functionality. Enjoy!
In my previous post I shared an example showing data paging for flex. The most important subfeatures of our ‘managed data paging’ feature are:
Loosely coupled interface – the feature will work without implementing a specific server-side interface and can be used with Java, .NET and PHP
Can be used with ANY Flex data component (applicable to both MX and Spark architectures)
Memory management – our data provider will maintain only specific number of pages in memory and will re-fetch data on as needed basis
We put together another example visualizing how memory management work. The example works with a database table containing 2.6 million records. Any time a page of data is loaded or removed from memory, the visualization component reflects it by drawing or removing a line. You can see the example in action in the video below. The source code and the database script are available at the bottom of the post. Enjoy!
This is just a heads-up that we finished an implementation of a binary remoting protocol for our new Communication Library for iOS. The new feature provides a way to integrate iOS applications with Java, .NET and PHP backends. The next release of the library is a few days out and will enable extremely fast remote procedure call (RPC) support for POJOs, Java Spring beans, EJBs, Grails services, SOAP Web Services, .NET classes, WCF services, Spring.NET beans and PHP classes. We’re also working on a benchmark application which will demonstrate how our implementation stacks up against currently available integration approaches like JSON or SOAP. Stay tuned, the client-server integration for native iOS apps is about to change.
A few days ago we published an example demonstrating .NET data push to a native iPhone application. In that example the backend service was a .NET application hosted in WebORB for .NET. The application used WebORB as an RTMP server to deliver real-time updates to the client devices. In addition to the RTMP clients (like an iOS devices or Flex apps), a slightly modified version of the same code can easily support clients connecting via publish/subscribe API. An example of a such client can be a native Android application using our client-side library. We put together a native Android application and extended the server-side code to support publish/subscribe clients. The video below demonstrates the example in action and provides a brief code review. The instructions for setting up and running the example follow the video.
Follow the steps below to deploy and run the example:
Download and install the latest version of WebORB for .NET. (This post assumes the product is installed in the default installation directory. For the version 4.4, the installation directory is: c:/Program Files/WebORB for .NET/4.4.0.0/)
Open the server-side project in Visual Studio. Compile the project and make sure the compiled assembly is copied into the /bin folder in the WebORB installation directory (c:/Program Files/WebORB for .NET/4.4.0.0/bin)
Open messaging-config.xml from c:/Program Files/WebORB for .NET/4.4.0.0/WEB-INF/flex in a text editor.
Add the following XML block before the closing </service> tag:
Compile and run the Android project. Once the client application runs enter the WebORB remoting endpoint URL (for example for the local installation it may be http://localhost/weborb4/weborb.aspx). Click the ‘Connect’ button to establish a connection with the server-side application.
One of my most favorite features in the Communication Library for iOS is the support for server-side data push to iOS. We put together an example demonstrating the feature in action where a .NET server pushes real-time updates to an iPhone application. The example is demonstrated and reviewed in the video below. The instructions for running the example and the links for the source code are available below the video in this blog post. Enjoy!
Follow the steps below to deploy and run the example:
Download and install the latest version of WebORB for .NET. (This post assumes the product is installed in the default installation directory. For the version 4.4, the installation directory is: c:/Program Files/WebORB for .NET/4.4.0.0/)
Open the server-side project in Visual Studio. Compile the project and make sure the compiled assembly is copied into the /bin folder in the WebORB installation directory (c:/Program Files/WebORB for .NET/4.4.0.0/)
Create “StockExchange” directory under the “Applications” folder located at: c:/Program Files/WebORB for .NET/4.4.0.0/Applications)
Create the app.config file in the StockExchange directory with the following contents:
Open the WebORB Management Console. Switch to the ‘Messaging Server’ tab and make sure the StockExchange application is listed under the Applications node in the tree.
Run the iOS client application, enter the hostname for the server where WebORB for .NET is running and click Connect to establish a connection with the server-side application.
If you develop mobile applications for Windows Phone odds are you will need to integrate it with your backend services, which may be in .NET, Java or PHP. There are several points of integration including remote procedure calls, data push from Java or .NET, publish-subscribe messaging and so on. Some time ago we conducted a webinar where we discussed various integration strategies for Windows Phone applications. A recording of the webinar is now available online. The recording consists of five parts (each linked with the next one at the end of the videos). You can watch the webinar below or see it on our webinars pages (.NET webinars, Java webinars):
Cross platform application connectivity is to be a frequently requested and talked about feature. A lot of enterprise and consumer-facing applications require robust data exchange mechanism between application instances running on mobile devices. On top of this, many applications depend on real-time updates and notifications pushed from the server to the clients. One of the approaches for cross platform data exchange is a feature called Remote Shared Objects. The video below provides an explanation of the feature as well as a demonstration of iPhone, iPad and Windows Mobile phone communicating with each other as well as a browser-based Flex application.
The demo was built using the latest version of WebORB for .NET (the Java version would work just as well), Communication Library for iOS and a client library for Windows Mobile included into the WebORB distribution. Enjoy!
Integrating .NET applications with other client technologies (or even .NET to .NET) may not seem to be a trivial task. I believe Microsoft has done a great job providing a fairly closed technology stack where things work as long as you stick to Microsoft’s prescription of how to go about solving problems. Take for example the task of creating a multi client messaging system between a .NET application and Flex, AIR, Android or iOS client and you will shortly feel the pain. The real challenge is the .NET messaging framework is not very open to accomodate client applications of other than native .NET or ASP.NET. As a result, you will need a messaging server which will serve the purpose of routing broker and messaging “translator” between heterogeneous client applications.
Earlier this month I wrote about Remote Shared Objects and the benefits the feature provides. Since remote shared objects are no longer a feature exclusive to Flash, Flex and AIR clients I put together a messaging example demonstrating how .NET applications can efficiently communicate with Flex and AIR (and thus Android, iOS and Blackberry Playbook). The .NET application is a simple (console-based) chat program which uses remote shared objects to exchange data with a Flex client. The Remote Shared Object APIand RTMP connectivity comes with the RTMPClient class available in WebORB for .NET. Here’s the full listing of the C# code with an explanation right after the listing:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Threading;
using Weborb.Client;
using Weborb.Messaging.Net.RTMP;
using Weborb.Messaging.Api.Service;
using Weborb.Messaging.Api.SO;
namespace WeborbClientTest
{
class Program : IPendingServiceCallback, ISharedObjectListener
{
private ThreadStart threadStart;
private Thread chatThread;
private AutoResetEvent rsoIsReady = new AutoResetEvent( false );
private RTMPClient rtmpClient;
private IClientSharedObject rso;
static void Main( string[] args )
{
Program chatClient = new Program();
chatClient.StartChat();
}
public void StartChat()
{
rtmpClient = new RTMPClient();
rtmpClient.setServiceProvider( this );
System.Console.WriteLine( "Connecting to the RTMP server running at localhost:2037" );
rtmpClient.connect( "localhost", 2037, "Chat", null, this );
threadStart = new ThreadStart( MainChat );
chatThread = new Thread( threadStart );
chatThread.Start();
chatThread.IsBackground = false;
}
public void MainChat()
{
rsoIsReady.WaitOne();
System.Console.WriteLine( "Connecting to the 'ChatSO' remote shared object" );
rso = rtmpClient.getSharedObject( "ChatSO", false );
rso.addSharedObjectListener( this );
while( true )
{
System.Console.WriteLine( "Enter a message to put into RSO. Press \"Enter\" to stop the loop:" );
String messageText = System.Console.ReadLine();
if( messageText.Equals( "" ) )
break;
Hashtable messageObject = new Hashtable();
messageObject[ "imText" ] = messageText;
messageObject[ "username" ] = ".NET Client";
messageObject[ "color" ] = 0;
messageObject[ "isBold" ] = false;
messageObject[ "isItalics" ] = false;
messageObject[ "isUnderline" ] = false;
rso.setAttribute( "UserMessage", messageObject );
}
}
public void resultReceived( IPendingServiceCall call )
{
System.Console.WriteLine( "RTMP client connected" );
rsoIsReady.Set();
}
public void onSharedObjectClear( ISharedObjectBase so )
{
System.Console.WriteLine( "EVENT: onSharedObjectClear" );
}
public void onSharedObjectConnect( ISharedObjectBase so )
{
System.Console.WriteLine( "EVENT: onSharedObjectConnect" );
}
public void onSharedObjectDelete( ISharedObjectBase so, string key )
{
System.Console.WriteLine( "EVENT: onSharedObjectDelete" );
}
public void onSharedObjectDisconnect( ISharedObjectBase so )
{
System.Console.WriteLine( "EVENT: onSharedObjectDisconnect" );
}
public void onSharedObjectSend( ISharedObjectBase so, string method, IList parms )
{
System.Console.WriteLine( "EVENT: onSharedObjectSend" );
}
public void onSharedObjectUpdate( ISharedObjectBase so, IDictionary<string, object> values )
{
System.Console.WriteLine( "EVENT: onSharedObjectUpdate" );
}
public void onSharedObjectUpdate( ISharedObjectBase so, Weborb.Messaging.Api.IAttributeStore values )
{
System.Console.WriteLine( "EVENT: onSharedObjectUpdate" );
}
public void onSharedObjectUpdate( ISharedObjectBase so, string key, object value )
{
System.Console.WriteLine( "EVENT: onSharedObjectUpdate" );
Hashtable messageData = (Hashtable) value;
System.Console.WriteLine( "property " + key + ", imText value " + messageData[ "imText" ] );
}
}
}
The StartChat method is where the program connects to the localhost server running on port 2037 (WebORB’s default RTMP port). The “Chat” parameter is the name of the messaging application the client connects to. The main chat logic is in the MainChat method. As you can see from the code the MainChat method is executed by a separate thread. The reason for this is the process of establishing a connection and receiving a notification that the connection has been established (lines 34 and 72) is asynchronous. As a result, a separate thread is required so the main method of the application does not end prematurely.
Inside of the MainChat method, the code uses the getSharedObject method to obtain a reference to the specified remote shared object – ChatSO (line 47). A listener object is added to the remote shared object instance so the application receives all the RSO events, including the one when the RSO is updated (lines 111-117).
Compile the example code (you might need to set the weborb.dll assembly reference)
Run the WebORB Management Console
Run the .NET application
In the management console switch to the Help/Resources tab, then click the Examples link
In the examples tree in the console navigate to: FLEX Examples > Real-time Messaging (RTMP) > Basic Text Chat
Type in a send messages both in the Flex and .NET clients – both send and receive data
To see the contents of the Remote Shared Object used in the sample .NET application switch to the Messaging Server tab in the Management Console, select the Chat node in the tree, then select the Shared Objects tab. As the clients send data, the console shows the internal state of the shared object.
Exactly the same approach and APIs are applicable if you build Android and iOS mobile applications. I plan to write a similar post demonstrating cross platform connectivity and messaging between .NET and Android and iOS clients.
Here’s a brief video showing the example in action: