Google Play Games Services

A project to port LÖVE to Android handhelds
Locked
GiveMeAnthony
Prole
Posts: 7
Joined: Fri Jan 08, 2016 3:51 am

Google Play Games Services

Post by GiveMeAnthony »

I'm wondering about how one might integrate Google Play Games Services into a Love2D project running with love-android-sdl2. I know Love2D comes with LuaJIT and FFI, so you can call native C functions like so

Code: Select all

local ffi = require("ffi")

ffi.cdef[[
int printf(const char *fmt, ...);
]]
ffi.C.printf("%s running on %s %s\n", jit.version, jit.os, jit.arch)

function love.load()
	love.window.setMode( 120, 100 )
	love.graphics.setBackgroundColor(80, 80, 80)
end

function love.draw()
	love.graphics.printf("Check terminal...", 0, love.graphics.getHeight()/2 - 12, love.graphics.getWidth(), "center")
end
Not that this example is particularly useful, but you can see that we can execute C functions nicely. This all nice and dandy, but it doesn't seem to help for accessing Play Games APIs. They offer an API for Android, C++, and for Web via REST. So I'm thinking "How should I implement this?". Do I need a special Java/Android interface for Lua/Love2D? Perhaps a C++ interface would be better? Should I use LuaJIT FFI to call a C function which then uses JNI? Should I somehow use their REST API (I'm unsure of the limitations)?
bobbyjones
Party member
Posts: 730
Joined: Sat Apr 26, 2014 7:46 pm

Re: Google Play Games Services

Post by bobbyjones »

Their rest api most likely require HTTPS which love doesn't include sadly. But there are other threads that show how to integrate Google play services. I'm sure you can adapt them for your needs. I would also like to say that if you do code your own solution please share it with us \o/ lol.
Locked

Who is online

Users browsing this forum: No registered users and 7 guests