Categories

  • An excellent post on delivering real-time updates from .NET to JavaScript via WebSockets by using WebORB for .NET: http://t.co/8ONjyw59
  • We're working on some cool samples demonstrating Sencha component integration with WebORB's websockets and data management. Stay tuned.
  • For all Flexers out there, check out the following blog post, looks like a problem in ArrayCollection serialization: http://t.co/qbZuTEhy
  • none - intentionally blocks websocket handshake responses. Not only they do not support it, they do not allow others either

Archives

Java Data Push to Native iOS, Android and Windows Phone applications

The example reviewed below demonstrates data push from a server-side Java application to three different native mobile app implementations: iOS, Android and Windows Phone. The server updates the data every 1.5 seconds and delivers it to the clients. The iOS client uses a persistent RTMP connection, the Android and Windows Phone clients use publish/subscribe messaging (via polling) to receive server-side updates. The source code for each mobile implementation and the server-side project (with deployment instructions) is available below the video:

Download source code:

Server-side Compilation and Deployment instructions:

  1. Download and install WebORB for Java (make sure to download version 4.3 or above) .The product is available for free with the Community Edition license. Without a license key, it will work in the “development mode” which will be sufficient to the this example. See WebORB Licensing for additional details.
  2. Download Java project files.
  3. To compile the Java project, add the following JAR dependencies: weborb.jar, red5.jar, spring-core-3.0.0.jar. All the required jar files can be found in [WEBORB-INSTALL-DIR]/webapp/WEB-INF/lib.
  4. The compiled classes can be deployed to [WEBORB-INSTALL-DIR]/webapp/WEB-INF/classes/examples/weborb (if the package structure changes, the directories under WEB-INF/classes will have to change as well).
  5. Register new messaging destinations. To do this, open [WEBORB-INSTALL-DIR]/webapp/WEB-INF/flex/messaging-config.xml in a text editor, add the following destination declaration before the closing </service> element, then save the file:
    <destination id="StockExchangeDestination">
      <properties>
       <server>
         <durable>false</durable>
       </server>
       <message-storage-policy>weborb.messaging.v3.MemoryStoragePolicy</message-storage-policy>
       <message-service-handler>weborb.messaging.v3.MessagingServiceHandler</message-service-handler>
      </properties>
      <channels>
        <channel ref="my-polling-amf"/>
      </channels>
    </destination>
    
  6. Register new RTMP messaging application: To do this create a new XML file with the following contents in  [WEBORB-INSTALL-DIR]/webapp/WEB-INF/classes. Name the file stockexchange-web.xml (alternatively, you can download the file from here):
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
      <bean id="stockexchange.context" class="org.red5.server.Context" autowire="byType" />
      <bean id="stockexchange.scope" class="org.red5.server.WebScope" init-method="register">
        <property name="server" ref="red5.server" />
        <property name="parent" ref="global.scope" />
        <property name="context" ref="stockexchange.context" />
        <property name="handler" ref="stockexchange.handler" />
        <property name="contextPath" value="/StockExchange" />
        <property name="virtualHosts" value="*,localhost, localhost:1935, localhost:8080, 127.0.0.1:8080" />
      </bean>
      <bean id="stockexchange.handler" class="examples.weborb.AppAdapter" singleton="true" />
    </beans>
    
  7. Modify beanRefContect.xml from [WEBORB-INSTALL-DIR]/webapp/WEB-INF/classes by adding the following XML element before the closing </list> element.
    <value>stockexchange-web.xml</value>
    
  8. Run WebORB for Java in a command prompt/terminal window by using the following command (run the command from the WebORB installation directory):
    java -jar weborb.jar
  9. Verify that WebORB is running by opening the management console from: http://localhost:8080
  10. Compile and run the mobile applications. Use the following configuration parameters:
    iOS – Hostname: if launching in iOS Simulator, use localhost, otherwise enter IP address of the machine where weborb is running. Application name: StockExchange, port – 1935
    Android and Windows Phone- WebORB URL – http://localhost:8080/weborb.wo (if running on a device, substitute localhost  with the IP address of the machine where WebORB is running).

Enjoy!

Enterprise grade connectivity between iOS and Java, .NET and PHP

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.

