本文整理汇总了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);
}
示例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);
}
}
示例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;
}
示例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);
}
}
示例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);
}
示例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();
}
示例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);
}
示例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);
}
示例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());
}
示例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());
}
示例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);
}
示例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");
}
示例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);
}
示例14: ActivityProxy
import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public ActivityProxy(AndroidApplication application) {
this.application = application;
}
示例15: GDXConnection
import com.badlogic.gdx.backends.android.AndroidApplication; //导入依赖的package包/类
public GDXConnection(GL1Renderer renderer) {
Gdx.app = new AndroidApplication();
myRenderer = renderer;
}