This member has provided no bio about themself...

RSS My Blogs

On this post, I’ll share with you my experience integrating LibGDX and GameSparks, the Backend-as-a-Service with huge adoption among, most commonly, mobile developers.


Baas is great way to engage users and acquire more them (and earn more money) for your games. This brings to your game analytics, push notification, social integration, IAP integrations, achievements, leaderboards an so on. Check more on this image featured by GameSparks:

GameSparks features


After this humble introduction into BaaS, let’s integrate it with LibGDX. For most platforms supported by GameSparks, the configuration is straight-forward, but Java integration is not. So, on a Gradle project, this is how I get it working:

First, on the project build.gradle, include this repository on allprojects part:

maven { url "http://repo.gamesparks.net/mvn" }

The final code should looks like this:

allprojects {
    apply plugin: "eclipse"
    apply plugin: "idea"
 
    version = "1.0"
    ext {
        appName = "Speech Colors"
    }
 
    repositories {
        mavenLocal();
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url "http://repo.gamesparks.net/mvn" }
    }
}

Next, on project core, add this line:

compile "com.gamesparks.sdk:gamesparks-java-sdk:0.0.+"

It will looks like:

project(":core") {
    apply plugin: "java"
 
    dependencies {
        compile "com.badlogicgames.gdx:gdx:$gdxVersion"
        compile "com.gamesparks.sdk:gamesparks-java-sdk:0.0.2-SNAPSHOT"
    }
}

After that, sync gradle project and all things should be fine. You’ll be able to use GameSparks SDK into your project, simply by adding:

GS gs = new GS("API_KEY", "API_SECRET", false, false, new CustomPlatform());
gs.setOnAvailable(new GSEventConsumer<Boolean>() {
   @Override
   public void onEvent(Boolean available) {
      if(available) {
         //Game Sparks Available!
      } else {
         //Game Sparks Not Available!
      }
   }
});
gs.start();


The core sdk documentation can be found here: Api.gamesparks.net

Regards,

Start a group Groups
Indie DB

Indie DB

2,703 members Official

Indie games are changing the world, one giant pixel at a time. With Indie DB we aim to support independent developers and their games, by providing them...

Locomotive Mobile

Locomotive Mobile

1 member Developer

Locomotive Mobile is a newborn company focused on mobile games. Our main goal is bring fun and engagement for players all around the world as we look...

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account:

X

Latest posts from @locomotivemob

These sites are great place to start searching for new ideas and inspiration Starterstory.com The history b… T.co

Jan 27 2023

The current status of my first project that: - I started it commuting to work; - from my smartphone; - no budget a… T.co

Jan 9 2023

450 milions! This is the size of Twitter public you can reach. So, if you don't have a digital product, this is t… T.co

Jan 5 2023

450 milions! This is the size of Twitter public you can reach. So, if you don't have a digital product, this is t… T.co

Jan 4 2023

New blog post: Best libGDX games. Locomotivemobile.com

Nov 21 2018

RT @aeclean: O App da Bíblia que eu fiz, Play.google.com, agora tem uma conta no Instagram: Instagram.com

Jun 2 2018

Locomotive Railroad is available on Amazon App Store. It's free as always. Check it out! Amazon.com

Nov 7 2016

Is it just me that received an email about the release date of new Zelda? #zeldabreathofthewild T.co

Jun 21 2016

Don't you know? We have a page on SlideDB Slidedb.com

Mar 22 2016

New post on Locomotive Mobile blog: Locomotivemobile.com #libGDX #GameSparks

Mar 18 2016