.NET Data Push to iPhone 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:

  1. 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/)
  2. Download the client-side project from:
    http://examples.themidnightcoders.com/blog/StockExchangeClient.zip
    (for additional examples, you can also  download the Communication Library for iOS).
  3. Download the server-side project from:
    http://examples.themidnightcoders.com/blog/StockExchange-server.zip
  4. 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/)
  5. Create “StockExchange” directory under the “Applications” folder located at: c:/Program Files/WebORB for .NET/4.4.0.0/Applications)
  6. Create the app.config file in the StockExchange directory with the following contents:
    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <application-handler>StockExchange.AppHandler</application-handler>
    </configuration>
    
  7. 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.
  8. 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.

Our RTMP iOS Communication LIbrary gets its own product page

A few weeks ago we have made our Communication Library for iOS available for download. We wanted to make it available as soon as possible as people were waiting to give it a try. The interest and the response we received has been phenomenal and now the work is well underway on a ton of very cool features planned for the second release (2.0). Today we launched a product page for the library in the section of our website titled “WebORB for Mobile”. You can access the library product page at: http://www.themidnightcoders.com/products/weborb-for-mobile/ios-integration. The new section provides access to the following:

Integrating native iOS applications with Flash Media Server

The Communication Library for iOS which we have recently released enables developers to integrate native iPhone and iPad applications with various server-side technologies. Since the library implements the RTMP protocol, it can easily connect the iOS applications with any RTMP-enabled media server. One of the most popular media servers is Adobe Flash Media Server. The video below provides an overview of the integration. Specifically, it demonstrates ability to do invocations of the server-side ActionScript running in FMS from the iOS apps using the library. Additionally, there is an example of the FMS data push implemented as an invocation of the client-side Objective-C functions from the code running in FMS.

In addition to the features reviewed in the video, the same library supports Remote Shared Objects. Currently, the integration enables data messaging, but we’re also working on adding support for video and audio broadcast and server-side recording. This new functionality will enable any iOS application to broadcast or record video stream from the device’s camera and audio from the microphone.

Enjoy!

Follow the steps below to configure your own FMS installation to run the same examples:

  1. Download and install Flash Media Server
  2. Create “CallbackDemo” folder under [FMS-INSTALL]/applications
  3. Download and extract CallbackDemo-servercode.zip into [FMS-INSTALL]/applications/CallbackDemo
  4. Create “MethodInvocation” folder under [FMS-INSTALL]/applications
  5. Download and extract MethodInvocation-servercode.zip into [FMS-INSTALL]/applications/MethodInvocation
  6. Download Communication Library for iOS, extract and the examples and open the examples project in XCode

iOS applications and Wowza Media Server integration

A few weeks ago we released a communication library for iOS which provides an excellent mechanism for integrating iOS applications with various server-side technologies. The library enables client-server integration via the RTMP protocol and thus requires the server-side code to be deployed into an RTMP. (Btw, we’re working on adding support for basic RPC (remote procedure call) mechanism which make it trivially simple to connect iOS applications with any Java, .NET or PHP class, web service, Spring beans, .NET WCF service, etc). One of the servers the library supports is Wowza Media Server. The video below provides a demonstration of the integration between iOS and Java classes deployed in Wowza. The examples demonstrate the following:

  • Invocation of Java methods from iPhone
  • Java data push via an invocation of the Objective C method from Java
  • Usage of Remote Shared Objects hosted in Wowza Media Server

The rest of this post (below the video) provides details on deploying the same examples in your own environment. We also plan to post similar videos and instructions for other RTMP server implementations, specifically FMS, Red5 and our own WebORB for Java and WebORB for .NET.

