android-basic-samples | Google Play game services - Android samples | Android library

 by   playgameservices Java Version: Current License: Apache-2.0

kandi X-RAY | android-basic-samples Summary

kandi X-RAY | android-basic-samples Summary

android-basic-samples is a Java library typically used in Mobile, Android applications.,roid-basic-samples has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has medium support. You can download it from GitHub.

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

            kandi-support Support

              android-basic-samples has a medium active ecosystem.
              It has 939 star(s) with 997 fork(s). There are 135 watchers for this library.
              OutlinedDot
              It had no major release in the last 6 months.
              There are 73 open issues and 163 have been closed. On average issues are closed in 269 days. There are 6 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of android-basic-samples is current.

            kandi-Quality Quality

              android-basic-samples has 0 bugs and 0 code smells.

            kandi-Security Security

              android-basic-samples has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              android-basic-samples code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              android-basic-samples is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              android-basic-samples releases are not available. You will need to build from source code and install.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              android-basic-samples saves you 1293 person hours of effort in developing the same functionality from scratch.
              It has 2903 lines of code, 150 functions and 30 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed android-basic-samples and discovered the below as its top functions. This is intended to give you an instant insight into android-basic-samples implemented functionality, and help decide if they suit your requirements.
            • 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
            Get all kandi verified functions for this library.

            android-basic-samples Key Features

            No Key Features are available at this moment for android-basic-samples.

            android-basic-samples Examples and Code Snippets

            No Code Snippets are available at this moment for android-basic-samples.

            Community Discussions

            QUESTION

            Google play games services : Saved games, creating a new snapshot
            Asked 2019-Jul-10 at 09:30

            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:30

            After much research i found out how to do it, before you do this your player must be signed in

            Source https://stackoverflow.com/questions/56955983

            QUESTION

            Turn Based Game player receives its own data without opponent calling takeTurn
            Asked 2019-May-05 at 20:00

            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:12

            As 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.

            Source https://stackoverflow.com/questions/55816515

            QUESTION

            Google Play Games API returns SIGN_IN_REQUIRED
            Asked 2018-Jul-09 at 20:09

            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:34

            You 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.

            Source https://stackoverflow.com/questions/51193936

            QUESTION

            Implementing a leaderboard in a LibGDX game
            Asked 2018-Apr-12 at 10:55

            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

            android-basic-samples

            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:55

            After 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

            https://www.versionpb.com/tutorials/step-step-tutorials-libgdx-basic-setup-libgdx/implementing-google-play-services-leaderboards-in-libgdx/

            Source https://stackoverflow.com/questions/49595898

            QUESTION

            Leaderboard signin using android basic samples fails with com.google.android.gms.common.api.ApiException: 4:
            Asked 2018-Apr-12 at 10:54

            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 :

            1. setup google play game services for my project
            2. Created linked apps and a leaderboard for it
            3. Replaces ids in res/ids.xml
            4. Change package name in my build.grade of Type-A-Number project applicationId com.myGame.blah
            5. 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:54

            I 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/

            Source https://stackoverflow.com/questions/49598153

            QUESTION

            integrating libGDX Game with google play games Leaderboards wit help of android basic examples
            Asked 2018-Apr-01 at 20:50

            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:50

            Those 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.

            Source https://stackoverflow.com/questions/49601168

            QUESTION

            LibGDX: How to Implement Google Play Game Services?
            Asked 2018-Feb-11 at 11:41

            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:39

            I 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):

            libGDX Alert Dialog

            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

            Source https://stackoverflow.com/questions/48121642

            QUESTION

            What does "for (int clickableId : clickableIds)" do?
            Asked 2018-Jan-13 at 15:38

            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:39

            this is the whole code in github:

            Source https://stackoverflow.com/questions/47220310

            QUESTION

            "signInSilently(): failure" when trying to sign in to GooglePlay Game Services with LibGDX
            Asked 2018-Jan-07 at 13:20

            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:20

            From 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 :

            Source https://stackoverflow.com/questions/48135531

            QUESTION

            android google game service - Server control
            Asked 2017-May-24 at 12:54

            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:54

            I 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).

            Source https://stackoverflow.com/questions/44130699

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install android-basic-samples

            You can download it from GitHub.
            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

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/playgameservices/android-basic-samples.git

          • CLI

            gh repo clone playgameservices/android-basic-samples

          • sshUrl

            git@github.com:playgameservices/android-basic-samples.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Android Libraries

            leakcanary

            by square

            butterknife

            by JakeWharton

            tips

            by git-tips

            material-dialogs

            by afollestad

            Try Top Libraries by playgameservices

            play-games-plugin-for-unity

            by playgameservicesC#

            cpp-android-basic-samples

            by playgameservicesC++

            management-tools

            by playgameservicesJavaScript

            8bitartist

            by playgameservicesJava

            android-snippets

            by playgameservicesJava