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); }
@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); } }
/** * 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; }
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); } }
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); }
public AndroidAdMobNetwork(AndroidApplication androidApplication, String adViewUnitId, String interstitialAdUnitId, String testDevice) { this.androidApplication = androidApplication; this.adViewUnitId = adViewUnitId; this.interstitialAdUnitId = interstitialAdUnitId; this.testDevice = testDevice; initInterstitial(); initBanner(); }
@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); }
@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); }
public static final void start(AppDelegate appDelegate, AndroidApplication application) { application.initialize(new BaseGame(appDelegate), getConfiguration()); }
/** * {@inheritDoc} */ @Override public void setScreen(String name, Class<?> screenClass) { getFirebaseAnalytics().setCurrentScreen((AndroidApplication) Gdx.app, name, screenClass.getSimpleName()); }
public AndroidAdMobNetwork(AndroidApplication androidApplication, String adViewUnitId, String interstitialAdUnitId) { this(androidApplication, adViewUnitId, interstitialAdUnitId, null); }
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); }
@Override public void resume () { inputManager.registerInputDeviceListener(this, ((AndroidApplication)Gdx.app).handler); Gdx.app.log(TAG, "controller life cycle listener resumed"); }
public V3GoogleInAppBillingService(AndroidApplication application, int activityRequestCode, PurchaseResponseActivityResultConverter purchaseResponseActivityResultConverter, AsyncExecutor asyncExecutor) { this(new ApplicationProxy.ActivityProxy(application), activityRequestCode, purchaseResponseActivityResultConverter, asyncExecutor); }
public ActivityProxy(AndroidApplication application) { this.application = application; }
public GDXConnection(GL1Renderer renderer) { Gdx.app = new AndroidApplication(); myRenderer = renderer; }
/** * 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; }