Showing posts with label Programmer's Hacks. Show all posts
Showing posts with label Programmer's Hacks. Show all posts

Saturday, February 25, 2012

XMPP/GTalk Shell Connector for Apache Karaf / Felix GoGo


Connecting Felix GoGo Shell through XMPP / Google Talk ?

I did a pretty interesting experiment (and will be useful at least to myself) connecting the Felix GoGo Shell in Apache Karaf/ServiceMix to XMPP/Google Talk Instant Messaging Protocol via Smack library. I spent almost 24 hours just for this. The results is pretty amazing though. :-)

I also spent quite some time to make ANSI colors sort of "working". It's not strictly correct, but at least it's not entirely boring.

What do you think ?

UPDATE: The OSGi Blueprint-compatible XMPP Shell connector is available as open source with Apache License 2.0 at https://github.com/soluvas/com.soluvas.shell.xmpp

Recommended Resources
For more in-depth explanation on OSGi, I highly recommend OSGi in Action: Creating Modular Applications in Java.

Saturday, January 9, 2010

Cross-Platform Desktop Application Frameworks: Which One to Choose?


Desktop applications aren't dead yet, in my opinion. I still prefer email client, Twitter client, IM client, office apps, and many others on the desktop instead of using my web browser for that.

There are several desktop application frameworks for your development appetite, all with its own strengths and weaknesses. Which one is the best?

Java Desktop Application Frameworks


When looking at desktop application frameworks in Java, obvious choices are:
Java applications run on all major desktop platforms. It potentially runs on advanced mobile platforms, such as Nokia's Maemo, Intel's Moblin, and Google's Android.

I personally think Eclipse RCP is more powerful than NetBeans', and I'm not alone. You can see that from its usage on many commercial applications: SpringSource Tool Suite and JBoss Developer Studio among those.

The slight downside of Java is the user need to have Java Runtime installed. There are many ways to make this part of user experience much smoother.

C++ Desktop Application Frameworks


You can also go native, with C++ your choices are:
I have some experience with Qt development, and it's quite pleasant. Qt applications run on all desktop operating systems equally well, with initial support for Maemo, Symbian S60, and Windows Mobile (WinCE) mobile devices.

Most, if not all, KDE applications use Qt. Examples include the high profile Amarok music player, Kontact organizer, and KOffice desktop suite. Which proves Qt as suitable for complex applications.

Current Symbian devices can already run Qt apps with additional Qt runtime. Nokia featurephones and smartphones sometime in 2010 will have Qt support out-of-the-box.

Mozilla RCP is a higher-level framework than Qt, and powers an impressive portfolio of Firefox, Thunderbird, Sunbird, Songbird, Firefox Mobile (Fennec), and ActiveState Komodo.

Hybrid Web/Desktop Application Frameworks


If you love Web Technologies, these tools may be interesting to you:
Both alternatives have a similarity: they allow you to write applications with HTML, JavaScript, and CSS, with some proprietary JavaScript API for native functionality.

Titanium has an interesting advantage: apps can be run on iPhone and Android devices with Titanium Mobile.

Your code is potentially reusable for a web application frontend.

What about Mono?


I intentionally left out CLR (Common Language Runtime), more popularly known as the Microsoft .NET Framework. It's Java's most fierce competitor.

.NET has varying degrees of support in different platforms. Windows has the best support, followed by Linux and Mac OS X using Mono implementation, then Windows Mobile devices with .NET Compact Framework.

If you develop using Visual Studio 2010 (in Beta as of this writing), for example, you app will most likely not run under Linux. Add to that the continuing licensing issues. So I don't consider it "cross platform enough".

Anyway, I loved the C# programming language.

So, The Answer is...?

My conclusion is, it depends on your use case. I have a few suggestions though:
  • If it's a complex desktop application, go with Eclipse RCP. It will be more maintainable in the long term, and your Java code should be reusable.
  • If any of these is important to you: reusing code across platforms, Nokia devices, you love C++, you want as native as possible, seamless installation, small footprint; go with Qt.
  • If you love working with web technologies, and/or your application deals more with fluid user experience than processing data locally; go with Titanium Desktop.
What's your preferred framework?

Get Started with Eclipse RCP

To get started developing rich desktop applications with Eclipse RCP, grab the book Eclipse Rich Client Platform, Second Edition.

Friday, January 8, 2010

Installing Voxeo Prophecy 9 on Ubuntu Karmic Koala 9.10

Voxeo Prophecy is an IVR (Interactive Voice Response) speech server supporting VoiceXML, ccXML, SCXML, SIP, and related standards.

Prophecy only officially supports Red Hat Enterprise Linux (RHEL), but with some tweaks, it can be configured to run on Ubuntu.

Installing Voxeo Prophecy on Ubuntu


After you download Voxeo Prophecy, you need to do some preparation steps:
  1. Create symbolic links for supporting libraries:
    sudo su
    ln -s /lib/libssl.so.0.9.8 /lib/libssl.so.6
    ln -s /lib/libcrypto.so.0.9.8 /lib/libcrypto.so.6
    ln -s /usr/lib/pm-utils/functions /etc/init.d/functions
    ln -s /lib/libcap.so.2 /lib/libcap.so.1
  2. Still as root, install Voxeo Prophecy:
    ./prophecy-9.0.38536.0-small-tts-ds-vm.bin
    The installation should finish successfully, although with "some errors.":
    The installation of Voxeo Prophecy is finished, but some errors occurred during the install.  Please see the installation log for details.

  3. If you have a license, copy license.xml to /opt/voxeo/config.
    If you don't have a license yet, follow instructions to run Voxeo Prophecy below and get a license as soon as possible. If your Voxeo Prophecy trial installation license expires, you will not be able to generate a license automatically and must contact Voxeo support to get a license. (believe me, I've been there)
  4. Create the /var/lock/subsys directory:
    mkdir -p /var/lock/subsys

Prophecy is now installed on your Ubuntu system.

Starting Voxeo Prophecy on Ubuntu


To run Prophecy, you cannot use "prophecy start". You need to run these commands manually:
sudo su
/etc/init.d/voxeo-vdirectory start
/etc/init.d/voxeo-vmc start
/etc/init.d/voxeo-vsipmethod start
/etc/init.d/voxeo-vserver start
/etc/init.d/voxeo-vxml start

Shutting Down Voxeo Prophecy on Ubuntu


To stop/shutdown Prophecy, run these commands:
sudo su
/etc/init.d/voxeo-vxml stop
/etc/init.d/voxeo-vserver stop
/etc/init.d/voxeo-vsipmethod stop
/etc/init.d/voxeo-vmc stop
/etc/init.d/voxeo-vdirectory stop

Uninstalling Voxeo Prophecy


Uninstallation process is still the same, run the following commands:
sudo su
/opt/voxeo/Uninstall/Uninstall_Voxeo_Prophecy
rm -rf /opt/voxeo

Why Voxeo Prophecy?


You might be wondering what an IVR server is doing on a Spring/Java EE blog.

I feel that this information could be useful to others, and I can't find a better place to publish it. :-)

Who knows maybe you're also working with IVR?