Skip to content

Commit

Permalink
Replaced BaseGAmeUtils and google-play-services_lib with latest versi…
Browse files Browse the repository at this point in the history
…ons, and set minSdkVersion to 9
  • Loading branch information
MrDT authored and MrDT committed Jul 25, 2014
1 parent 9820c88 commit ef44033
Show file tree
Hide file tree
Showing 274 changed files with 2,644 additions and 1,263 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# Ignore all dotfiles except .gitignore
.*
!.gitignore

/tutorial-libgdx-gameservices/bin
/tutorial-libgdx-gameservices-android/bin
/tutorial-libgdx-gameservices-android/gen
/tutorial-libgdx-gameservices-desktop/bin
/BaseGameUtils/bin
/BaseGameUtils/gen
/google-play-services_lib/bin
/google-play-services_lib/gen
2 changes: 0 additions & 2 deletions BaseGameUtils/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/>
<classpathentry exported="true" kind="con" path="com.android.ide.eclipse.adt.DEPENDENCIES"/>
<classpathentry combineaccessrules="false" kind="src" path="/google-play-services_lib"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="output" path="bin/classes"/>
</classpath>
4 changes: 0 additions & 4 deletions BaseGameUtils/.settings/org.eclipse.jdt.core.prefs

This file was deleted.

4 changes: 2 additions & 2 deletions BaseGameUtils/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
android:versionName="1.0" >

<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="16" />
android:minSdkVersion="9"
android:targetSdkVersion="19" />

<application android:allowBackup="true" android:label="BaseGameUtils" >
</application>
Expand Down
30 changes: 0 additions & 30 deletions BaseGameUtils/bin/AndroidManifest.xml

This file was deleted.

Binary file removed BaseGameUtils/bin/basegameutils.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

4 changes: 4 additions & 0 deletions BaseGameUtils/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<lint>
<issue id="MissingTranslation" severity="ignore" />
</lint>
3 changes: 2 additions & 1 deletion BaseGameUtils/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt

# Project target.
target=android-10
target=android-19
android.library=true
android.library.reference.1=../google-play-services_lib
Empty file removed BaseGameUtils/res/.keep
Empty file.
7 changes: 7 additions & 0 deletions BaseGameUtils/res/values/gamehelper_strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="gamehelper_sign_in_failed">Failed to sign in. Please check your network connection and try again.</string>
<string name="gamehelper_app_misconfigured">The application is incorrectly configured. Check that the package name and signing certificate match the client ID created in Developer Console. Also, if the application is not yet published, check that the account you are trying to sign in with is listed as a tester account. See logs for more information.</string>
<string name="gamehelper_license_failed">License check failed.</string>
<string name="gamehelper_unknown_error">Unknown error.</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,17 @@
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import android.util.Log;

import com.google.android.gms.appstate.AppStateClient;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.games.GamesClient;
import com.google.android.gms.plus.PlusClient;
import com.google.android.gms.common.api.GoogleApiClient;

/**
* Example base class for games. This implementation takes care of setting up
* the GamesClient object and managing its lifecycle. Subclasses only need to
* the API client object and managing its lifecycle. Subclasses only need to
* override the @link{#onSignInSucceeded} and @link{#onSignInFailed} abstract
* methods. To initiate the sign-in flow when the user clicks the sign-in
* button, subclasses should call @link{#beginUserInitiatedSignIn}. By default,
* this class only instantiates the GamesClient object. If the PlusClient or
* this class only instantiates the GoogleApiClient object. If the PlusClient or
* AppStateClient objects are also wanted, call the BaseGameActivity(int)
* constructor and specify the requested clients. For example, to request
* PlusClient and GamesClient, use BaseGameActivity(CLIENT_GAMES | CLIENT_PLUS).
Expand All @@ -58,10 +56,12 @@ public abstract class BaseGameActivity extends FragmentActivity implements
// Requested clients. By default, that's just the games client.
protected int mRequestedClients = CLIENT_GAMES;

private final static String TAG = "BaseGameActivity";
protected boolean mDebugLog = false;

/** Constructs a BaseGameActivity with default client (GamesClient). */
protected BaseGameActivity() {
super();
mHelper = new GameHelper(this);
}

/**
Expand All @@ -77,8 +77,9 @@ protected BaseGameActivity(int requestedClients) {
/**
* Sets the requested clients. The preferred way to set the requested clients is
* via the constructor, but this method is available if for some reason your code
* cannot do this in the constructor. This must be called before onCreate in order to
* have any effect. If called after onCreate, this method is a no-op.
* cannot do this in the constructor. This must be called before onCreate or getGameHelper()
* in order to have any effect. If called after onCreate()/getGameHelper(), this method
* is a no-op.
*
* @param requestedClients A combination of the flags CLIENT_GAMES, CLIENT_PLUS
* and CLIENT_APPSTATE, or CLIENT_ALL to request all available clients.
Expand All @@ -87,11 +88,21 @@ protected void setRequestedClients(int requestedClients) {
mRequestedClients = requestedClients;
}

public GameHelper getGameHelper() {
if (mHelper == null) {
mHelper = new GameHelper(this, mRequestedClients);
mHelper.enableDebugLog(mDebugLog);
}
return mHelper;
}

@Override
protected void onCreate(Bundle b) {
super.onCreate(b);
mHelper = new GameHelper(this);
mHelper.setup(this, mRequestedClients);
if (mHelper == null) {
getGameHelper();
}
mHelper.setup(this);
}

@Override
Expand All @@ -112,16 +123,8 @@ protected void onActivityResult(int request, int response, Intent data) {
mHelper.onActivityResult(request, response, data);
}

protected GamesClient getGamesClient() {
return mHelper.getGamesClient();
}

protected AppStateClient getAppStateClient() {
return mHelper.getAppStateClient();
}

protected PlusClient getPlusClient() {
return mHelper.getPlusClient();
protected GoogleApiClient getApiClient() {
return mHelper.getApiClient();
}

protected boolean isSignedIn() {
Expand All @@ -136,40 +139,41 @@ protected void signOut() {
mHelper.signOut();
}

protected void showAlert(String message) {
mHelper.makeSimpleDialog(message).show();
}

protected void showAlert(String title, String message) {
mHelper.showAlert(title, message);
mHelper.makeSimpleDialog(title, message).show();
}

protected void showAlert(String message) {
mHelper.showAlert(message);
protected void enableDebugLog(boolean enabled) {
mDebugLog = true;
if (mHelper != null) {
mHelper.enableDebugLog(enabled);
}
}

@Deprecated
protected void enableDebugLog(boolean enabled, String tag) {
mHelper.enableDebugLog(enabled, tag);
Log.w(TAG, "BaseGameActivity.enabledDebugLog(bool,String) is " +
"deprecated. Use enableDebugLog(boolean)");
enableDebugLog(enabled);
}

protected String getInvitationId() {
return mHelper.getInvitationId();
}

protected void reconnectClients(int whichClients) {
mHelper.reconnectClients(whichClients);
}

protected String getScopes() {
return mHelper.getScopes();
protected void reconnectClient() {
mHelper.reconnectClient();
}

protected boolean hasSignInError() {
return mHelper.hasSignInError();
}

protected ConnectionResult getSignInError() {
protected GameHelper.SignInFailureReason getSignInError() {
return mHelper.getSignInError();
}

protected void setSignInMessages(String signingInMessage, String signingOutMessage) {
mHelper.setSigningInMessage(signingInMessage);
mHelper.setSigningOutMessage(signingOutMessage);
}
}
Loading

0 comments on commit ef44033

Please sign in to comment.