[Jderobot-dev] Connecting Android to JDEROBOT through ICE

jde-developers jde-developers en gsyc.es
Lun Jul 1 11:57:00 CEST 2013


Jderobot, technology that rocks has posted a new item, 'Connecting Android to
JDEROBOT through ICE'


Today, it seem impossible that we cant control anything from our mobile device.
Im 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 193.147.51.113 -p 9999");

 // Varcolor and Image are interfaces defined by us.
 if (base == null)
    Log.e("Main","Could not create proxy");
 else
 {
     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.



Test Android-JDEROBOT-ICE


You may view the latest post at
http://blog.rocapal.org/?p=34

You received this e-mail because you asked to be notified when new updates are
posted.
Best regards,
jde-developers
jde-developers en gsyc.es



More information about the Jde-developers mailing list