I've started on making my own Skype app using Java Skype Api from taksan
https://github.com/taksan/skype-java-api
(I prefer Java instead of C# because I don't know C# yet)
But my simple method on sending message doesn't work. I don't know if I'm missing something or they updated skype and therefore this api is outdated.
I tried two methods in Java FX called from a button. Both should send testing message to one of my friends. And yes, I've allowed the program in skype.
private void sendMsg2() throws SkypeException {
Skype.chat("skype_ID").send("Sending test message ...");
}
private void sendMsg(Friend[] friends) throws SkypeException {
for (Friend akt : friends) {
if (akt.getId().equals("friend's skype ID")) {
akt.send("Test message 2");
System.out.println("Sending test message 2...");
}
}
}
Both have same results. Message won't send. Look at the picture: http://imgur.com/dfXyV1t
I'm trying to send message to one person (so it's not chat group). Any suggestions please?
Related
I am developing UI Automation for testing a web app and currently confronted with, writing a test method to track if an email notification has been sent to a recipient. BUT, the challenge here is NOT to wait for some time and then checking in the recipient's mail box, but to be able to track the outgoing request for verification on the Web App itself.
Here is my current Code checking if mail URL is there or not after triggering the email notification.:
#Test
public void chkEmailNotif() {
try {
PO.clickEmailUrl(); //PO is a page object class
assertTrue(PO.MailFrameSeen());
PO.clickYes();
System.out.println(" Clicked on Yes button of the Mail frame Box ");
assertFalse(!PO.isMailurlSeen());
} catch (Exception e) {
System.out.println ("Catched exception e" + e )
}
}
Any suggestions are welcome.
Thanks in advance.
Mock the mailbox and check the message is sent. Set the configuration to use the mock or the real mailbox in a file that changes with the environment.
when a user executes a command, I would like to send the output back to only that user, not the channel.
I'm using the PircBotX framework.
My Code:
public void onMessage(MessageEvent<PircBotX> event) {
if (event.getMessage().equalsIgnoreCase("!test")){
event.respond("Test Successful.");
}else if (event.getMessage().split(" ")[1].equalsIgnoreCase("!test2")){
event.getChannel().send().message("this response works");
event.respond("This response works");
event.getUser().send().message("but this does not work");
}
}
According to the documentation, event.getUser().send().message("XYZ"); should be a private message.
The documentation also states bot.sendMessage should be a private message, but that this doesn't work either.
For both of these, the console output looks completely normal.
One thought I have as to the origin of the issue: I'm building this as a Twitch.tv chat bot. It is possible (although their API page does not mention this) that private messages are disabled.
are you trying to send a whisper ?? if so take a look at this https://discuss.dev.twitch.tv/t/sending-whispers-with-my-irc-bot/4346/6 you need to connect to an extra irc server to send whisper/private messages
try event.respondPrivateMessage("response");
See pirocbotx-docs->MessageEvent.respondPrivateMessage(String response)
I have my NFC class which I assume people know what it looks like if you are looking at this question. So OnCreate, I do:
mNfcAdapter.setNdefPushMessageCallback(this, this);
to be able to send messages and then I do:
public NdefMessage createNdefMessage(NfcEvent event){
NdefMessage msg;
msg = new NdefMessage(new NdefRecord[] {
createApplicationRecord(this.messageToSend.getBytes())
});
return msg;
}
to send my message. and I have some code to receive a message as well but then I want to send another message back while the devices are still in "Connected" mode. How can I manually give a "send message" command?
Your application gets a single chance to send out the message using setNdefPushMessageCallback. Once the message has been transfered you get the completionCallback (if you want to). Afterwards you can't interact with NFC anymore.
Sending a second message after you got your completion is unfortunately not possible with the API as it is right no.
Technically there is no reason for this by the way. Google could add the functionality with ease. It would only take them a day or two. In Android 2.3 there already was an undocumented way to access the LLCP (base protocol of Android Beam) protocol from applications. This is gone since Android 3.0
I want to send a Push Notification message to particular iPhone device using Java.
I dont have any idea how to do this.
I have googled on this, they have suggested to use "PayLoad" class but not getting this class from any jar files.
Please anybody can guide me to send the push notification message to iPhone suing Java?
Use JavaPNS. Here is an exaple:
import javapns.Push;
public class PushTest {
public static void main(String[] args) {
Push.alert("Hello World!", "keystore.p12", "keystore_password", false, "Your token");
}
}
Use parse sdk from www.parse.com , it helps in delivers a good way to handle push notification between ios and android(offcourse its java). Its really simple to work along with it..
The example on the parse.com site is not good for android, so i am giving the link of the site where the steps are much easier to work with
http://developingonandroid.wordpress.com/2011/11/24/3-android-push-notifications-in-parse-a-deep-overview/
I am trying to get started with WebSockets, and trying to write a simple application to send messages back and forth via a websoket.
However, it looks like the socket that I am trying to create never gets connected. Why can that be?
Below is the code of my WebSockets class. When .onConnect() is called, it logs:
I am socket, I was connected. Am i connected? - false
Update: in JavaScript, where I create the socket in question, the readyState is 1, which means "socket open, communication is possble".
import a.b.Misc; //writes logs.
import com.sun.grizzly.websockets.BaseServerWebSocket;
import com.sun.grizzly.websockets.DataFrame;
import com.sun.grizzly.websockets.WebSocketListener;
public class ChatWebSocket_v2 extends BaseServerWebSocket {
private String user;
public ChatWebSocket_v2(WebSocketListener... listeners) {
super(listeners);
}
public String getUser() {
if (user == null) {
Misc.print("User is null in ChatWebSocket");
throw new NullPointerException("+=The user is null in chat web socket");
}
return user;
}
public void setUser(String user) {
Misc.print("Just set user: " + user);
this.user = user;
}
#Override
public void onMessage(String message) {
Misc.print(message +"\n");
}
#Override
public void onMessage(byte[] message) {
Misc.print(new String(message) +" << Bytes\n");
}
#Override
public void onConnect() {
Misc.print("I am socket, i was connected. Am i connected? - " + this.isConnected());
}
#Override
public void onClose(DataFrame df) {
Misc.print("I am socket, i was closed");
}
}
If you're just trying to make a connection somewhere, you might want to try this instead. There is a live working demo and you can download the javascript code and play with it yourself. Note that the javascript code only works if you have it installed on a server (due to browser security because it's 'fancy'.) There is also a step by step browser-based client tutorial in the works that I will post as soon as it's ready. Most proxy servers haven't been upgraded to handle websockets so they will screw up connection request and most people won't be able to connect to websocket servers from work. Firefox 7 (release) or Google Chrome 14 or later support the latest version of the websocket protocol that the demo server runs.
If you want to try to get the grizzly demo working, you might have some debugging to do and maybe I'll help with that. Note that in comments below the article, other people said they couldn't get it working either and I haven't found any follow up. At this point it seems no better than the echo app above even if we do get it running and is possibly overly complicated and underly documented if you're just trying to get started. But if you want to try to get it running, you should 'git' the latest version of the code here, which was at least committed recently and may be fixed.
Then make sure that app.url in the application javascript file is set to your installation directory. His is hard-coded as:
url: 'ws://localhost:8080/grizzly-websockets-chat/chat',
If you're using Firefox 7, the javascript needs to be modified to use the Moz prefix, for example:
if (typeof MozWebSocket != "undefined") { // window.MozWebSocket or "MozWebSocket" in window
ok
} else if (window.WebSocket) { // he uses if ("WebSocket" in window)
ok
} else {
do your print "browser doesn't support websockets"
}
.... then if the browser supports websockets
websocket = new WebSocket(app.url); or
websocket = new MozWebSocket(app.url);
// depending on which it is.
The HLL websocket server demo code has this all sorted out.
(another) UPDATE: As I work through grizzly myself, I found on the Quick Start in the glassfish admin console, there's a hello sample that's pretty easy to set up and run. You'll find instructions there. The sample directory also contains a war file named: websocket-mozilla; so I guess its supposed to use websockets. Someone who's familiar with jsp should review the source code. All I can see is that it's using an http session. No mention of a websocket at all. It's a lot like the hello sample.