Java 类com.badlogic.gdx.backends.android.AndroidApplication 实例源码

项目:abattle    文件:RequestHandlerImpl.java   
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);
}
项目:shadow-engine    文件:AndroidModLoader.java   
@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);
    }

}
项目:gdx-fireapp    文件:Analytics.java   
/**
 * 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;
}
项目:gdx-firebase    文件:AndroidFirebaseAuth.java   
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);
    }
}
项目:submarine    文件:AndroidAdColonyNetwork.java   
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);
}
项目:submarine    文件:AndroidAdMobNetwork.java   
public AndroidAdMobNetwork(AndroidApplication androidApplication, String adViewUnitId, String interstitialAdUnitId, String testDevice) {
    this.androidApplication = androidApplication;
    this.adViewUnitId = adViewUnitId;
    this.interstitialAdUnitId = interstitialAdUnitId;
    this.testDevice = testDevice;
    initInterstitial();
    initBanner();
}
项目:gdx-pay    文件:AndroidGooglePlayPurchaseManager.java   
@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);
}
项目:shadow-engine    文件:AndroidModLoader.java   
@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);
}
项目:cocos2d-java    文件:ApplicationStartup.java   
public static final void start(AppDelegate appDelegate, AndroidApplication application) {
    application.initialize(new BaseGame(appDelegate), getConfiguration());
}
项目:gdx-fireapp    文件:Analytics.java   
/**
 * {@inheritDoc}
 */
@Override
public void setScreen(String name, Class<?> screenClass)
{
    getFirebaseAnalytics().setCurrentScreen((AndroidApplication) Gdx.app, name, screenClass.getSimpleName());
}
项目:submarine    文件:AndroidAdMobNetwork.java   
public AndroidAdMobNetwork(AndroidApplication androidApplication, String adViewUnitId, String interstitialAdUnitId) {
    this(androidApplication, adViewUnitId, interstitialAdUnitId, null);
}
项目:libgdxcn    文件:ControllerLifeCycleListener.java   
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);
}
项目:libgdxcn    文件:ControllerLifeCycleListener.java   
@Override
public void resume () {
    inputManager.registerInputDeviceListener(this, ((AndroidApplication)Gdx.app).handler);
    Gdx.app.log(TAG, "controller life cycle listener resumed");
}
项目:gdx-pay    文件:V3GoogleInAppBillingService.java   
public V3GoogleInAppBillingService(AndroidApplication application, int activityRequestCode, PurchaseResponseActivityResultConverter purchaseResponseActivityResultConverter, AsyncExecutor asyncExecutor) {
    this(new ApplicationProxy.ActivityProxy(application),
            activityRequestCode, purchaseResponseActivityResultConverter, asyncExecutor);
}
项目:gdx-pay    文件:ApplicationProxy.java   
public ActivityProxy(AndroidApplication application) {
    this.application = application;
}
项目:droidar    文件:GDXConnection.java   
public GDXConnection(GL1Renderer renderer) {
    Gdx.app = new AndroidApplication();
    myRenderer = renderer;

}
项目:gdx-nativefilechooser    文件:AndroidFileChooser.java   
/**
 * Initialize a new {@code AndroidFileChooser} with given non-null
 * {@link AndroidApplication}.
 * 
 * @param application
 *            Application this file chooser will interact with
 */
public AndroidFileChooser(AndroidApplication application) {
    super();
    NativeFileChooserUtils.checkNotNull(application, "application");
    this.app = application;
}