当前位置: 首页>>代码示例>>Java>>正文


Java AndroidApplication类代码示例

本文整理汇总了Java中com.badlogic.gdx.backends.android.AndroidApplication的典型用法代码示例。如果您正苦于以下问题:Java AndroidApplication类的具体用法?Java AndroidApplication怎么用?Java AndroidApplication使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AndroidApplication类属于com.badlogic.gdx.backends.android包,在下文中一共展示了AndroidApplication类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: RequestHandlerImpl

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public RequestHandlerImpl(final View gameView, final AndroidApplication app, final RelativeLayout layout) {
  Validate.notNulls(gameView, app, layout);
  this.gameView = gameView;
  this.app = app;
  Context _applicationContext = app.getApplicationContext();
  WebView _webView = new WebView(_applicationContext);
  this.webView = _webView;
  this.webView.setWebViewClient(new WebViewClient() {
    @Override
    public boolean shouldOverrideUrlLoading(final WebView view, final String url) {
      final Context context = view.getContext();
      Uri _parse = Uri.parse(url);
      final Intent browserIntent = new Intent(Intent.ACTION_VIEW, _parse);
      browserIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
      context.startActivity(browserIntent);
      return true;
    }
  });
  final RelativeLayout.LayoutParams webViewParams = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT, 
    RelativeLayout.LayoutParams.WRAP_CONTENT);
  webViewParams.addRule(RelativeLayout.ALIGN_PARENT_TOP);
  webViewParams.addRule(RelativeLayout.ALIGN_PARENT_RIGHT);
  WebSettings _settings = this.webView.getSettings();
  _settings.setJavaScriptEnabled(false);
  layout.addView(this.webView, webViewParams);
}
 
开发者ID:CymricNPG,项目名称:abattle,代码行数:27,代码来源:RequestHandlerImpl.java

示例2: init

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
@Override
public void init(String root, Array<String> blacklist) {
	PackageManager pm = ((AndroidApplication)Gdx.app).getPackageManager();
	if (pm == null) {
		return;
	}

	//TODO Find out whether META_DATA can be replaced with simple 0
	List<PackageInfo> rawpkgs = pm.getInstalledPackages(PackageManager.GET_META_DATA);
	for (PackageInfo pkg : rawpkgs) {
		String packageName = pkg.packageName;
		if (blacklist != null && blacklist.contains(packageName, false)) {
			ModManager.filesIgnored.add(new ModFile(packageName));
			continue;
		}
		load(packageName);
	}

}
 
开发者ID:0x0ade,项目名称:shadow-engine,代码行数:20,代码来源:AndroidModLoader.java

示例3: getFirebaseAnalytics

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
/**
 * Get FirebaseAnalytics instance in lazy-loading way.
 *
 * @return Instance of FirebaseAnalytics class. This instance should be use later to do some analytics actions.
 */
protected FirebaseAnalytics getFirebaseAnalytics()
{
    if (firebaseAnalytics == null)
        firebaseAnalytics = FirebaseAnalytics.getInstance((AndroidApplication) Gdx.app);
    return firebaseAnalytics;
}
 
开发者ID:mk-5,项目名称:gdx-fireapp,代码行数:12,代码来源:Analytics.java

示例4: AndroidFirebaseAuth

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public AndroidFirebaseAuth(Activity activity, FirebaseConfiguration firebaseConfiguration) {
    this.firebaseConfiguration = firebaseConfiguration;
    this.activity = activity;
    this.firebaseAuth = com.google.firebase.auth.FirebaseAuth.getInstance();
    fbAuthStateListeners = new Array<>();
    authStateListeners = new Array<>();


    if (Gdx.app instanceof AndroidApplication) {
        ((AndroidApplication) Gdx.app).addAndroidEventListener(this);
    } else if (Gdx.app instanceof AndroidFragmentApplication) {
        ((AndroidFragmentApplication) Gdx.app).addAndroidEventListener(this);
    }
}
 
开发者ID:TomGrill,项目名称:gdx-firebase,代码行数:15,代码来源:AndroidFirebaseAuth.java

示例5: AndroidAdColonyNetwork

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public AndroidAdColonyNetwork(AndroidApplication androidApplication, String clientOptions, String appId, String[] zoneIds) {
    this.androidApplication = androidApplication;
    this.internalAdColonyAdListener = new AndroidAdColonyAdListener();
    this.adLoadingListener = new AdColonyAdLoadingListener() {
        @Override
        public void behaveOnStatus(String status) {

        }
    };
    configure(clientOptions, appId, zoneIds);
}
 
