Sunday, April 24, 2011

Skype4Java Mavenized API released!

I'm glad to announce that I have released the first version of the mavenized skype api to the maven central repo:

First version is 1.1 (err, don't wanna talk about 1.0 :P), please enjoy!

I actually thought I would have more trouble to release the project in the central repo, but it was actually quite easy. Ok, there are several requirements, but they are easy to meet. The only "tricky" one was that I needed a valid domain to use as groupId. At first, I thought I would have to pay for a domain and keep it forever, but then I found out that I could use github's domain for this purpose (as you will notice if you read the pom).

I would like to thank Koji Hisano, I got in touch with him by mail to ask whether he would be okay with this move, since I mostly copied his project, and I got full support from him.

Now, all of you who'd like to use Skype4Java / Skype Java Api, please enjoy and feel free to talk back.

This version should support:

- Windows 32 and 64 bit
- Linux 32 and 64 bit
- Mac OS 32 bit

It is possible to run under MacOS 64 bit with compatibility mode (java -d32).

See ya!

Sunday, April 17, 2011

Removed SWT support and XCode build files

In the end, the API will be released without support for using the SWT version of the Windows API. I got it working pretty well using the DLLs, so it will never be an option to use the SWT version ever again.

Besides the obvious reason for not having to support and waste time a redundant alternative, I have a much more important reason to give up on SWT: the fact that it is not available as a maven dependency in the central repo. That would prevent me from deploying the project in the central.

The next thing I removed completely: any sort of support for XCode. There are just a makefile to handle the whole process, so the build is straight forward: make<enter> from the command line! The make file just requires g++4.2 installed, so it already uses only free and simple tools to build.

The windows DLLs are also buildable from the command line now, but it still requires Visual Studio's installation. In the future, I'll try to build it using mingw to build the DLLs, but I'll certainly leave that for the next version.

Anyway, this sort of stuff is only needed for those wishing to rebuild the native libraries.

Release is closer than ever... again

Well, since my last post, I actually didn't thought about Mac. Then, I decided to make sure the API was working on Mac and it was a hell of work to get it even compiling.

The first problem was how to start testing. I don't own a mac and I sure wouldn't buy one just to code a few lines. I found a virtualbox image on torrent and tried to start it. The first problem, it wouldn't kick in, because the image requires VT-x and I was not pleased to find out that my Vaio didn't have the option to enable it in the BIOs. In the end, I found out that my model had a BIOs update at Sony's site that enables the hardware virtualization option.

Ok, image up and running, I tried to run skype2gmail... and it obviously didn't work. It complained on the native library, that it was not build for my OS archtecture (64bit).

Ok, next problem, how to compile the native code? I never programmed for Mac, so I had some trouble finding out that I needed XCode to build it. Ok, I got it (XCode 3.x) and the next problem: it required another Leopard version. Actually, I just had to download 4Gb of updates or so to get it to accept XCode.

After so long, I got it working and tried to build the project, just to find out that it wouldn't because of deprecated jam targets (then I found the project was originally made for Project Builder, the XCode predecessor).

Well, I was so pissed that XCode completely refused to upgrade the jam targets and did not provided any clue on how to redo it, that I almost gave up on mac support. But I finally cooled off, and tried to understand the project's text file to find out what it was trying to do. I figured it out eventually and remade the build files, to use ANT, MAKE and NO xcode at all. HA! Take that damn xcode! :P

The next problem was to the Skype.framork shared library. It required to install the damn thing in a fixed relative place. I didn't want to force the user to install anything in his OS to run skype2gmail. So I decided that the framework should be inside the jar somehow, but this left some problems: first, I would have to extract it at runtime and I would have change its install name. I tried to change the install name using install_name_tool, but it didn't work at all. I ended opening the binary with a hex tool and changed the path inside the binary by hand. It worked like a charm and know I have the library working without any external dependency,

The last problem was that the library wasn't working at all. I found out that mac's Skype did not replied the GET CHATMESSAGE appropriately, starting the reply with CHATMESSAGE. It insisted in replying with "MESSAGE" instead. Obviously, the API was not prepared for that and didn't recognize the reply. I fixed in the native library to prepend the "CHAT" part if the reply started with "MESSAGE".

In the end, I got it working. Still, the mac api version, like the first linux api version, is not very consistent. Sometimes, skype just doesn't reply the CHATMESSAGE reply. I noticed that sometimes, Mac's Skype was very slow to reply. I may improve stability just by increasing the timeouts.

Anyway, I now have that nice feeling of overcoming a hard challenge, since it works ;)