Permalink
Find file
9c14636 Mar 1, 2016
47 lines (33 sloc) 1.98 KB
GOOGLE PLAY GAMES - ANDROID SAMPLES
FREQUENTLY ASKED QUESTIONS
[1] How should I compile BaseGameUtils into my project?
Include BaseGameUtils as a library project. Consult your build system's
documentation as to how to accomplish this, since this varies by IDE.
If you are using Gradle, you can add the BaseGameUtils directory to
your project and adjust your project's build.gradle files to reflect
a dependency on BaseGameUtils. For an example, see the build.gradle
files in the sample. Particularly, the BasicSamples is set up as
a gradle multi-project where several different apps (the samples)
depend on the BaseGameUtils library.
You should NOT compile the BaseGameUtils classes as stand-alone JAR files
into your project. Doing so will cause them not to be able to find their
resources, and might cause problems.
If you want more simplicity and don't want to deal with build system
red tape, you can adopt the less organized approach of dropping in
the BaseGameUtil java files into your project; if you do, remember to
also copy the BaseGameUtil resources into your project's res/
directory.
[6] I think the default error dialogs are ugly. I want to make my own.
How can I do this?
For convenience, BaseGameActivity and GameHelper show error dialogs
with appropriate error messages for each kind of error. If you want
to disable that behavior and make your own dialog boxes, you can
call GameHelper.setShowErrorDialogs(false) to inhibit the default
dialog boxes, then show your own when you get an onSignInFailed().
To retrieve details about the failure, you can call
GameHelper.getSignInError().
[7] I need to localize the sign-in failure message (and other error messages
shown by BaseGameActivity and GameHelper). How can I do that?
Simply translate the string resources found in
res/values/gamehelper_strings.xml into the corresponding locale folders,
as you would any other string resouce in Android.