@Override
 protected void onStop() {
   Log.d(TAG, "onStop");
   super.onStop();
   // android.os.Process.killProcess(android.os.Process.myPid());
   // gameHelper.onStop();
 }
 // keith network
 @Override
 protected void onStart() {
   Log.d(TAG, "onStart");
   super.onStart();
   // gameHelper.onStart(this);
   mGoogleApiClient.connect();
 }
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   // config.useGLSurfaceView20API18 = true;
   initialize(new MyGdxGame(), config);
 }
Beispiel #4
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    try {
      AudioManager am = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
      String s1 = am.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE);
      String s2 = am.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER);

      if (s1 != null && s2 != null) {
        World.freq = Integer.parseInt(s1);
        World.samples = Integer.parseInt(s2);
        System.out.println(
            "AudioManager suggested fs=" + World.freq + ", samples=" + World.samples);
      }

    } catch (Throwable t) {
      System.err.println("Could not get device defaults: " + t.toString());
    }

    AndroidService.setInstance(new AndroidService(this));

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useAccelerometer = false;
    cfg.useCompass = false;
    cfg.useWakelock = true;
    initialize(new DrumApp(), cfg);
  }
 @Override
 public void onStop() {
   super.onStop();
   if (IS_PLAY_SERVICE_ACTIVE) {
     this.gameHelper.onStop();
   }
 }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();

    initialize(new MyGameColumns(), config);
  }
Beispiel #7
0
 @Override
 public void onDestroy() {
   super.onDestroy();
   if (mService != null) {
     unbindService(mServiceConn);
   }
 }
Beispiel #8
0
  @Override
  protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == 1001) {
      int responseCode = data.getIntExtra("RESPONSE_CODE", 0);
      String purchaseData = data.getStringExtra("INAPP_PURCHASE_DATA");
      String dataSignature = data.getStringExtra("INAPP_DATA_SIGNATURE");

      if (resultCode == RESULT_OK) {
        try {
          JSONObject jo = new JSONObject(purchaseData);
          String sku = jo.getString("productId");
          String name = null;

          if (sku.equals("ryan")) name = "Ryan";
          else if (sku.equals("ash")) name = "Ash";
          else if (sku.equals("rob")) name = "Rob";
          else if (sku.equals("battle_cat")) name = "BattleCat";
          else if (sku.equals("xorp")) name = "Xorp";
          else if (sku.equals("rootsworth")) name = "Rootsworth";
          else if (sku.equals("snap")) name = "Snap";
          else if (sku.equals("metatron")) name = "Metatron";
          else if (sku.equals("abaddon")) name = "Abaddon";

          pref.putBoolean(name, true);
          pref.flush();
        } catch (JSONException e) {
          //					alert("Failed to parse purchase data.");
          e.printStackTrace();
        }
      }
    }
    super.onActivityResult(requestCode, resultCode, data);
    _gameHelper.onActivityResult(requestCode, resultCode, data);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    Log.e(TAG, "onCreate");
    super.onCreate(savedInstanceState);

    MyAppApplication myApp = ((MyAppApplication) getApplicationContext());
    mGoogleApiClient = myApp.getClient();
    room = myApp.getRoom();
    mRoomId = room.getRoomId();
    mParticipants = room.getParticipants();

    Intent i = getIntent();
    myself = (Player) i.getSerializableExtra("myself");

    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    initialize(new CatMath(this, myself), config); // updated by siyuan

    myId = room.getParticipantId(Games.Players.getCurrentPlayerId(myApp.getClient()));
    GameWorld.isOwner = isServer();
    Log.e("isOwner:", String.valueOf(GameWorld.isOwner));
    playerMap.put(myId, 1);
    GameWorld.numberOfPlayers = mParticipants.size();

    Log.e(TAG, "onCreate ends");
  } // end of onCreate
Beispiel #10
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   new CardboardImplementation();
   initialize(new SimpleRoom(), config);
 }
Beispiel #11
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   config.useAccelerometer = false;
   config.useCompass = false;
   initialize(new Drop(), config);
 }
  /*
   * (non-Javadoc)
   * @see android.app.Activity#onCreate(android.os.Bundle)
   *
   * cfg.use20 = true um Texturen zu verwenden welche nicht PowerOf2 verwenden ( z.b. 8x8, 16x16, 32x32 usw. )
   */
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = true;

    initialize(new MainTutorials(), cfg);
  }
 @Override
 public void onStop() {
   super.onStop();
   if (mGoogleApiClient != null && mGoogleApiClient.isConnected()) {
     mGoogleApiClient.disconnect();
     SystemUtils.toast(this, "mGoogleApiClient.disconnect()");
   }
 }
Beispiel #14
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();

    initialize(new StampedeGame(), cfg);
  }
Beispiel #15
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;

    initialize(new WebDefender(), cfg);
  }
Beispiel #16
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = true;

    initialize(new PickinGas(), cfg);
  }
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   config.useGL20 = true;
   Engine engine = new Engine();
   initialize(engine, config);
   engine.setLoadingPath("", true);
 }
