0

I am using Parse.com for communicating with iOS application and Web Browser. I have registered in parse.com and created an application. Now I have an iOS application ready to insert an object in that application which is working fine. Now comes the backend part, I am using JAVA for web application. Now,

https://parse.com/docs/api_libraries

According to this link, I can see the API/ Libraries I can use in JAVA is

Almonds mobile-parse-api Parse4j ParseFacade

Among this 4, I have selected Parse4j to build web application with.

I am using Eclipse, I have installed GWT plugin, created a web application. Now I am adding this parse4j.jar file to that project, Added it to the build path also. And then I try to write this code

try {

        Parse.initialize("my app id", "my rest app id");        

        ParseObject gameScore = new ParseObject("GameScore");
        gameScore.put("score", 1337);
        gameScore.put("playerName", "Sean Plott");
        gameScore.put("cheatMode", false);
        gameScore.save();

        return "OK";
    } catch(IllegalArgumentException e){
        e.printStackTrace();
        return "KO";
    }
    catch(ParseException e){
        e.printStackTrace();
        return "KO";
    }

It doesn't insert the object to parse cloud. Please help why isn't working? Am I missing anything to write?

1
  • Can you please explain me bit about how you are using Parse4j to create your web application. I am newbie to parse API. Thanks in advance. Commented Jul 16, 2015 at 5:09

2 Answers 2

1

As far as I see, the code is correct. However, if Parse4j does not save the entry this means that you write wrong the attribute name or class name. Just check the names and class name then reply back.

Regards.

Sign up to request clarification or add additional context in comments.

Comments

1

One way to validate is the do a Query, get the object and print all the attributes / data types. Then store these as static class level constants and use them throughout your class for setting values in new objects to persist.

If the get query doesn't work (without any filters), which means your class name is incorrect.

Good Luck!

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.