Help - Search - Members - Calendar
Full Version: skype4java: chatmessage listeners not working
Skype Community > English > Development, Betas and Skype Garage > Skype Public API
indianethic
I am developing Java application using Skype4java. Eventhough i am declaring chat message listeners, i am not getting any events to process!! let me know if i need to change my code.


CODE

Text conferenceText = new Text(shell, SWT.BORDER | SWT.H_SCROLL                        |SWT.V_SCROLL|SWT.READ_ONLY|SWT.WRAP);

ChatMessageListener chatMessageListener = new ChatMessageListener() {
    public void chatMessageSent(ChatMessage sentChatMessage) throws SkypeException {}
        public void chatMessageReceived(ChatMessage received) throws SkypeException
    {
                    System.out.println("Chat message received:" + received.getContent());
                    if (received.getType().equals(ChatMessage.Type.SAID))
                    {
                            String message;
                            User senderName = received.getSender();
                            message = senderName + ":" + received.getContent()+"\n";
                            conferenceText.append(message);
                    }
          }
  };
Skype.addChatMessageListener(chatMessageListener);

chrbin
Did you manage to make the chatmessagelisteners work? I am facing the same problem...i don't seem to get any incoming events
Koji Hisano
In my environment (Skype 3.0.0.190), it works fine.
What's your Skype version?
indianethic
QUOTE(Koji Hisano @ Thu Dec 14 2006, 13:09) [snapback]331083[/snapback]

In my environment (Skype 3.0.0.190), it works fine.
What's your Skype version?


I was using skype 2.5 version.

Now i am using Swings for the GUI instead of SWT and i want some clarifications.

In skype4Java readme.txt file it was written that i need to include swt.jar all the time and since i dont want swt, do i have any alternative ?? Because all the time it gives Swt std error(java.lang.UnsatisfiedLinkError: no swt-win32-3232 in java.library.path) which is not at all related to my project.


I am using a Jlist in a frame which gets my friends list and displays in the list. But the application just hangs up, when it encounters Skype code stmt. I am including the code for convenience, please let me know if i am doing something wrong.


CODE

import com.skype.Skype;
import com.skype.SkypeException;
import com.skype.ChatMessageListener;
import com.skype.SkypeExceptionHandler;
import com.skype.User;
import com.skype.Chat;
import com.skype.ChatMessage;
import com.skype.ChatMessageAdapter;
import com.skype.ContactList;
import com.skype.Friend;

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.event.*;
import java.applet.*;


public class skypeConfInitiator  extends Applet
{



    public void init()
    {
        super.init();
        System.out.println("hi");
        Skype.setSkypeExceptionHandler(new SkypeExceptionHandler()
        {
            
            public void uncaughtExceptionHappened(Throwable e)
            {
                System.out.println("hi error");
                System.exit(1);
                }            
        });
            System.out.println("hi2");
       try
      {

            Skype.setDeamon(false); // <-- going to infinite loop here
            Skype.setDebug(true);System.out.println("hi3");
            //    Skype.setDebug(false);
                    if(Skype.isInstalled())
               {
                    System.out.println("Skype is Installed" );
                    if(Skype.isRunning())
                {
                                   System.out.println("Skype is Running" );
                            }
                        }
          }
         catch(SkypeException e)
        {

            System.exit(1);
            
        }

}


Koji Hisano
Skype4Java uses Win32 API to communicate with Skype because Skype API transport layer requires Windows specific mechanism.
Skype4Java is using SWT because SWT contains Java wrapper of Win32 API.
You have to setup native library folder path by "java.library.path" system property for SWT.
Mexxchen
Hi,

the ChatMessageListener test works fine. When I get a message it returns automaticaly the message. But not the CallListener sadsmile.png

I'm using the latest version 3.2.0.158 on all pcs. It's very weird because on one pc it works and on the other not.
benbloch
QUOTE(Koji Hisano @ Fri Dec 15 2006, 12:58) [snapback]331582[/snapback]

Skype4Java uses Win32 API to communicate with Skype because Skype API transport layer requires Windows specific mechanism.
Skype4Java is using SWT because SWT contains Java wrapper of Win32 API.
You have to setup native library folder path by "java.library.path" system property for SWT.


This is exactly what I need to do but for an applet. What does applet need to do then to load this dll? Does it need to write the dll to file system or does it just need to load it if already there?

Quick reply appreciated.

Thanks in advance

Ben
Patso
QUOTE(benbloch @ Tue Nov 20 2007, 20:19) [snapback]466080[/snapback]

This is exactly what I need to do but for an applet. What does applet need to do then to load this dll? Does it need to write the dll to file system or does it just need to load it if already there?

Quick reply appreciated.

Thanks in advance

Ben


Here is example for using Skype4Java in applet created by mehttp://forum.skype.com/index.php?showtopic=99779&hl=.

It also contains some sources. But for stable production release there is much to be done. But it looks like that the skype4Java project is not very active thats why I left this development - if you want the sources are in MIT license so you are free to use them and to finish finally the Skype4Java in applet smile.png
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.