-
Notifications
You must be signed in to change notification settings - Fork 48
Home
Sam Sun edited this page Feb 20, 2016
·
13 revisions
Skype skype = new SkypeBuilder(username, password).withAllResources().withExceptionHandler((errorSource, throwable, willShutdown) -> {
System.out.println("Error: " + errorSource + " " + throwable + " " + willShutdown);
});.build();
skype.login();
skype.subscribe();
// Do things
skype.logout();
Skype skype = new SkypeBuilder(username).withAllResources().withChat("19:[email protected]").withExceptionHandler((errorSource, throwable, willShutdown) -> {
System.out.println("Error: " + errorSource + " " + throwable + " " + willShutdown);
});.build();
skype.login();
skype.subscribe();
// Do things
skype.logout();
Skype skype = ...;
skype.setVisibility(Visibility.ONLINE);
Chats are not loaded until they are needed (eg a message was sent in the chat). If you want to use a chat then you may need to load it first.
Skype skype = ...;
Chat chat = skype.loadChat("19:[email protected]");
If you are lazy, you can always use Skype#getOrLoadChat
Skype skype = ...;
Chat chat = skype.getOrLoadChat("19:[email protected]");
Messages can contain 'plain' text if the text has no formatting, or 'rich' text if it does. If you want to specify your own HTML you can use Text.raw(String)
Chat chat = ...;
chat.sendMessage(Message.create().with(Text.plain("Hello. This will be ")).with(Text.rich("bold").withBold()));
The event queue will begin once you have subscribed to Skype. You may listen to events by registering a Listener.
Skype skype = ...;
skype.getEventDispatcher().registerListener(new Listener() {
});
For more advanced features, feel free to explore around. You'll find lots of cool things you can do with Chats, Contacts, and more.
You may find the JavaDocs helpful