Пример #1
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   PSNative.init(this);
   PSNetwork.init(this);
   PluginWrapper.init(this);
 }
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    String packageName = getApplication().getPackageName();
    super.setPackageName(packageName);

    setContentView(R.layout.activity_main);
    mGLView = (Cocos2dxGLSurfaceView) findViewById(R.id.game_gl_surfaceview);
    mGLView.setTextField((EditText) findViewById(R.id.textField));
  }
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    adsMogoLayoutCode = new AdsMogoLayout(this, "2bad837a65c040f0aee41cf992b26b21");
    FrameLayout.LayoutParams params =
        new FrameLayout.LayoutParams(
            FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
    // 设置广告出现的位置(悬浮于底部)
    params.bottomMargin = 0;
    // adsMogoLayoutCode.setGListener(this);
    params.gravity = Gravity.TOP | Gravity.CENTER_HORIZONTAL;

    params.topMargin = 40;
    addContentView(adsMogoLayoutCode, params);

    this.VP();
    this.JP();
  }
Пример #4
0
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    if (detectOpenGLES20()) {
      // get the packageName,it's used to set the resource path
      String packageName = getApplication().getPackageName();
      super.setPackageName(packageName);

      // FrameLayout
      ViewGroup.LayoutParams framelayout_params =
          new ViewGroup.LayoutParams(
              ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.FILL_PARENT);
      FrameLayout framelayout = new FrameLayout(this);
      framelayout.setLayoutParams(framelayout_params);

      // Cocos2dxEditText layout
      ViewGroup.LayoutParams edittext_layout_params =
          new ViewGroup.LayoutParams(
              ViewGroup.LayoutParams.FILL_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
      Cocos2dxEditText edittext = new Cocos2dxEditText(this);
      edittext.setLayoutParams(edittext_layout_params);

      // ...add to FrameLayout
      framelayout.addView(edittext);

      // Cocos2dxGLSurfaceView
      mGLView = new Cocos2dxGLSurfaceView(this);

      // ...add to FrameLayout
      framelayout.addView(mGLView);

      mGLView.setEGLContextClientVersion(2);
      mGLView.setCocos2dxRenderer(new Cocos2dxRenderer());
      mGLView.setTextField(edittext);

      // Set framelayout as the content view
      setContentView(framelayout);
    } else {
      Log.d("activity", "don't support gles2.0");
      finish();
    }
  }
Пример #5
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    // TODO Auto-generated method stub
    super.onCreate(savedInstanceState);

    PluginWrapper.init(this); // for plugins

    if (nativeIsLandScape()) {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    } else {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
    }

    // 2.Set the format of window

    // Check the wifi is opened when the native is debug.
    if (nativeIsDebug()) {
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
              WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
      if (!isNetworkConnected()) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Warning");
        builder.setMessage("Open Wifi for debuging...");
        builder.setPositiveButton(
            "OK",
            new DialogInterface.OnClickListener() {

              @Override
              public void onClick(DialogInterface dialog, int which) {
                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                finish();
                System.exit(0);
              }
            });
        builder.setCancelable(false);
        builder.show();
      }
    }
    hostIPAdress = getHostIpAddress();
  }
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
 }
Пример #7
0
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   if (!isFolderExists("/sdcard/ninjadash")) {
     return;
   }
 }
Пример #8
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    m_instance = this;

    super.onCreate(savedInstanceState);

    if (nativeIsLandScape()) {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
    } else {
      setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
    }

    // 2.Set the format of window

    // Check the wifi is opened when the native is debug.
    if (nativeIsDebug()) {
      getWindow()
          .setFlags(
              WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
              WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
      if (!isNetworkConnected()) {
        AlertDialog.Builder builder = new AlertDialog.Builder(this);
        builder.setTitle("Warning");
        builder.setMessage("Please open WIFI for debuging...");
        builder.setPositiveButton(
            "OK",
            new DialogInterface.OnClickListener() {

              @Override
              public void onClick(DialogInterface dialog, int which) {
                startActivity(new Intent(Settings.ACTION_WIFI_SETTINGS));
                finish();
                System.exit(0);
              }
            });

        builder.setNegativeButton("Cancel", null);
        builder.setCancelable(true);
        builder.show();
      }
      hostIPAdress = getHostIpAddress();
    }

    Udid.m_activity = this;

    NBGNative.nativeSetCountryCode(Locale.getDefault().getCountry());
    try {
      PackageInfo info = this.getPackageManager().getPackageInfo(this.getPackageName(), 0);
      // 当前应用的版本名称
      String versionName = info.versionName;
      // 当前版本的版本号
      int versionCode = info.versionCode;
      // 当前版本的包名
      String packageNames = info.packageName;
      NBGNative.nativeSetAppInfo(packageNames, versionName, versionCode);
    } catch (NameNotFoundException e) {
      e.printStackTrace();
    }

    NBGNetManager.getInstance();
    NBGNetManager.init(this);
  }
Пример #9
0
 @Override
 public void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
 }