Including Google Play API Client for Python in android build

Discuss how to use the Ren'Py engine to create visual novels and story-based games. New releases are announced in this section.
Forum rules
This is the right place for Ren'Py help. Please ask one question per thread, use a descriptive subject like 'NotFound error in option.rpy' , and include all the relevant information - especially any relevant code and traceback messages. Use the code tag to format scripts.
Post Reply
Message
Author
User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Including Google Play API Client for Python in android build

#1 Post by octacon100 »

Anyone out there have any luck adding the Python google play client services library to their android builds?

https://developers.google.com/api-clien ... s/v1?hl=en

I'm hoping I can just put the files needed into the rapt/libs folder, but I'm not sure if that will work. Anyone out there have any luck?

Thanks,
Nathan
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

User avatar
PyTom
Ren'Py Creator
Posts: 16096
Joined: Mon Feb 02, 2004 10:58 am
Completed: Moonlight Walks
Projects: Ren'Py
IRC Nick: renpytom
Github: renpytom
itch: renpytom
Location: Kings Park, NY
Contact:

Re: Including Google Play API Client for Python in android b

#2 Post by PyTom »

Isn't this a server side thing?
Supporting creators since 2004
(When was the last time you backed up your game?)
"Do good work." - Virgil Ivan "Gus" Grissom
Software > Drama • https://www.patreon.com/renpytom

User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Re: Including Google Play API Client for Python in android b

#3 Post by octacon100 »

I'm not sure. Looks like setting up the achievements and all that are server side, but calling the unlock() method to unlock the achievement still seems to be a client side thing:

https://developers.google.com/resources ... ments.html

So my guess is I can include the python files in the game folder and include those in the install, and I guess it will work. Going to see if I can try that soon.

If that doens't work it seems like there's some app manifest stuff to set up as well:

https://developers.google.com/android/guides/setup

Can't exactly find where that is. I'm guessing its the android manifest file?

After trying to set it up on the developer console, it looks like these are next steps:
Step 3: Modify your code

[
To run the game, you need to configure the application ID as a resource in your Android project. You will also need to add games metadata in the AndroidManifest.xml.

Open res/values/ids.xml and replace the placeholder IDs. If you are creating an Android game from scratch, you will need to create this file first.
Specify your application ID in the app_id resource.
Specify each achievement ID that you created earlier in the corresponding achievement_* resource.
Specify each leaderboard ID that you created earlier in the corresponding leaderboard_* resource.
Open AndroidManifest.xml and enter your package name in the package attribute of the <manifest> element. If you are creating an Android game from scratch, make sure that you also add the following code inside the <application> element:
<meta-data android:name="com.google.android.gms.games.APP_ID"
android:value="@string/app_id" />
<meta-data android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version"/>
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

User avatar
octacon100
Regular
Posts: 163
Joined: Thu Sep 12, 2013 11:23 pm
Projects: Regeria Hope
Organization: Golden Game Barn
IRC Nick: Octacon100
Location: Boston, MA
Contact:

Re: Including Google Play API Client for Python in android b

#4 Post by octacon100 »

Ok, so it looks like the python api is for 3.0 only, but there is something out there that has some open source code for setting achievements with python and java autoclass.

https://github.com/tito/2048/blob/master/gs_android.py

Looks like it uses some Renpy "PythonActivity" class as well. Maybe this opensource project might be able to help?
Image
Current Digital Projects -
Image
Regiera Hope Completed Game Forum Post

User avatar
emilkun
Newbie
Posts: 16
Joined: Tue Apr 28, 2015 6:11 am
Location: England
Contact:

Re: Including Google Play API Client for Python in android b

#5 Post by emilkun »

I've tried it too but can't seem to make it work with my limited knowledge. It would be awesome if we could make it work in any way, though!

User avatar
qirien
Miko-Class Veteran
Posts: 541
Joined: Thu Jul 31, 2003 10:06 pm
Organization: Metasepia Games
Deviantart: qirien
Github: qirien
itch: qirien
Location: New Mexico, USA
Discord: qirien
Contact:

Re: Including Google Play API Client for Python in android build

#6 Post by qirien »

Has anyone figured this out? I see that there is an Achievements module in Ren'Py, but is this just for Steam?
Finished games:
Image
Image
Image

Post Reply

Who is online

Users browsing this forum: Dark79, Google [Bot]