开发者ID:UnderwaterApps,项目名称:submarine,代码行数:12,代码来源:AndroidAdColonyNetwork.java

示例6: AndroidAdMobNetwork

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public AndroidAdMobNetwork(AndroidApplication androidApplication, String adViewUnitId, String interstitialAdUnitId, String testDevice) {
    this.androidApplication = androidApplication;
    this.adViewUnitId = adViewUnitId;
    this.interstitialAdUnitId = interstitialAdUnitId;
    this.testDevice = testDevice;
    initInterstitial();
    initBanner();
}
 
开发者ID:UnderwaterApps,项目名称:submarine,代码行数:9,代码来源:AndroidAdMobNetwork.java

示例7: AndroidGooglePlayPurchaseManager

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
@SuppressWarnings("unused") // Unit tested with reflection. (as in IAP.java)
public AndroidGooglePlayPurchaseManager(Activity activity, int activityRequestCode) {
    if (!(activity instanceof AndroidApplication)) {
        throw new IllegalArgumentException("Bootstrapping gdx-pay only supported with AndroidApplication activity.");
    }
    AndroidApplication application = (AndroidApplication) activity;
    PurchaseResponseActivityResultConverter converter = new PurchaseResponseActivityResultConverter(this);
    AsyncExecutor executor = new NewThreadSleepAsyncExecutor();
    googleInAppBillingService = new V3GoogleInAppBillingService(application, activityRequestCode, converter, executor);
}
 
开发者ID:libgdx,项目名称:gdx-pay,代码行数:11,代码来源:AndroidGooglePlayPurchaseManager.java

示例8: delete

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
@Override
public void delete(ModFile modfile) {
	if (!modfile.canDelete) {
		throw new RuntimeException("Can not uninstall "+modfile.pkg+" as ModFile.canDelete == false");
	}
	Intent intent = new Intent(Intent.ACTION_DELETE, Uri.parse("package:"+modfile.pkg));
	((AndroidApplication)Gdx.app).startActivity(intent);
}
 
开发者ID:0x0ade,项目名称:shadow-engine,代码行数:9,代码来源:AndroidModLoader.java

示例9: start

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public static final void start(AppDelegate appDelegate, AndroidApplication application) {
	application.initialize(new BaseGame(appDelegate), getConfiguration());
}
 
开发者ID:mingwuyun,项目名称:cocos2d-java,代码行数:4,代码来源:ApplicationStartup.java

示例10: setScreen

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public void setScreen(String name, Class<?> screenClass)
{
    getFirebaseAnalytics().setCurrentScreen((AndroidApplication) Gdx.app, name, screenClass.getSimpleName());
}
 
开发者ID:mk-5,项目名称:gdx-fireapp,代码行数:9,代码来源:Analytics.java

示例11: ControllerLifeCycleListener

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public ControllerLifeCycleListener(AndroidControllers controllers) {
	this.controllers = controllers;
	this.inputManager = (InputManager)((Context)Gdx.app).getSystemService(Context.INPUT_SERVICE);
	Gdx.app.addLifecycleListener(this);
	inputManager.registerInputDeviceListener(this, ((AndroidApplication)Gdx.app).handler);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:7,代码来源:ControllerLifeCycleListener.java

示例12: resume

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
@Override
public void resume () {
	inputManager.registerInputDeviceListener(this, ((AndroidApplication)Gdx.app).handler);
	Gdx.app.log(TAG, "controller life cycle listener resumed");
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:6,代码来源:ControllerLifeCycleListener.java

示例13: V3GoogleInAppBillingService

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public V3GoogleInAppBillingService(AndroidApplication application, int activityRequestCode, PurchaseResponseActivityResultConverter purchaseResponseActivityResultConverter, AsyncExecutor asyncExecutor) {
    this(new ApplicationProxy.ActivityProxy(application),
            activityRequestCode, purchaseResponseActivityResultConverter, asyncExecutor);
}
 
开发者ID:libgdx,项目名称:gdx-pay,代码行数:5,代码来源:V3GoogleInAppBillingService.java

示例14: ActivityProxy

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public ActivityProxy(AndroidApplication application) {
    this.application = application;
}
 
开发者ID:libgdx,项目名称:gdx-pay,代码行数:4,代码来源:ApplicationProxy.java

示例15: GDXConnection

import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public GDXConnection(GL1Renderer renderer) {
	Gdx.app = new AndroidApplication();
	myRenderer = renderer;

}
 
开发者ID:simon-heinen,项目名称:droidar,代码行数:6,代码来源:GDXConnection.java


注:本文中的com.badlogic.gdx.backends.android.AndroidApplication类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。