0
votes

Hello friends i starting learn about google cloud save, so i create apps and follows step given in google.developer and i am also using their example using link https://github.com/GoogleCloudPlatform/solutions-mobile-backend-starter-android-client and https://developers.google.com/cloud/samples/mbs/android/ but i think i face some problem in autentication, and got error com.google.api.client.googleapis.json.GoogleJsonResponseException: 404 Not Found

and some time : com.google.api.client.googleapis.json.GoogleJsonResponseException: 401 Unautorized

i just want to store my game score using google cloud save.please any one can give me solution about it or any related links ? thanks in advance.

2

2 Answers

1
votes

I find my own solution : I follow following step :

hope these help you if necessary :

Assume you are created project on https://console.developers.google.com/ and follow necessary step like

In API & AUTH -->APIs Google cloud Storage and Google cloud Messaging for android and whatever you need On

In API & AUTH -->Credentials Create new Client ID for

-->Client ID for Android Application and
-->Client ID for Web Application
-->Key for server applications

(1) Open the Google API Console and make sure your Mobile Backend project is the active project by selecting it in the projects pulldown menu in the top left.

(2) Click Services.

(3) Locate Google Cloud Messaging for Android in the list of available services, and click the ON toggle.

(4) Accept the Terms of Services if you have not already.

(5) Click API Access in the top left of the API console.

(6) Scroll down to click Create new Server key... You don't need to supply any IP values in this form. (Using a server key allows you to whitelist IP addresses).

(7) Click Create.

(8) Locate the API key within the Key for server apps form and copy this key to the clipboard.

(9) Navigate to .appspot.com. This will bring you to your Mobile Backend Starter settings configuration page.

(If not find then find from : click on your created project from the https://console.developers.google.com/ click on your created project Monitoring-->overview-->find Mobile Backend Starter from the bottom- of the screen click on that )

(10) Follow all three step of Deployment steps:

-->Deploy the backend

-->Open (for development use only) the backend to accept incoming requests via Settings

  click on Settings-->Mobile Backend settings-->
  ---> Radio button on of **Secured by Client IDs (Recommended)**
  ---> Enter **Android Client Id, and Web Client id**
  ---> Google Cloud Messaging and iOS Push Notification **Enabled**
  --->**Save**

-->download Sample Project if necessary

In sample project open Const.java file

 Enter project_id,
 Project_number,
 Web_client_id(enter client_id_for_web_application here )

 public static final boolean IS_AUTH_ENABLED = **true**;
 public static final boolean LOCAL_ANDROID_RUN = **true**;
 public static final String ENDPOINT_ROOT_URL = "https://" + PROJECT_ID
        + ".appspot.com/_ah/api/";

If Necessary go to : App Engine Console -> Main -> Versions. ( https://appengine.google.com/ ) select your project

There you will see a list of versions with a Make Default button below. Select the radio button for the latest version and press the make default button, wait a minute or so, and try your call again.

Note that even if you have only one version that is already set as the default this solution should still work.

You may have to do this again the next time you deploy to app engine.

Hope my above step helping to anyone.

0
votes

Faced this error when I had not deployed the latest version of backend to the google app engine. HTH