Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where to put google-services.json file into eclipse project?

I'm trying to implement the new GCM client on Android.

At one point, you have to enable Google Services for the app. After enabling Cloud Messaging you have to download the file google-services.json and put it in the app/ or mobile/ directory. The problem is that in my eclipse project this directories doesn't exist.

enter image description here

So my question is: where do I have to put this file?

like image 426
blackwolf Avatar asked Jun 08 '15 07:06

blackwolf


People also ask

Where should I place Google services json?

The google-services. json file is generally placed in the app/ directory (at the root of the Android Studio app module).

Should I push Google services json?

The general answer is yes, the google-services. json is safe to check in to your repo and is something that should be shared among engineers on your team. The JSON file does not contain any super-sensitive information (like a server API key).

How can I add two Google services json in the same project?

There is no way to use two google-services. json files in a single Android app. The file name is the same between them and they need to be in the same location. So one will overwrite the other in that case.


1 Answers

It seems that for eclipse that file is not necessary. I've managed to make the client work without it.
Just follow the steps from Implementing GCM Client on Android and skip the part with the google-services.json file.

UPDATE: For Android Studio the instructions are pretty clear. The file must be put in the app/ directory of your project: https://developers.google.com/cloud-messaging/android/client#add-config

P.S. Any vote down should go along with the reason specified in a comment, or not? :)

like image 56
blackwolf Avatar answered Oct 21 '22 20:10

blackwolf