Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved configuration to Application subclass and refactored auxiliary …
…classes to their own package.
- Loading branch information
Robot Media
committed
Jul 23, 2011
1 parent
da7206a
commit d4e3cb2
Showing
7 changed files
with
79 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
DungeonsRedux/src/net/robotmedia/billing/example/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package net.robotmedia.billing.example; | ||
|
||
import net.robotmedia.billing.BillingController; | ||
|
||
public class Application extends android.app.Application { | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
BillingController.setDebug(true); | ||
BillingController.setConfiguration(new BillingController.IConfiguration() { | ||
|
||
@Override | ||
public byte[] getObfuscationSalt() { | ||
return new byte[] {41, -90, -116, -41, 66, -53, 122, -110, -127, -96, -88, 77, 127, 115, 1, 73, 57, 110, 48, -116}; | ||
} | ||
|
||
@Override | ||
public String getPublicKey() { | ||
return "your public key here"; | ||
} | ||
}); | ||
} | ||
|
||
} |
28 changes: 0 additions & 28 deletions
28
DungeonsRedux/src/net/robotmedia/billing/example/CatalogEntry.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...media/billing/example/CatalogAdapter.java → ...a/billing/example/aux/CatalogAdapter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
DungeonsRedux/src/net/robotmedia/billing/example/aux/CatalogEntry.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package net.robotmedia.billing.example.aux; | ||
|
||
import net.robotmedia.billing.example.R; | ||
|
||
public class CatalogEntry { | ||
|
||
/** | ||
* Each product in the catalog is either MANAGED or UNMANAGED. MANAGED means | ||
* that the product can be purchased only once per user (such as a new level | ||
* in a game). The purchase is remembered by Android Market and can be | ||
* restored if this application is uninstalled and then re-installed. | ||
* UNMANAGED is used for products that can be used up and purchased multiple | ||
* times (such as poker chips). It is up to the application to keep track of | ||
* UNMANAGED products for the user. | ||
*/ | ||
public enum Managed { | ||
MANAGED, UNMANAGED | ||
} | ||
|
||
public String sku; | ||
public int nameId; | ||
public Managed managed; | ||
|
||
public CatalogEntry(String sku, int nameId, Managed managed) { | ||
this.sku = sku; | ||
this.nameId = nameId; | ||
this.managed = managed; | ||
} | ||
|
||
/** An array of product list entries for the products that can be purchased. */ | ||
public static final CatalogEntry[] CATALOG = new CatalogEntry[] { | ||
new CatalogEntry("sword_001", R.string.two_handed_sword, Managed.MANAGED), | ||
new CatalogEntry("potion_001", R.string.potions, Managed.UNMANAGED), | ||
new CatalogEntry("android.test.purchased", R.string.android_test_purchased, Managed.UNMANAGED), | ||
new CatalogEntry("android.test.canceled", R.string.android_test_canceled, Managed.UNMANAGED), | ||
new CatalogEntry("android.test.refunded", R.string.android_test_refunded, Managed.UNMANAGED), | ||
new CatalogEntry("android.test.item_unavailable", R.string.android_test_item_unavailable, Managed.UNMANAGED), }; | ||
|
||
} |