本文整理汇总了Java中com.badlogic.gdx.backends.android.AndroidApplicationConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java AndroidApplicationConfiguration类的具体用法?Java AndroidApplicationConfiguration怎么用?Java AndroidApplicationConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
AndroidApplicationConfiguration类属于com.badlogic.gdx.backends.android包,在下文中一共展示了AndroidApplicationConfiguration类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
/**
* {@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
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (LeakCanary.isInAnalyzerProcess(this)) {
// This process is dedicated to LeakCanary for heap analysis.
// You should not init your app in this process.
return;
}
LeakCanary.install(this.getApplication());
playService = new AndroidNetworkService(this);
no.ntnu.tdt4240.asteroids.service.ISettingsService settingsService = new AndroidSettingsService(this.getApplicationContext());
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useCompass = false;
config.useAccelerometer = false;
config.useImmersiveMode = true;
config.useWakelock = true;
initialize(new Asteroids(playService, settingsService), config);
playService.setup();
}
示例3: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Initialize the Mobile Ads SDK.
MobileAds.initialize(this, APP_ID);
AndroidApplicationConfiguration cfg = new AndroidApplicationConfiguration();
cfg.useGyroscope = false;
cfg.useCompass = true;
cfg.useAccelerometer = true;
// 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);
RelativeLayout layout = new RelativeLayout(this);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
RelativeLayout.LayoutParams.MATCH_PARENT,
RelativeLayout.LayoutParams.MATCH_PARENT);
layout.setLayoutParams(params);
AdView admobView = createAdView();
layout.addView(admobView);
View gameView = createGameView(cfg);
layout.addView(gameView);
setContentView(layout);
startAdvertising(admobView);
}
示例4: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);*/
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
Bitmap bm = BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher);
ActivityManager.TaskDescription td = new ActivityManager.TaskDescription("Les Chroniques De Norwand", bm, Color.parseColor("#30346D"));
setTaskDescription(td);
bm.recycle();
}
config.useImmersiveMode = true;
initialize(new MainGame(""), config);
}
示例5: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if(savedInstanceState == null){
AssetRepository.getInstance().dispose();
sharedPreferences = getPreferences(Context.MODE_PRIVATE);
config = new AndroidApplicationConfiguration();
config.numSamples = 1;
gameBase = new GameBase(this);
gameBase.highScore = sharedPreferences.getInt(getString(R.string.saved_high_score), 0);
vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
initialize(gameBase, config);
}
}
示例6: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
int res = ContextCompat.checkSelfPermission(this.getContext(), Manifest.permission.WRITE_EXTERNAL_STORAGE);
if(res != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(
this,
new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE },
0);
}
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.disableAudio = true;
config.useWakelock = true;
config.useCompass = false;
config.useAccelerometer = false;
config.useImmersiveMode = true;
// config.hideStatusBar = true;
config.useGL30 = true;
Main main = new Main();
main.fragmentShaderPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/shader.frag";
initialize(main, config);
}
示例7: initControls
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
public void initControls() {
gdxAdapter.setOnSceneLoadedListener(new DemoMotionGdxAdapter.OnSceneLoadedListener() {
@Override
public void onSceneLoaded() {
sceneLoaded = true;
runOnUiThread(new Runnable() {
@Override
public void run() {
presenter.setViewListener(DemoMotionActivity.this, deviceAddress);
}
});
}
});
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.disableAudio = true;
config.hideStatusBar = false;
config.useAccelerometer = false;
config.useCompass = false;
config.useImmersiveMode = false;
config.useWakelock = false;
gdx3dView = initializeForView(gdxAdapter, config);
carAnimationHolder.addView(gdx3dView);
}
示例8: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_ar);
Log.d(LOGTAG, "onCreate");
session = new AppSession(this);
session.initAR(this, ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
mRenderer = new VuforiaRenderer(session);
FrameLayout container = (FrameLayout) findViewById(R.id.ar_container);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useAccelerometer = false;
config.useCompass = false;
//config.useGL20 = true;
mEngine = new Engine(mRenderer);
View glView = initializeForView(mEngine, config);
container.addView(glView);
}
示例9: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
/** Инициализация приложения */
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
// Запрет на отключение экрана и использование датчиков имплементацией libgdx
config.useWakelock = true;
config.useAccelerometer = false;
config.useGyroscope = false;
config.useCompass = false;
config.numSamples = 2;
// Создание своего листенера данных с датчиков (поэтому useAccelerometer и т.п. не нужны)
vrSensorManagerAndroid = new VRSensorManagerAndroid(this.getContext());
initialize(new GdxVR(vrSensorManagerAndroid), config);
}
示例10: onCreateView
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.setLogLevel(100);
//initialize platform bitmap factory
org.oscim.android.canvas.AndroidGraphics.init();
GdxAssets.init("");
GLAdapter.init(new AndroidGL());
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.stencil = 8;
config.numSamples = 2;
new SharedLibraryLoader().load("vtm-jni");
View view = initializeForView(new CacheboxMain(), config);
//initialize platform connector
PlatformConnector.init(new AndroidPlatformConnector(this));
return view;
}
示例11: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
/**
* Called when the activity is first created.
*/
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mainHandler = new Handler(getMainLooper());
DisplayMetrics metrics = new DisplayMetrics();
getWindowManager().getDefaultDisplay().getMetrics(metrics);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.hideStatusBar = true;
config.useAccelerometer = false;
config.useCompass = false;
final AndroidMobileApi api = new AndroidMobileApi(this);
initialize(new DiceHeroes(api), config);
gameServicesHelper = new GameServicesHelper(this);
purchaseHelper = new PurchaseHelper(this, api);
}
示例12: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@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();
}
示例13: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
config.useAccelerometer = false;
config.useCompass = false;
config.useGyroscope = false;
config.useWakelock = false;
initialize(new GGVmApplication(GameModuleProvider.provideGameModule(), MobileMenu.class, TouchInputProcessor.class), config);
}
示例14: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
Log.d("ANDROID_Launcher","initialize");
initialize(new NoRiskNoFun(getIpAddress()), config);
}
示例15: onCreate
import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; //导入依赖的package包/类
@Override
protected void onCreate (Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
AndroidApplicationConfiguration config = new AndroidApplicationConfiguration();
//config.addIcon("chapaicon.png", Files.FileType.Internal);
initialize(new FlappyChapa(), config);
}