本文整理汇总了Java中com.google.example.games.basegameutils.GameHelper.CLIENT_GAMES属性的典型用法代码示例。如果您正苦于以下问题:Java GameHelper.CLIENT_GAMES属性的具体用法?Java GameHelper.CLIENT_GAMES怎么用?Java GameHelper.CLIENT_GAMES使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.google.example.games.basegameutils.GameHelper
的用法示例。
在下文中一共展示了GameHelper.CLIENT_GAMES属性的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
/**
* {@inheritDoc}
*/
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.hideStatusBar = true;
config.useAccelerometer = true;
gameHelper.setup(this);
playServices = new PlayServices(this, gameHelper);
initialize(new Armadillo(playServices), config);
}
示例2: onCreate
@Override
protected void onCreate (Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useImmersiveMode = true;
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
gameHelper.enableDebugLog(false);
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
{
@Override
public void onSignInFailed(){ }
@Override
public void onSignInSucceeded(){ }
};
gameHelper.setup(gameHelperListener);
AdBuddiz.setPublisherKey("9bfbf1bb-a9e2-4ce5-8dfd-f25455ceb714");
AdBuddiz.cacheAds(this);
initialize(new Application(this, this, this, Application.Platform.ANDROID), config);
setupAds();
}
示例3: onCreate
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
pong = new Pong(this);
initialize(pong, config);
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
gameHelper.enableDebugLog(true);
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
{
@Override
public void onSignInFailed(){ }
@Override
public void onSignInSucceeded(){ }
};
gameHelper.setup(gameHelperListener);
}
示例4: setupHelper
private void setupHelper() {
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (result == ConnectionResult.SUCCESS && PreferenceManager.getDefaultSharedPreferences(this).getBoolean("sign_in", true)) {
ConnectivityManager connec = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (!signingIn && connec != null && (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) || (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)) {
helper = new GameHelper(this, GameHelper.CLIENT_GAMES);
helper.setMaxAutoSignInAttempts(0);
helper.setup(this);
helper.beginUserInitiatedSignIn();
signingIn = true;
}
} else {
if (!updating) {
updating = true;
GooglePlayServicesUtil.showErrorDialogFragment(result, this, 101, new OnCancelListener() {
@Override
public void onCancel(DialogInterface dialog) {
PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putBoolean("play_services_opt_out", true).putBoolean("sign_in", false).apply();
}
});
} else {
PreferenceManager.getDefaultSharedPreferences(MainActivity.this).edit().putBoolean("play_services_opt_out", true).putBoolean("sign_in", false).apply();
}
}
}
示例5: onCreate
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
String pKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk7CvCwFg6zjMPmczjAxaLlUjiriAudAOS1a+AFAC5KsA1ZeK7dW8g2spFW7ukmLaSAKQWqGgaKwrs+hntgbMsp2cPWe1x77z8gISdXUNZB2XuzjZqUTzRaGU3zoO9kjBAqQmSaZIo7hLb2hn70Yzeoo31fV4m1koHsNtzpMUksYpFwuD/HVJifHeO9E1bvea6ljidGtYz10hdoF/t+Lp77Exv/17pD9IbE8dKO/j0p/MFIAz0LF1+vyhg/bhpZs2X8Y3dWVv3fkthScj4Wemu8yDksTpCH6baDwjeZ5qe7eAoA3KnQsR7kssiUNXWWtUTUOON1GlOqcHVu9BJW52GwIDAQAB";
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
gameHelper.enableDebugLog(false);
bp = new BillingProcessor(this, pKey, this);
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
@Override
public void onSignInFailed() {
}
@Override
public void onSignInSucceeded() {
}
};
gameHelper.setup(gameHelperListener);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
initialize(new Hexpert(this, this, this), config);
}
示例6: onCreate
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
reversi = new Reversi(this);
initialize(reversi, config);
gameHelper.setup(this);
}
示例7: setupGameHelper
private void setupGameHelper(Activity activity)
{
this.gameHelper = new GameHelper(activity, GameHelper.CLIENT_GAMES);
this.gameHelper.enableDebugLog(Constants.General.IS_DEBUGGING);
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
{
@Override
public void onSignInFailed()
{
}
@Override
public void onSignInSucceeded()
{
Runnable onSignInSucceededRunnable =
AndroidServices.this.onGoogleSignInSucceededRunnable;
if (onSignInSucceededRunnable != null)
{
AndroidServices.this.onGoogleSignInSucceededRunnable = null;
onSignInSucceededRunnable.run();
}
}
};
this.gameHelper.setup(gameHelperListener);
}
示例8: onCreate
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
// Create the GameHelper.
_gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
_gameHelper.enableDebugLog(false);
resetMultiplayerProperties();
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener()
{
@Override
public void onSignInSucceeded(){
}
@Override
public void onSignInFailed(){
}
};
_gameHelper.setup(gameHelperListener);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
PlatformAndroid platform = new PlatformAndroid();
platform.setActivity(this);
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
initialize(new SpaceGame(platform, this), config);
}
示例9: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create the GameHelper
_gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
_gameHelper.enableDebugLog(false);
GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
@Override
public void onSignInSucceeded() {
// TODO Auto-generated method stub
}
@Override
public void onSignInFailed() {
// TODO Auto-generated method stub
}
};
_gameHelper.setup(gameHelperListener);
// signIn();
Intent serviceIntent = new Intent("com.android.vending.billing.InAppBillingService.BIND");
serviceIntent.setPackage("com.android.vending");
bindService(serviceIntent, mServiceConn, Context.BIND_AUTO_CREATE);
// queryPurchases();
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useImmersiveMode = true;
initialize(new Runners(this), config);
}
示例10: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_game);
int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
if (result == ConnectionResult.SUCCESS && PreferenceManager.getDefaultSharedPreferences(this).getBoolean("sign_in", true)) {
ConnectivityManager connec = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
if (connec != null && (connec.getNetworkInfo(1).getState() == NetworkInfo.State.CONNECTED) || (connec.getNetworkInfo(0).getState() == NetworkInfo.State.CONNECTED)) {
helper = new GameHelper(this, GameHelper.CLIENT_GAMES);
helper.setMaxAutoSignInAttempts(0);
helper.setup(this);
}
}
if (getIntent().getExtras() != null) {
isChallenge = getIntent().getExtras().getBoolean("challenge");
}
rand = new Random();
// FRAGMENTS
if (savedInstanceState == null) {
gameFrag = new GameFragment();
gameFrag.setListener(this);
setModeGame();
gameOverFrag = new GameOverFragment();
gameOverFrag.setListener(this);
}
}
示例11: AndroidNetworkService
public AndroidNetworkService(AndroidLauncher activity) {
this.activity = activity;
gameHelper = new GameHelper(activity, GameHelper.CLIENT_GAMES);
gameHelper.enableDebugLog(true);
gameHelper.setShowErrorDialogs(true);
}
示例12: onCreate
@Override
protected void onCreate(Bundle savedInstanceState) {
requestWindowFeature(Window.FEATURE_NO_TITLE);
super.onCreate(savedInstanceState);
gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
gameHelper.enableDebugLog(false);
GameHelper.GameHelperListener gameHelperListener = new GameHelper.GameHelperListener() {
@Override
public void onSignInFailed() {
}
@Override
public void onSignInSucceeded() {
}
};
gameHelper.setup(gameHelperListener);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useAccelerometer = false;
config.useGyroscope = false;
MobileAds.initialize(this, APP_UNIT_ID);
vunglePub.init(this, APP_VUNGLE_ID, placement_list, new VungleInitListener() {
@Override
public void onSuccess() {
Log.d(LOG_TAG, "init success");
vunglePub.clearAndSetEventListeners(vungleDefaultListener);
}
@Override
public void onFailure(Throwable throwable) {
}
});
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
RelativeLayout layout = new RelativeLayout(this);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
layout.setLayoutParams(params);
createAdView();
layout.addView(adView);
createGameView(config);
layout.addView(gameView);
setContentView(layout);
startAdvertising(adView);
}
示例13: onCreate
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Create the layout
RelativeLayout layout = new RelativeLayout(this);
// Do the stuff that initialize() would do for you
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
// Create the libgdx View
View gameView = initializeForView(new GameListener(this));
// Add the libgdx view
layout.addView(gameView);
// ad mob
if (areAdsEnabled) {
// Create and setup the AdMob view
adView = new AdView(this);
adView.setAdUnitId(AdUnitId);
adView.setAdSize(AdSize.BANNER);
// adView.setAdListener(new ToastAdListener(this));
AdRequest adRequest = new AdRequest.Builder()
.addTestDevice(AdRequest.DEVICE_ID_EMULATOR)
.addTestDevice("425C0AD9758E9E82898D6CDAA982B111")
.build();
adView.loadAd(adRequest);
// Add the AdMob view
RelativeLayout.LayoutParams adParams =
new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.WRAP_CONTENT);
adParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
adParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
layout.addView(adView, adParams);
adView.setVisibility(View.GONE);
}
// achievements and leaderboards
if (areServicesEnabled) {
SharedPreferences sp = getSharedPreferences("GOOGLE_PLAY", Context.MODE_PRIVATE);
boolean automaticSignIn = sp.getBoolean("signed_in", false);
mHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
mHelper.setConnectOnStart(automaticSignIn);
if (DEBUG) {
mHelper.enableDebugLog(true);
}
mHelper.setup(this);
}
// Hook it all up
setContentView(layout);
}