0

I tried to work out the very basic cloud storage which follows below. Often i am getting an exception and in Logcat i am getting Unsuccessful while checking the overridden method.

package com.parse.starter;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;

import com.parse.ParseAnalytics;
import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.SaveCallback;


public class MainActivity extends ActionBarActivity {

  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);

    ParseObject score = new ParseObject("Score");
    score.put("username", "dinesh");
    score.put("score", 123);
    score.saveInBackground(new SaveCallback() {
      @Override
      public void done(ParseException e) {
        if (e == null) {
          Log.i("info", "Successful");
        } else {
          Log.i("info", "Unsuccessful");
          e.printStackTrace();
        }
      }
    });

    ParseAnalytics.trackAppOpenedInBackground(getIntent());
  }
}
4
  • Possible duplicate of com.parse.ParseRequest$ParseRequestException: invalid session token Commented Feb 23, 2016 at 11:57
  • You know that the Parse cloud will be switched off in Jan. 2017? Commented Feb 23, 2016 at 12:17
  • @Harshad This question belongs to store very basic information in Parse Cloud not to validate the credentials.All right Commented Feb 23, 2016 at 12:20
  • @ Robert yes.But they are giving everything as an open source along with the developer tool where we can customize as per our client requirements. Commented Feb 23, 2016 at 12:22

1 Answer 1

0

Make sure you are initializing parse with credentials

Parse.enableLocalDatastore(getApplicationContext());
Parse.initialize(this, "YOUR_APP_ID", "YOUR_CLIENT_KEY");
ParseUser.enableAutomaticUser();
ParseACL defaultACL = new ParseACL();
ParseACL.setDefaultACL(defaultACL, true);
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.