I have successfully configured c2dm using google eclipse plugin and i
can successfully send messages to my android simulator from a GWT
based google app engine page.below is the code snippet that is
successfully sending cd2m messages:
final EventBus eventBus = new SimpleEventBus();
final MyRequestFactory requestFactory =
GWT.create(MyRequestFactory.class);
requestFactory.initialize(eventBus);
MessageRequest request = requestFactory.messageRequest();
MessageProxy messageProxy = request.create(MessageProxy.class);
messageProxy.setRecipient(recipient);
messageProxy.setMessage(message);
Request<String> sendRequest = request.send().using(messageProxy);
sendRequest.fire(new Receiver<String>() {
@Override
public void onFailure(ServerFailure error) {
sendMessageButton.setEnabled(true);
setStatus(error.getMessage(), true);
}
@Override
public void onSuccess(String response) {
sendMessageButton.setEnabled(true);
setStatus(response, response.startsWith("Failure:"));
}
});
However according to a requirment i need to send c2dm messages from a
web service. i have successfully configured a web service on my google
app engine server. but how should i replace the following line in my
c2dm webservice(web service is in the same web application project
that is successfully sending messages)
final MyRequestFactory requestFactory =
GWT.create(MyRequestFactory.class);
because i can't use GWT based code in web service. Please help
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en