To have a break from fish this evening decided to set up a highscore board as a test case for JSON and online storage for Endure.
The best thing is the price… free!
I did try out the Android sample project but without your app being Andriod as expected there was no way to use the .Jar libraries that Parse provide, but they do offer a great Restful method to POST and GET your data.
Custom Parse Class
I wrote a very simple Java class and imported Java’s own Net and IO libraries did not take long to get some scores in and out of the service.
LibGDX has its own Net library so I also gave this a go as my code looked messy, have some speed tests to run yet but happy to be able to push and pull data for free and with no real hassle.
I will not go through my code put post the class for you to see, the important lines here are:
While looking how others use Parse with Java I saw a lot of complaints about unauthorized errors, Parse provides many different keys and you have to set and use the right ones.
Code adding hard coded score and retrieving all scores
Lots of testing left to do with this and of course will need to ask the user their name (@twitter_tag) when they start the game, will use this for the upcoming fishing competition and keep a track of all the fish caught.
Also will need to use a JSON library to properly generate the string that is post and also parse the results into objects.
Thanks for reading.