How to use GPGS in a web-libgdx game? - gwt

sorry for my English.
How to use GPGS in a web-libgdx game?
If I understand correctly, I need to use RestAPI and javascript(I do not have enough skills in JS) with GWT in libgdx. But I don`t know how to relate everything.
I have not find examples or articles on this topic so I will be grateful for any help.

REST API is an option for this though, but there are various other options to choose from. One of the easiest way is to use the platform specific code via interfacing
Everything that doesn't get integrated directly with libGDX won't work the "write once, run anywhere" way - this applies for achievements, leaderboards.
So what you do is to add the library dependencies to the projects you generate. Then implement a generic interface, AchievementHandler with methods like unlockAchievement(String achievementId). You can then implement this via AndroidAchievementHandler which in-turn uses GPGS.
A sample application demonstrating how this can be achieved is available on github here.
Hope this helps!

Related

Can you tell me more about global configuration

I have read in flutter.dev about global_configuration it is:
"A flutter package for managing different configurations by merging them together and making them available everythere inside the app via a singleton."
this link of global_configuration library
but honestly i didn't understand much about what the library dose i searched in youtube and google didn't find much about it if you can tell me where to use it and what its benefit i would very glad and thank you..

Is it possible to integrate a Browser engine to a custom Browser interface?

Recently I was reading an article about "Browser Internals" and suddenly this idea struck me.
What if I create my own Browser?
So, I have two questions with me.
Question 1:
Is it possible to integrate an Open source Web Engine like "Servo" or "WebKit" to my custom Browser UI interface created using QtCreator or Visual Studio?
Question 2:
Is there any other components that needs to be inserted between the UI created using C++(QtCreator) and Servo or WebKit?
Note:
I am a complete beginner to this field and these questions were asked in a curiosity to learn internal stuff. Pardon if the Questions were not standard.
Thanks :)
Answer 1:
Yes, it is possible. Browser engines have public APIs to provide a way to embed them. For example, the goal of this little project was to present how to build up your own UI interface (using Aura) and wire Chromium (browser engine) into that.
http://szeged.github.io/sprocket/
Answer 2:
If you prefer Qt technologies, then QtWebEngine will be the solution. The intent of this module is exactly what you have described: to embed Chromium engine into Qt applications with hiding its most painful parts and provide convenient API to customise your browser application.
http://doc.qt.io/qt-5/qtwebengine-overview.html
And there are several others:
QtWebKit: http://doc.qt.io/archives/qt-5.5/qtwebkit-index.html
CEF: https://en.wikipedia.org/wiki/Chromium_Embedded_Framework
You don't necessarily have to use extra layers between your application and a browser engine, but if you are a complete beginner, I would highly recommend that.

Template Integration

I am following one reference to create demo chat app in elixir and understood very well how is it working. But i am not so sure how can i create templates in Elixir to implement the same chat room in UI rather than terminal. Can anybody suggest something on this.
I think, if I'm understanding your question, you want to look at EEx, the tool for evaluating code embedded in a string.
Check on Phoenix as well because I believe Phoenix uses EEx too. Specifically check this: https://github.com/phoenixframework/phoenix#template-engine-configuration
Hope it helps.

Proper designer-first reall world app example in Scala Lift

Trying to learn lift, and i'm looking for a somehow bigger example than HelloWorld (something like spring pet-clinic).
Especially i'm looking at advanced templating in designer friendly manner (as less code in snippets as possible).
I tried to look at example Lift apps https://github.com/lift/examples
But they heavily mix html in their snippets https://github.com/lift/examples/blob/master/nuggets/skittr/src/main/scala/com/skittr/snippet/UserMgt.scala
So can anyone link me to a source of real world app that uses designer-friendly templating?
Hmmm. My hobbie project partially corresponds to what you ask, I think.) https://github.com/vn971/roboCup
It's not all good, I started it when only learning Scala and I see now that it has poor decision choises in some places. But, for example, you can see code-free templates here:
https://github.com/vn971/roboCup/blob/master/src/main/webapp/swiss.html
Ajax bindings can be seen here:
https://github.com/vn971/roboCup/blob/master/src/main/webapp/admin.html
It unfortunately uses html in the code somewhere, too. It's also very little, uses actors (both lift's and akka), has no database at all (only the state of the tournament matters and it's not persisted).
try lift in action book , there is a build of a big web app almost step by step and the project is also on github so you can download it also from there

Stand-alone charts in GWT

I've been trying to get pretty charts to work in GWT on our internal network.
Playing around with GWT-Ext's charts is nice, but it requires flash and is really messy to control (it seems buggy, in general).
I'd like to hear about something that works with the least amount of dependencies and it also must work without a connection to the web (so, Google' charts API isn't a solution).
Edit: Indeed, I would rather a library that is all client-side.
I'm building a GWT chart library based on Flot: http://gflot.googlecode.com
I hope you find it useful. Contact me if you have any questions.
Googling for "GWT +sparklines" has gotten me to gchart, which seems like what I need.
From what I understand - it's all client side and requires nothing more than their JAR file.
Google's charts actually come in two flavours, and one of them does not require interaction with Google's servers - so should satisfy your needs.
Google Image Charts is the API you are thinking of, which is an API on Google's servers that returns images.
Google Interactive Charts is a client side javascript API that renders entirely within the browser: Google Interactive Charts
Google provides a GWT wrapper for the interactive charts: GWT Visualization API
It's not all rainbows and unicorns and you can find chart libs out there that make nicer charts, but it's pretty solid, works on all major browsers and we've been using it successfully for quite a while.
http://code.google.com/p/ext-ux-ofcgxt/ is a nice option if you're using ext-gwt
Do you want something that has a server side component or entirely client driven? The best ones I have seen are all flash, alas. I have done little tricks with JS and GWT before, but there is only sophisticated I will get before I go hunting for a library to do it for me.
There is also "sparklines" - they are available in lots of flavours (very simple charts though).
gchart looks seriously awesome. Go with it !
If you're looking for client-side check out flotr which is based on prototype javascript library or flot which is based on jQuery. Both work well, though flot seems like its got a bigger backing.
If you are willing to go with flash, XML/SWF is a wonderful tool
+1 flot, requires jQuery though, so might not play well with GWT, I haven't used that.
Another flash option, with a pre-built GWT integration - Open Flash Chart / ofcgwt.
I think that gwt-chart is a better framework for you.
well.. i've used yahoo ui chart library (which GWT-Ext uses internally). Pretty neat solution, in the beta stage though.
Let us know the conclusion you arrive at..
There is one open source api for charts in GWT hosted on http://code.google.com/p/gwt-rcharts/ . The API works on SVG/VML specification. You may find it quite easy to implement and use. You may find the demo at http://gwt-rcharts.appspot.com/