0

I can't find this question answered (or addressed) anywhere else, so maybe I am just missing something really obvious, but I have followed these official GCM steps to get GCM added to my Android project and have got stuck.

My first issue is that the documentation states...

...copy the Server API key. Before running the app, you'll need to add this as the value of API_KEY in line 31 of GcmSender.java.

...but what/where is GcmSender.java?

And, my main question, how/where do I specify the URL of my application server in my Android project?

NB - I am using Android Studio. I haven't created my application server yet, but will be doing so with a PHP script that uses HTTP messaging.

ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253

2 Answers2

1

The first step is creating a new project at Google Developers Console . At this step, for simplicity, you just need to take note of 2 values: Project Number, which will be used as SENDER_ID in a client project; and API server key (created at Credentials), which will be used as API_KEY in a server project.

You can find more at my simple guide at the following questions:

Adding Google Cloud Messagin (GCM) for Android - Registration process

How to implement a GCM Hello World for Android using Android Studio

Hope this helps!

Community
  • 1
  • 1
BNK
  • 23,994
  • 8
  • 77
  • 87
0

Have just found it.

In the RegistrationIntentService.java file, there is an empty sendRegistrationToServer(String token) method, so the URL of my application server (and the rest) needs to go in there.

ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
  • NB - `RegistrationIntentService.java` is one of the GCM-related files that can be found in the example project at https://github.com/googlesamples/google-services . – ban-geoengineering Sep 08 '15 at 14:13