if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
これだけです!
そしたらファイル全体がこんな感じになると思います。
package org.cocos2dx.cpp;
import android.os.Bundle;
import org.cocos2dx.lib.Cocos2dxActivity;
public class AppActivity extends Cocos2dxActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.setEnableVirtualButton(false);
super.onCreate(savedInstanceState);
// ここから
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) {
setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE);
}
// ここまで
// Workaround in https://stackoverflow.com/questions/16283079/re-launch-of-activity-on-home-button-but-only-the-first-time/16447508
if (!isTaskRoot()) {
// Android launched another instance of the root activity into an existing task
// so just quietly finish and go away, dropping the user back into the activity
// at the top of the stack (ie: the last state of this task)
// Don't need to finish it again since it's finished in super.onCreate .
return;
}
// DO OTHER INITIALIZATION BELOW
}
}
※How to save a remote server SSL certificate locally as a fileのelec3647の回答
余談になりますが、実際全く違うサイトの証明書を落としてきて試したところ、ここのca証明書なんでもいいようです。
/cocos2d/cocos/network/HttpClient-android.cppの541行あたりのsetVerifySSL()を見ると分かりますが、まずはssl caファイルをチェックし、それがなければ狙いのsetVerifySSLに通してくれないので、あまり意味がなくても設定します。 ※あっ!もしかして、そのif(_client->getSSLVerification().empty()) returnをコメントアウトする手もあったでは?!