Issue
I am trying to learn about GCM and a newbie at this...I am running the demo at: http://developer.android.com/guide/google/gcm/demo.html. However, I can get my device(HTC S) registered because of the following error:
java.net.ConnectException: failed to connect to localhost/127.0.0.1 (port 8080): connect failed: ECONNREFUSED (Connection refused)
In my Activity I am getting this message : From GCM: device successfully registered!
And then getting these messages: Trying (attempt %1$d/%2$d) to register device on Demo Server
These are the parameters for my application:
static final String SERVER_URL ="http://localhost:8080/Server_Demo";
static final String SENDER_ID = "902733651294";
I have a hunch that this has to do with how my network is defined on my computer and/or my device... Any help would be greatly appreciated!
EDIT: Picture of web server thru a "Dynamic web project" using Eclipse.
Solution
The demo server is not running on your phone's localhost (i. e. the phone itself), that's for sure. Is it running anywhere? First deploy the demo server, then change SERVER_URL accordingly.
In general, GCM assumes that you have some cloud infrastructure (i. e. a hosted Web server somewhere). That's what C stands for.
Answered By - Seva Alekseyev
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.