Beispiel #18
0
 /** Called when the activity is first created. */
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   config.useAccelerometer = false;
   config.useCompass = false;
   config.useWakelock = true;
   config.useGL20 = true;
   initialize(new StarAssault(), config);
 }
 public void onCreate(android.os.Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   RT.var("clojure.core", "require").invoke(Symbol.intern("hello-world.core"));
   try {
     Game game = (Game) RT.var("hello-world.core", "hello-world").deref();
     initialize(game);
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
  @Override
  protected void onDestroy() {
    Log.d(TAG, "onDestroy");
    super.onDestroy();
    Games.RealTimeMultiplayer.leave(mGoogleApiClient, this, mRoomId);
    Gdx.app.exit();
    GameWorld.reset();

    // gameHelper.onStop();
  }
Beispiel #21
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   config.useAccelerometer = false;
   config.useCompass = false;
   config.useGLSurfaceView20API18 = true;
   initialize(new Side(), config);
   Gdx.app.setLogLevel(LOG_DEBUG);
 }
Beispiel #22
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
   gameHelper.enableDebugLog(true);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   game = new Game(this);
   initialize(game, config);
   gameHelper.setup(this);
 }
Beispiel #23
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = true;
    cfg.useAccelerometer = false;
    cfg.useCompass = false;

    initialize(new Lumpundform(), cfg);
  }
Beispiel #24
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
   initialize(
       new AbstractGame() {
         @Override
         protected void init() {}
       },
       config);
 }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;

    // PLATFORM_DESKTOP = 0;
    // PLATFORM_ANDROID = 1;
    // PLATFORM_OUYA = 2;
    initialize(new BashNBump(1), cfg);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;

    // Prevent the screen from dimming
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    initialize(new MyCoolGame(), cfg);
  }
  public void onCreate(Bundle var1) {
    super.onCreate(var1);
    this.getWindow().addFlags(128);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;
    cfg.useAccelerometer = true;
    cfg.useCompass = false;

    this.requestWindowFeature(1);
    this.getWindow().setFlags(1024, 1024);
    this.getWindow().clearFlags(2048);

    layout = new RelativeLayout(this);
    layout.setLayoutParams(new LayoutParams(-1, -1));

    adView = this.createAdView();
    // layout.addView(adView);
    layout.addView(this.createGameView(cfg));

    this.setContentView(layout);
    this.startAdvertising(adView);

    this.interstitialAd = new InterstitialAd(this);
    this.interstitialAd.setAdUnitId(AD_UNIT_ID_INTERSTITIAL);
    interstitialAd.setAdListener(
        new AdListener() {
          @Override
          public void onAdLoaded() {
            if (DEBUG) {
              Toast.makeText(
                      getApplicationContext(), "Finished Loading Interstitial", Toast.LENGTH_SHORT)
                  .show();
            }
          }

          @Override
          public void onAdClosed() {
            if (DEBUG) {
              Toast.makeText(getApplicationContext(), "Closed Interstitial", Toast.LENGTH_SHORT)
                  .show();
            }
          }
        });

    if (this.gameHelper == null) {
      this.gameHelper = new GameHelper(this, 1);
      this.gameHelper.enableDebugLog(true);
    }

    this.gameHelper.setup(this);
  }
Beispiel #28
0
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
    cfg.useGL20 = false;
    cfg.useAccelerometer = false;
    cfg.useCompass = false;
    Texture.setEnforcePotImages(false);

    Assets ass = new Assets();
    ass.manager.load(Assets.class);

    initialize(new Endless_RPG(new AndroidGameOrientation()), cfg);
  }
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.i(tag, "on create activiy");
    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    config.useWakelock = true;
    createWakeLock(config);
    game = new PokerGame();
    MyPoker.game = game;
    initialize(game, config);

    MyPoker.client.setListener(game);
    // game.onReceivedJson(MyPoker.json);

  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // fix for launcher icon starting new activity on top of old one
    if ((getIntent().getFlags() & Intent.FLAG_ACTIVITY_BROUGHT_TO_FRONT) != 0) {
      finish();
      return;
    }

    listeners = new Array<ActionListener>();

    AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
    config.useAccelerometer = false;
    config.useCompass = false;
    config.hideStatusBar = true;
    // config.useImmersiveMode = true;
    config.useAccelerometer = false;

    if (GameScreen.SOFT_DEBUG) config.useWakelock = true;

    MyGame.setPlatformSpecific(this);

    initialize(new MyGame(), config);

    // create app exit
    alertBuilder = new AlertDialog.Builder(this);
    alertBuilder.setTitle("Exit");
    alertBuilder.setMessage("Do you really want to exit?");
    alertBuilder.setCancelable(true);
    alertBuilder.setPositiveButton(
        "Yes",
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int id) {
            Gdx.app.exit();
          }
        });
    alertBuilder.setNegativeButton(
        "No",
        new DialogInterface.OnClickListener() {
          public void onClick(DialogInterface dialog, int id) {
            dialog.cancel();
          }
        });
  }