Android Open Source - Divide_And_Conquer_Card_Shuffler Consts






From Project

Back to project page Divide_And_Conquer_Card_Shuffler.

License

The source code is released under:

MIT License

If you think the Android project Divide_And_Conquer_Card_Shuffler listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

/*
 * Copyright (C) 2010 The Android Open Source Project
 *//from   w w  w  . j  a  va 2 s  .  c o  m
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.andrewkeeton.divide.and.conquer.card.shuffler.billing;

/**
 * This class holds global constants that are used throughout the application to
 * support in-app billing.
 */
public class Consts {
  // The response codes for a request, defined by Android Market.
  public enum ResponseCode {
    RESULT_OK, RESULT_USER_CANCELED, RESULT_SERVICE_UNAVAILABLE, RESULT_BILLING_UNAVAILABLE, RESULT_ITEM_UNAVAILABLE, RESULT_DEVELOPER_ERROR, RESULT_ERROR;

    // Converts from an ordinal value to the ResponseCode
    public static ResponseCode valueOf(int index) {
      ResponseCode[] values = ResponseCode.values();
      if (index < 0 || index >= values.length) {
        return RESULT_ERROR;
      }
      return values[index];
    }
  }

  // The possible states of an in-app purchase, as defined by Android Market.
  public enum PurchaseState {
    // Responses to requestPurchase or restoreTransactions.
    PURCHASED, // User was charged for the order.
    CANCELED, // The charge failed on the server.
    REFUNDED; // User received a refund for the order.

    // Converts from an ordinal value to the PurchaseState
    public static PurchaseState valueOf(int index) {
      PurchaseState[] values = PurchaseState.values();
      if (index < 0 || index >= values.length) {
        return CANCELED;
      }
      return values[index];
    }
  }

  /** This is the action we use to bind to the MarketBillingService. */
  public static final String MARKET_BILLING_SERVICE_ACTION = "com.android.vending.billing.MarketBillingService.BIND";

  // Intent actions that we send from the BillingReceiver to the
  // BillingService. Defined by this application.
  public static final String ACTION_CONFIRM_NOTIFICATION = "com.example.subscriptions.CONFIRM_NOTIFICATION";
  public static final String ACTION_GET_PURCHASE_INFORMATION = "com.example.subscriptions.GET_PURCHASE_INFORMATION";
  public static final String ACTION_RESTORE_TRANSACTIONS = "com.example.subscriptions.RESTORE_TRANSACTIONS";

  // Intent actions that we receive in the BillingReceiver from Market.
  // These are defined by Market and cannot be changed.
  public static final String ACTION_NOTIFY = "com.android.vending.billing.IN_APP_NOTIFY";
  public static final String ACTION_RESPONSE_CODE = "com.android.vending.billing.RESPONSE_CODE";
  public static final String ACTION_PURCHASE_STATE_CHANGED = "com.android.vending.billing.PURCHASE_STATE_CHANGED";

  // These are the names of the extras that are passed in an intent from
  // Market to this application and cannot be changed.
  public static final String NOTIFICATION_ID = "notification_id";
  public static final String INAPP_SIGNED_DATA = "inapp_signed_data";
  public static final String INAPP_SIGNATURE = "inapp_signature";
  public static final String INAPP_REQUEST_ID = "request_id";
  public static final String INAPP_RESPONSE_CODE = "response_code";

  // These are the names of the fields in the request bundle.
  public static final String BILLING_REQUEST_METHOD = "BILLING_REQUEST";
  public static final String BILLING_REQUEST_API_VERSION = "API_VERSION";
  public static final String BILLING_REQUEST_PACKAGE_NAME = "PACKAGE_NAME";
  public static final String BILLING_REQUEST_ITEM_ID = "ITEM_ID";
  public static final String BILLING_REQUEST_ITEM_TYPE = "ITEM_TYPE";
  public static final String BILLING_REQUEST_DEVELOPER_PAYLOAD = "DEVELOPER_PAYLOAD";
  public static final String BILLING_REQUEST_NOTIFY_IDS = "NOTIFY_IDS";
  public static final String BILLING_REQUEST_NONCE = "NONCE";

  public static final String BILLING_RESPONSE_RESPONSE_CODE = "RESPONSE_CODE";
  public static final String BILLING_RESPONSE_PURCHASE_INTENT = "PURCHASE_INTENT";
  public static final String BILLING_RESPONSE_REQUEST_ID = "REQUEST_ID";
  public static long BILLING_RESPONSE_INVALID_REQUEST_ID = -1;

  // These are the types supported in the IAB v2
  public static final String ITEM_TYPE_INAPP = "inapp";
  public static final String ITEM_TYPE_SUBSCRIPTION = "subs";

  public static final boolean DEBUG = false;
}




Java Source Code List

com.andrewkeeton.divide.and.conquer.card.shuffler.AutoResizeTextView.java
com.andrewkeeton.divide.and.conquer.card.shuffler.Card.java
com.andrewkeeton.divide.and.conquer.card.shuffler.EstimateTime.java
com.andrewkeeton.divide.and.conquer.card.shuffler.MainActivity.java
com.andrewkeeton.divide.and.conquer.card.shuffler.Move.java
com.andrewkeeton.divide.and.conquer.card.shuffler.PileOfCards.java
com.andrewkeeton.divide.and.conquer.card.shuffler.SettingsActivity.java
com.andrewkeeton.divide.and.conquer.card.shuffler.SetupFragment.java
com.andrewkeeton.divide.and.conquer.card.shuffler.ShufflerFragment.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.BillingReceiver.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.BillingService.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.Consts.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.PurchaseDatabase.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.PurchaseObserver.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.ResponseHandler.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.Security.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.util.Base64DecoderException.java
com.andrewkeeton.divide.and.conquer.card.shuffler.billing.util.Base64.java