Skip to content

Commit

Permalink
updated documentation and manifest files to match SDK version 4.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Justin Garen committed May 25, 2012
1 parent 8531d1d commit 637130c
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 9 deletions.
20 changes: 19 additions & 1 deletion DemoApp/AndroidManifest.xml
Expand Up @@ -5,6 +5,7 @@
<uses-sdk android:minSdkVersion="7" />

<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
Expand All @@ -27,19 +28,36 @@
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity
android:name="com.pocketchange.android.installer.AcceptPermissionsActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.installer.AppInstallActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.installer.AcceptPermissionsActivity"
android:name="com.pocketchange.android.installer.BackgroundAppInstallActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.purchasing.client.PurchasingActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>

<service android:name="com.pocketchange.android.installer.AppInstallService" />
<receiver android:name="com.pocketchange.android.installer.AppInstallService$AccountsChangedBroadcastReceiver">
<intent-filter>
<action android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />
</intent-filter>
</receiver>
<receiver android:name="com.pocketchange.android.installer.AppInstallService$AppInstalledBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>

<service android:name="com.pocketchange.android.purchasing.client.PurchasingReceiverService" />
<receiver android:name="com.pocketchange.android.purchasing.client.PurchasingReceiver">
<intent-filter>
Expand Down
5 changes: 5 additions & 0 deletions HISTORY.md
@@ -1,3 +1,8 @@
## 4.1.0 (2012-05-25)

* Added background installer
* Improved API request performance

## 4.0.0 (2012-05-08)

* Substantial improvements to client-server synchronization
Expand Down
36 changes: 29 additions & 7 deletions README.md
Expand Up @@ -43,10 +43,11 @@ Open the properties window for your app (File » Properties » Android), press t
<a name="readme-android-manifest-modifications"></a>
## Step 5: Modify your AndroidManifest.xml

If your manifest file does not already include the permissions to make network calls, access and use account information, and read telephony state, add them inside the &lt;mainifest&gt; block. We only use account information for simplifying the login and purchasing flows. We only use telephone state in cases where the phone does not have a valid device id.
If your manifest file does not already include the permissions to make network calls, access, manage, and use account information, and read telephony state, add them inside the &lt;mainifest&gt; block. We only use account information for simplifying the login and purchasing flows. We only use telephone state in cases where the phone does not have a valid device id.

```xml
<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
Expand All @@ -60,19 +61,36 @@ Finally, declare the application components the SDK requires inside of the &lt;a
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity
android:name="com.pocketchange.android.installer.AcceptPermissionsActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.installer.AppInstallActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.installer.AcceptPermissionsActivity"
android:name="com.pocketchange.android.installer.BackgroundAppInstallActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.purchasing.client.PurchasingActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>

<service android:name="com.pocketchange.android.installer.AppInstallService" />
<receiver android:name="com.pocketchange.android.installer.AppInstallService$AccountsChangedBroadcastReceiver">
<intent-filter>
<action android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />
</intent-filter>
</receiver>
<receiver android:name="com.pocketchange.android.installer.AppInstallService$AppInstalledBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>

<service android:name="com.pocketchange.android.purchasing.client.PurchasingReceiverService" />
<receiver android:name="com.pocketchange.android.purchasing.client.PurchasingReceiver">
<intent-filter>
Expand All @@ -83,19 +101,21 @@ Finally, declare the application components the SDK requires inside of the &lt;a

## Step 6: Integrate the SDK in your app

First import the Pocket Change SDK in your main Activity.
First import the Pocket Change SDK in your main Activity:

```java
import com.pocketchange.android.PocketChange;
```

Next initialize the SDK in the main Activity's onCreate() method.
Next initialize the SDK in the main Activity's onCreate() method:

```java
PocketChange.initialize(this, APP_ID);
```

Use the supplied token counter UI code which displays the number of tokens in the player's account. To show the counter in the upper right corner in your activity:
You must call the `PocketChange.initialize` method in the `onCreate` method of every Activity that uses the SDK before calling any other SDK methods. Do not worry about duplicate initialization; the SDK automatically prevents it.

Use the supplied token counter UI code which displays the number of tokens in the player's account. To show the counter in the upper right corner in your Activity:

```java
@Override
Expand All @@ -111,12 +131,14 @@ public void onPause() {
}
```

The display method also takes left and top margins as arguments to show the counter in a particular location.
The `displayTokenCounter` method also takes left and top margins as arguments to show the counter in a particular location:

```java
PocketChange.displayTokenCounter(this, 20, 40);
```

The SDK ensures that the counter will only appear once in each Activity.

When the user triggers a UI event to start the game, call:

```java
Expand Down Expand Up @@ -172,7 +194,7 @@ the interface.
You can use test mode to try out your integration in a safe environment. Transactions will not by processed by your credit card provider and you can use the following test CC credentials: #4242424242424242 CVC: 999 Exp: 12/2013. To enable test mode replace your initialize statement with:

```java
PocketChange.initializeInTestMode(getApplicationContext(), APP_ID);
PocketChange.initializeInTestMode(this, APP_ID);
```

Note: when the bank comes up there will be a banner indicating that you're in a test environment. **You must change the initialize call back before you
Expand Down
20 changes: 19 additions & 1 deletion pocketchange/AndroidManifest.xml
Expand Up @@ -8,6 +8,7 @@
<uses-sdk android:minSdkVersion="7" />

<uses-permission android:name="android.permission.GET_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"></uses-permission>
<uses-permission android:name="android.permission.USE_CREDENTIALS"></uses-permission>
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
Expand All @@ -18,19 +19,36 @@
android:configChanges="orientation|keyboardHidden"
android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen">
</activity>
<activity
android:name="com.pocketchange.android.installer.AcceptPermissionsActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.installer.AppInstallActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.installer.AcceptPermissionsActivity"
android:name="com.pocketchange.android.installer.BackgroundAppInstallActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>
<activity
android:name="com.pocketchange.android.purchasing.client.PurchasingActivity"
android:theme="@android:style/Theme.NoTitleBar">
</activity>

<service android:name="com.pocketchange.android.installer.AppInstallService" />
<receiver android:name="com.pocketchange.android.installer.AppInstallService$AccountsChangedBroadcastReceiver">
<intent-filter>
<action android:name="android.accounts.LOGIN_ACCOUNTS_CHANGED" />
</intent-filter>
</receiver>
<receiver android:name="com.pocketchange.android.installer.AppInstallService$AppInstalledBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED" />
<data android:scheme="package" />
</intent-filter>
</receiver>

<service android:name="com.pocketchange.android.purchasing.client.PurchasingReceiverService" />
<receiver android:name="com.pocketchange.android.purchasing.client.PurchasingReceiver">
<intent-filter>
Expand Down

0 comments on commit 637130c

Please sign in to comment.