當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。