|
From: | ThinkinBunny |
Subject: | [Linphone-developers] linphone android can't receive message |
Date: | Sat, 15 Feb 2014 16:42:50 +0800 |
public void launchTutorial(String destinationSipAddress)
throws LinphoneCoreException {
// First instantiate the core Linphone object given only a listener.
// The listener will react to events in Linphone core.
LinphoneCore lc = LinphoneCoreFactory.instance().createLinphoneCore(
this);
try {
// Next step is to create a chat room
LinphoneChatRoom chatRoom = lc
.getOrCreateChatRoom(destinationSipAddress);
// Send message
LinphoneChatMessage chatMessage = chatRoom
.createLinphoneChatMessage("Hello worldHH");
chatRoom.sendMessage(chatMessage, this);
// main loop for receiving notifications and doing background
// linphonecore work
running = true;
while (running) {
lc.iterate();
// System.out.println("query");
if (chatRoom.isRemoteComposing()) {
System.out.println("TutorialChatRoom.isRemoteComposing()");
}
try {
Thread.sleep(50);
} catch (InterruptedException ie) {
ie.printStackTrace();
write("Interrupted!\nAborting");
return;
}
}
} finally {
write("Shutting down...");
// You need to destroy the LinphoneCore object when no longer used
lc.destroy();
write("Exited");
}
}
[Prev in Thread] | Current Thread | [Next in Thread] |