I am tring to implement GCM. I wrote a test code to understand how it works, but I keep getting error 400 in the response.
I\'m writing in Java (JDK 7).
I follow
The problem was in DataOutputStream.writeChars() and DataOutputStream.writeUTF().
Thanks to the link given by @Koh, I changed the write command in the post function to:
wr.write(json.getBytes("UTF-8"));
Now the message is being sent successfully!