Connecting Android to JDEROBOT through ICE

Today, it seem impossible that we can’t control anything from our mobile device. I’m using JDEROBOT software to create a video-surveillance system based in software libre and low cost hardware.

A good feature for this system is the total control from the mobile device. In this case, we use a Android device (HTC Magic) and our problem is connect both systems: JDEROBOT (linux) and SecurityApp (Android). There are many options for this as: rpc, webservice (xml+soap) or some distributed framework. We opted for ICE (Internet Communications Engine) that is a distributed system based in definition of interfaces language.

“The Internet Communications Engine (Ice) is a modern object-oriented toolkit that enables you to build distributed applications with minimal effort. Ice allows you to focus your efforts on your application logic, and it takes care of all interactions with low-level network programming interfaces. With Ice, there is no need to worry about details such as opening network connections, serializing and deserializing data for network transmission, or retrying failed connection attempts (to name but a few of dozens of such low-level details).”

· The Android/Java Code: We try show the image captured by webcam in the Android mobile.

 Ice.Communicator communicator = Ice.Util.initialize();
 Ice.ObjectPrx base =
     communicator.stringToProxy("varcolorA:tcp -h -p 9999");

 // Varcolor and Image are interfaces defined by us.
 if (base == null)
    Log.e("Main","Could not create proxy");
     VarColorPrx vprx = VarColorPrxHelper.checkedCast(base);
    if (vprx != null) {
        ImageData image;
        image = vprx.getData();

        // In image variable we obtain the image data.

Easy, right? 😉

· The Result: The next photo shows how the android mobile can show the image captured by webcam. The webcam is connected to laptop where JDEROBOT is running.



facebooktwittergoogle_pluslinkedinmailby feather
This entry was posted in android, jderobot, Uncategorized. Bookmark the permalink.

One Response to Connecting Android to JDEROBOT through ICE

  1. Fadi says:

    thanks a lot for your tuto, In fact I’m having a similar proble in connecting my linux runing server ( linux) and the android client, I can’t genrate IceAndroid.jar to integrate it with eclipse.

    could you help me with this please .

Leave a Reply

Your email address will not be published. Required fields are marked *