Tabnine Logo
PurchaseSystem.setManager
Code IndexAdd Tabnine to your IDE (free)

How to use
setManager
method
in
com.badlogic.gdx.pay.PurchaseSystem

Best Java code snippets using com.badlogic.gdx.pay.PurchaseSystem.setManager (Showing top 5 results out of 315)

origin: com.badlogicgames.gdxpay/gdx-pay-android

/**
 * @param activity The AndroidApplication activity.
 * @param requestCode The request code to use in case they are needed (not all stores need them). */
public IAP (Activity activity, int requestCode) {
  // are we on GooglePlay?
  try {
    Class<?> googlePlayClazz = Class.forName("com.badlogic.gdx.pay.android.googleplay.AndroidGooglePlayPurchaseManager");
    Method method = googlePlayClazz.getMethod("isRunningViaGooglePlay", Activity.class);
    if ((Boolean)method.invoke(googlePlayClazz, activity)) {
      // we are running on GooglePlay: let's set the purchase manager and be done with it!
      PurchaseSystem.setManager((PurchaseManager)googlePlayClazz.getConstructor(Activity.class, int.class).newInstance(activity, requestCode));
      return;
    }
  } catch (Exception e) {
    Log.d(TAG, "Failed to locate purchase manager for GooglePlay (gdx-pay-android-googleplay.jar file not installed)", e);
  }
}
origin: libgdx/gdx-pay

/**
 * @param activity The AndroidApplication activity.
 * @param requestCode The request code to use in case they are needed (not all stores need them). */
public IAP (Activity activity, int requestCode) {
  // are we on GooglePlay?
  try {
    Class<?> googlePlayClazz = Class.forName("com.badlogic.gdx.pay.android.googleplay.AndroidGooglePlayPurchaseManager");
    Method method = googlePlayClazz.getMethod("isRunningViaGooglePlay", Activity.class);
    if ((Boolean)method.invoke(googlePlayClazz, activity)) {
      // we are running on GooglePlay: let's set the purchase manager and be done with it!
      PurchaseSystem.setManager((PurchaseManager)googlePlayClazz.getConstructor(Activity.class, int.class).newInstance(activity, requestCode));
      return;
    }
  } catch (Exception e) {
    Log.d(TAG, "Failed to locate purchase manager for GooglePlay (gdx-pay-android-googleplay.jar file not installed)", e);
  }
}
origin: libgdx/gdx-pay

@Before
public void setUp() throws Exception {
  PurchaseSystem.setManager(purchaseManager);
}
origin: libgdx/gdx-pay

@SuppressWarnings("unused") // Unit tested with reflection. (as in IAP.java)
public AndroidGooglePlayPurchaseManager(Activity activity,
                    AndroidFragmentApplication application,
                    int activityRequestCode) {
  PurchaseResponseActivityResultConverter converter = new PurchaseResponseActivityResultConverter(this);
  AsyncExecutor executor = new NewThreadSleepAsyncExecutor();
  ApplicationProxy.FragmentProxy proxy = new ApplicationProxy.FragmentProxy(activity, application);
  googleInAppBillingService = new V3GoogleInAppBillingService(proxy, activityRequestCode, converter, executor);
  PurchaseSystem.setManager(this);
}
origin: libgdx/gdx-pay

PurchaseSystem.setManager((PurchaseManager) ClassReflection.newInstance(iapClazz));
com.badlogic.gdx.payPurchaseSystemsetManager

Javadoc

Registers a new purchase manager.

Popular methods of PurchaseSystem

  • dispose
  • getManager
  • hasManager
    Returns true if there is a purchase manager available.
  • install
    Installs a purchase observer.
  • onAppRestarted
    Disposes static instances in case JVM is re-used on restarts.
  • resolve
    We try to locate a suitable store via Java reflection.

Popular in Java

  • Updating database using SQL prepared statement
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • onCreateOptionsMenu (Activity)
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Iterator (java.util)
    An iterator over a sequence of objects, such as a collection.If a collection has been changed since
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Notification (javax.management)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now