android-basic-samples | Google Play game services - Android samples | Android library
kandi X-RAY | android-basic-samples Summary
kandi X-RAY | android-basic-samples Summary
These are the Android samples for Google Play game services. How to run a sample. Building using Android Studio…. Modify IDs, compile and run.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Initializes the activity
- Update the UI
- Check all placeholder ids in the dialog
- Create the activity fragment
- Update the UI
- Check all placeholder ids in the dialog
- Called when the sign - in button is clicked
- Signs the Google Sign out
- Launch the specified level
- Initializes the dialog
- Invoked when an activity is saved
- Called when an options item is selected
- Set the score button
- Creates and returns a listener which allows to open a file open
- Close the snapshot
- Waits for the file to be closed
- Delete a snapshot
- Called when the view is created
- Initialize view
- Called when a score is entered
- Creates and returns an ArrayAdapter which allows to adapt a player to a player
- Click on view
- Process a snapshot result
- Replaces the current SaveData with the given JSON string
- Verifies the sample setup
- Create view
- Handles a snapshot conflict
- Initialize the snapshot
android-basic-samples Key Features
android-basic-samples Examples and Code Snippets
Community Discussions
Trending Discussions on android-basic-samples
QUESTION
I'm following the google developers guide on how to setup saved games in my game, when i reach the part where you create a snapshot to store your data, the guide doesn't specify what to do.
Also i checked the sample code provided here https://github.com/gguuss/android-basic-samples/tree/master/BasicSamples/CollectAllTheStars2
but some of the methods used are marked as deprecated, and they didn't update the code since 5 years ago
...ANSWER
Answered 2019-Jul-10 at 09:30After much research i found out how to do it, before you do this your player must be signed in
QUESTION
I have been implementing my own turn based board game. Whole game is based on PlayGameService's SkeletonTbmp example with some modifications.
My problem is that a player sometimes receives its own data that it sent to the opponent using takeTurn()
. I have checked many times that getNextParticipantId()
returns the right id. For example my emulator persists a move data and sends it correctly to my actual Android phone and my phone unpersists as implemented in the example. Then some seconds later my emulator receives this same data without actual device persisting it and calling takeTurn()
. This also happens sometimes on game start on the first turn, emulator receives the first "dummy" turn data without actual device sending anything yet. It does not happen every single turn, just occasionally.
Could this be something with my Google Play Console settings or does these turns buffer some how and then they are released at some point?
...ANSWER
Answered 2019-May-01 at 23:12As you have not giving any codes i cannot pinpoint the problem. But just for the explanation, as long as the match is going, match will contain data, whether its your turn or not. To pinpoint the exact place this is happening, put checks at the execution of updatematch() as it must be firing without actual need. (on login, reconnect, initiate, connectionhint etc). Can't be sure about your code but alternate approach to bypass the bug, you can actually put check on turncounter in addition of MATCH_TURN_STATUS_MY_TURN otherwise pass the null turn. Hope it helps as further i cant help without your code.
QUESTION
I'm trying to implement automating player sign in to Google Play games in my Android app. Firstly, as mentioned here, I try to sign in silently:
...ANSWER
Answered 2018-Jul-08 at 20:34You must not start the login screen from your onResume method. It is a silent login which works if the user wants it (by tapping a button). That's why the examples show it only this way.
QUESTION
I have a libGDX game published and running on play store but I am facing problems in implementing leaderboards in the game. I have tried probably everything available on the Internet for this, example:
Google Play Games Services in LibGDX
google play game services tutorial example
how to setup google play game services in libgdx using android studio
I have gone through probably all the material from Google, have setup leaderboards, application id and achievement id and have published the game leaderboard via Google place console, however issue is I get struck mostly in all the tutorials or materials information provided in setting up the leaderboards.
Now I am trying again using the below link as myhave made my app in Android Studio and libGDX.
how to setup google play game services in libgdx using android studio
Now the vary basic issue with this tutorial and with others is that it says to clone the repository which has Android basic samples as below
And then import BaseGameUtils
at path BasicSamples\libraries\BaseGameUtils
, however this project doesn't have BaseGameUtils Sample available.
Can anyone advice if there is any correct way of implementing Leaderboards using libGDX and Android studio and how to use BaseGameUtils. Is this an old tuts and if Google API is changed.
...ANSWER
Answered 2018-Apr-12 at 10:55After many days of reading and struggle i was able to implement leaderboards in libGDX Game . a new detailed updated tutorial can be seen as in below link
QUESTION
I am trying to implement Google play games Leaderboards in one of my Android Game made using LibGDX framework .
Trying to implement the basic android samples provided by google at the below repository
https://github.com/playgameservices/android-basic-samples
As i am interested in Leaderboards so I am interested in TypeANumber project . As suggested in the github ReadMe.md of this project have done all the settings :
So , i have done following :
- setup google play game services for my project
- Created linked apps and a leaderboard for it
- Replaces ids in res/ids.xml
- Change package name in my build.grade of Type-A-Number project
applicationId
com.myGame.blah
- Compile and run
Executing on my mobile physical device where i am actually logged in for google play games but still when executed .
I do see a button below with message Sign in with Google to share your scores and achievements with your friends.
When clicked on this button for logged it , it shows that connecting to the app , but then after some time i get a pop up with error 4:
...ANSWER
Answered 2018-Apr-12 at 10:54I was getting this error because when we Click on Authorize app after linked app it shows the default SHA1 of the apk being uploaded at play store , however which is different to the one which we have uploaded so to create it we need to use a keytool command . We should ideally add debug SHA1 certificate as well as the SHA1 certificate using the keystore which we used to generate our release apk .
Below are the commands where C:\Program Files\Java\jdk1.7.0_72\bin is the path to Java installation in your pc and D:\Java\libGdx\apk\keystore\android.jks is the path to your production keystore
C:\Program Files\Java\jdk1.7.0_72\bin>keytool -list -keystore D:\Java\libGdx\apk\keystore\android.jks Enter keystore password: Keystore type: JKS Keystore provider: SUN Your keystore contains 1 entry briskybird, Dec 9, 2017, PrivateKeyEntry, Certificate fingerprint (SHA1): 27:XX:XX:XX:XX:B2:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:BD:BF
Use below to generate debug certificate
C:\Program Files\Java\jdk1.7.0_72\bin>keytool -list -keystore C:\Users\USER.android\debug.keystore
C:\Users\.android\debug.keystore is a default path of your debug.keystore and password for debug keystore by default is android
More details can be seen on below link https://www.versionpb.com/tutorials/step-step-tutorials-libgdx-basic-setup-libgdx/implementing-google-play-services-leaderboards-in-libgdx/
QUESTION
I have a game written in LibGDX and i want to integrate google play services leaderboards in it . I have read code of the basic samples provided by google for implementing leader boards in below repository
https://github.com/playgameservices/android-basic-samples
and TypeANumber is a project where leaderboards are implemented . MainActivity in TypeANumber extends a class FragmentActivity which is provided by google and needs to be extended in my Game and similarly libGDX Game class also extends AndroidApplication Class which needs to be extended for libGDX Framework .
Now Java doesn't support multiple inheritance , I need your help on how to extend both these classes . I have implemented all other required interfaces so far .
Thanks in advance
...ANSWER
Answered 2018-Apr-01 at 20:50Those fragments are just states of game actually. You don't have to extend fragments.
Just add googleplaygamesservices methods to androidlauncher that implements an interface from core directory. So you can create an instance of this interface in core and able to call gameservices methods from actual game codes. This is my interface named PlayServices inside core.
QUESTION
I checked [https://github.com/libgdx/libgdx/wiki/Google-Play-Games-Services-in-LibGDX][1] but that tutorial requiers me to import BaseGameUtils
from here: [https://github.com/playgameservices/android-basic-samples][2] but it seems that the BaseGameUtils
was removed. How can I go about with the implementation of GooglePlay Game services?
ANSWER
Answered 2018-Jan-05 at 22:39I recently just implemented Google Play Games into one of my libgdx projects. Don't look at libgdx tutorials as they are outdated. You don't need a libgdx specific extension. Non deprecated modern Google Play Game services code can be found on the example projects here:
https://github.com/playgameservices/android-basic-samples
Download the whole repo to your computer, load into android studio, and play around with the code. Most of it can be simply copy and pasted to fit your needs. Worked really well for me.
The general approach I used was to write the code into the android portion of my project and then tie it into my core libgdx code using interfaces. Reference this post (the second answer, not first):
even if you aren't planning on displaying alert dialogs as shown in the above post, you can make your core libgdx project do android specific things by following this technique
QUESTION
I'm newbie on android. I know only C and C++. I saw following for
loop on github reference.
ANSWER
Answered 2017-Nov-10 at 10:39this is the whole code in github:
QUESTION
I have been trying to add Google Game Services
to my LibGDX project for the past 3 days now at first I tried the LibGDX tutorials but all of them seem to be outdated. Then I was advised to use the Google Game Services official code
LibGDX: How to Implement Google Play Game Services?
I imported the sample project TypeANumber and tried to add the code to my project but when I try to sign in I'm getting the "signInSilently(): failure" error
and it crashes when I try to open the leaderboards and achievements on both the debug and signed APKS.
Here is my code:
AndroidLauncher:
...ANSWER
Answered 2018-Jan-07 at 13:20From 1st look of your question, It seems that you're keeping meta data outside the application tag but should be inside application tag in AndroidManifest.xml
file
Like this :
QUESTION
Im trying to create my card game android app, I used playgamesservices samples (https://github.com/playgameservices/android-basic-samples). Now im success to create a room and start game with players, and each player recive and send data from all the others.
Im develop a multiplayer card game, And i have a question about the initial of the game. I want the server will be the "manger" of the game, handed out the cards and each operation of the players will upload to the server and then the players will get the updates from the server. Instead every operation will send to all the players, and each player needs to process and calculate.
I know its possible if i created my own server-client design, But its possible in google play services?
...ANSWER
Answered 2017-May-24 at 12:54I think the Real-time Multiplayer API is what you're looking for:
Your game can use the real-time multiplayer API in Google Play games services to connect multiple players together in a single game session and transfer data messages between connected players. Using the real-time multiplayer API can help to simplify your game development effort because the API handles the following tasks on your behalf:
- Manages network connections to create and maintain a real-time multiplayer room (a virtual construct that enables network communication between multiple players in the same game session and lets players send data directly to one another).
- Provides a player selection user interface (UI) to invite players to join a room, look for random players for auto-matching, or a combination of both.
- Stores participant and room state information on the Google Play games services servers during the lifecycle of the real-time multiplayer game.
- Sends room invitations and updates to players. Notifications appear on all devices on which the player is logged in (unless disabled).
To learn how to implement real-time multiplayer games for your platform, see Client implementations.
The Sending Game Data part states (emphasis mine):
You can use the Google Play games services to broadcast data to participants in a room, or allow participants to exchange messages with each other. Data messages can be sent using a reliable or unreliable messaging protocol provided by Google Play games services.
With that, I think depending on how you'll implement it, you could use Google Play Games to manage game data between the server and the players (and between the players themselves).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install android-basic-samples
You can use android-basic-samples like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the android-basic-samples component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page