Follow the steps below to configure and run the same examples as shown in the video above (disclaimer: I’m not a Wowza Media Server expert and there might be a simpler way to do the configuration/deployment described below. If you know of a simpler or more appropriate way, please submit a comment):

  1. Download and install Wowza Media Server
  2. Create “ios” folder under [wowza-install-dir]/applications
  3. Create “ios” folder under [wowza-install-dir]/conf
  4. Create Application.xml file in [wowza-install-dir]/conf/ios with the following contents:
    <Root>
      <Application>
        <Connections>
          <AutoAccept>true</AutoAccept>
          <AllowDomains></AllowDomains>
        </Connections>
        <SharedObjects>
          <StorageDir></StorageDir>
        </SharedObjects>
        <Client>
          <IdleFrequency>-1</IdleFrequency>
          <Access>
            <StreamReadAccess>*</StreamReadAccess>
            <StreamWriteAccess>*</StreamWriteAccess>
            <StreamAudioSampleAccess></StreamAudioSampleAccess>
            <StreamVideoSampleAccess></StreamVideoSampleAccess>
            <SharedObjectReadAccess>*</SharedObjectReadAccess>
            <SharedObjectWriteAccess>*</SharedObjectWriteAccess>
          </Access>
        </Client>
        <Modules>
          <Module>
            <Name>MyModule</Name>
            <Description>This is MyModule</Description>
            <Class>examples.weborb.ios.MyWowzaModule</Class>
          </Module>
        </Modules>
      </Application>
    </Root>
    
  5. Create “CallbackDemo” folder under [wowza-install-dir]/applications
  6. Create “CallbackDemo” folder under [wowza-install-dir]/conf
  7. Create the Application.xml file in [wowza-install-dir]/conf/CallbackDemo with the following contents:
    <Root>
      <Application>
        <Connections>
          <AutoAccept>true</AutoAccept>
          <AllowDomains></AllowDomains>
        </Connections>
        <SharedObjects>
          <StorageDir></StorageDir>
        </SharedObjects>
        <Client>
          <IdleFrequency>-1</IdleFrequency>
          <Access>
            <StreamReadAccess>*</StreamReadAccess>
            <StreamWriteAccess>*</StreamWriteAccess>
            <StreamAudioSampleAccess></StreamAudioSampleAccess>
            <StreamVideoSampleAccess></StreamVideoSampleAccess>
            <SharedObjectReadAccess>*</SharedObjectReadAccess>
            <SharedObjectWriteAccess>*</SharedObjectWriteAccess>
          </Access>
        </Client>
        <Modules>
          <Module>
            <Name>MyModule</Name>
            <Description>This is MyModule</Description>
            <Class>examples.weborb.ios.MyWowzaModule</Class>
          </Module>
        </Modules>
      </Application>
    </Root>
    
  8. Download the following file, rename it to IPhoneToWowza.jar and copy the jar file to [wowza-install-dir]/lib:
    http://examples.themidnightcoders.com/blog/IPhoneToWowza.rename-to-jar.zip
  9. Start Wowza Media Server
  10. Download Communication Library for iOS
  11. The distribution of the library includes all the examples demonstrated in the video. Open the examples project file in xcode and run the examples.

All the server-side Java source code for the demonstrated examples can be downloaded from: http://examples.themidnightcoders.com/blog/IPhoneToWowza.zip

Cross Platform Mobile Development using Real Time Messaging

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!

RTMP communication library for iOS is available

Communication library for iOS with RTMP I’m happy to announce that version 1.0 of our new Communication Library for iOS is available for download. We posted a teaser a few weeks go, but now you can experience it yourself. Here’s what you get with the download:

  • Native Objective-C library for RTMP communication with any RTMP media server. This includes WebORB for .NET, WebORB for Java, Red5, FMS and Wowza Media Server
  • Support for Remote Shared Objects. This includes both working with the RSO data as well as support for the “send” function (client-to-client invoke)
  • Server-to-client invocations (data push).
  • Client-to-server invocations.
  • A bunch of examples with source code and an XCode project file.
  • API document describing all the functionality available in the current release.

Visit the Midnight Coders Download Center to download the library.

We’re very excited about this new product and would welcome any feedback. We’re working on a web page dedicated to our mobile offerings and it should be up very soon with a lot more examples, complete documentation, technical articles and the product roadmap. Speaking of the roadmap, we plan to add support for HTTP-based remoting, publish/subscribe API as well as audio/video streaming capabilities.

Enjoy!

RTMP for iOS is Coming Up!

If you have asked or thought of integrating iOS apps with RTMP servers, this might be of interest to you.. I thought I’d share a small sneak peak of a feature from the upcoming release of WebORB for .NET and WebORB for Java. Our server had supported RTMP for a long time for video streaming, recording, data push and remote shared objects. But now I’m happy to let you know that RTMP support for iOS is coming up! As you can see in the following screenshots, it is a sample application using Remote Shared Object hosted in a .Net backend and a remote method invocation (via RTMP); guys, this is only a tip of the iceberg…
RTMP on iPhone
Want to know more? Looking for video streaming solution for iPhone? Well guys, I’ve already said too much. Just stay in touch with us, and you will be able try it in the very near future.
P.S. …native? native! :)