2
在Linux(Ubuntu的14.04),此代碼後掛起 「得到聯繫人列表」 印:什麼是正確的com.skype。*使用Linux?
package skype;
import com.skype.ContactList;
import com.skype.Friend;
import com.skype.Skype;
import com.skype.SkypeException;
public class ContactLister {
public void getAllFriend() throws SkypeException, InterruptedException {
System.out.println("starting...");
ContactList contactList = Skype.getContactList();
System.out.println("got contact list " + contactList.toString());
Friend friends[] = contactList.getAllFriends();
System.out.println("got friends");
System.out.println(friends.length);
for (Friend friend : friends) {
System.out.println("Friend ID :" + friend.getId());
Thread.sleep(100);
}
}
public static void main(String[] args) throws SkypeException, InterruptedException, SkypeException {
new ContactLister().getAllFriend();
}
}
檢查庫,com.skype.connector
似乎使用JNI
到與Skype連接。至少對我而言,連接似乎永遠不會發生。
它甚至可以使用它來連接到Skype?我怎麼知道爲什麼它不是(顯然)連接?
[email protected]:~$
[email protected]:~$ java -jar NetBeansProjects/Skype/dist/Skype.jar
starting...
got contact list [email protected]
^[email protected]:~$
[email protected]:~$ skype --version
Skype 4.2.0.11
Copyright (c) 2004-2013, Skype
[email protected]:~$
這個答案:http://stackoverflow.com/a/2945519/262852沒有爲我工作。 – Thufir
我認爲這是git repo:https://github.com/lemmy/skype4java它似乎死了,請求新的維護者。 – Thufir