Skip to content
This repository has been archived by the owner on Jan 12, 2019. It is now read-only.

Commit

Permalink
Update library to 5.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff Brateman committed Mar 10, 2015
1 parent 9c61c41 commit e39da0f
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 41 deletions.
82 changes: 43 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ All releases follow [semantic versioning](http://semver.org/).
The latest version is available via `mavenCentral()`. Just add the following dependency:

```
compile 'io.card:android-sdk:4.0.2'
compile 'io.card:android-sdk:5.0.0'
```

You can receive updates about new versions via a few different channels:
Expand All @@ -25,8 +25,8 @@ You can receive updates about new versions via a few different channels:

Also be sure to check and post to the [Stack Overflow card.io tag](http://stackoverflow.com/questions/tagged/card.io).

Instructions
------------
Integration instructions
------------------------

The information in this guide is enough to get started. For additional details, see our **[javadoc](http://card-io.github.io/card.io-Android-SDK/)**.

Expand All @@ -40,63 +40,67 @@ The information in this guide is enough to get started. For additional details,

A manual entry fallback mode is provided for devices that do not meet these requirements.

### Instructions
### Setup

1. Get the latest SDK by cloning this repo or [downloading an archive of the most recent tag](https://github.com/card-io/card.io-Android-SDK/tags).

2. Extract the card.io SDK (see the SampleApp for an example)
##### If you use gradle, then add the following dependency from `mavenCentral()`:

3. Edit AndroidManifest.xml. We're going to add a few additional items in here:
```
compile 'io.card:android-sdk:5.0.0'
```

1. Ensure your minimum SDK level is 8 or above. You should have an element like this in `<manifest>`:
##### If you use something other than gradle, then:

1. Edit AndroidManifest.xml. We're going to add a few additional items in here:

```xml
<uses-sdk android:minSdkVersion="8" />
```
```xml
<uses-sdk android:minSdkVersion="8" />
```

2. Also in your `<manifest>` element, make sure the following permissions and features are present:
2. Also in your `<manifest>` element, make sure the following permissions and features are present:

```xml
<!-- Permission to use camera - required -->
<uses-permission android:name="android.permission.CAMERA" />
```xml
<!-- Permission to vibrate - recommended, allows vibration feedback on scan -->
<uses-permission android:name="android.permission.VIBRATE" />

<!-- Permission to vibrate - recommended, allows vibration feedback on scan -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- Permission to use camera - required -->
<uses-permission android:name="android.permission.CAMERA" />

<!-- Camera features - recommended -->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
```
<!-- Camera features - recommended -->
<uses-feature android:name="android.hardware.camera" android:required="false" />
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false" />
<uses-feature android:name="android.hardware.camera.flash" android:required="false" />
```

3. Within the `<application>` element, add activity entries:
3. Within the `<application>` element, add activity entries:

```xml
<!-- Activities responsible for gathering payment info -->
<activity android:name="io.card.payment.CardIOActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="io.card.payment.DataEntryActivity" />
```
```xml
<!-- Activities responsible for gathering payment info -->
<activity android:name="io.card.payment.CardIOActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="io.card.payment.DataEntryActivity" />
```

4. Before you build in release mode, make sure to adjust your proguard configuration by adding the following to `proguard.cnf`:
##### Note: Before you build in release mode, make sure to adjust your proguard configuration by adding the following to `proguard.cnf`:

```
-keep class io.card.**
-keepclassmembers class io.card.** {
*;
}
```
```
-keep class io.card.**
-keepclassmembers class io.card.** {
*;
}
```
### Sample code
### Sample code (See the SampleApp for an example)
First, we'll assume that you're going to launch the scanner from a button, and that you've set the button's onClick handler in the layout XML via `android:onClick="onScanPress"`. Then, add the method as:
First, we'll assume that you're going to launch the scanner from a button,
and that you've set the button's `onClick` handler in the layout XML via `android:onClick="onScanPress"`.
Then, add the method as:
```java
public void onScanPress(View v) {
Intent scanIntent = new Intent(this, CardIOActivity.class);
// customize these values to suit your needs.
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: true
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: false
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false); // default: false
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false
Expand All @@ -105,7 +109,7 @@ public void onScanPress(View v) {
}
```

Next, we'll override `onActivityResult` to get the scan result.
Next, we'll override `onActivityResult()` to get the scan result.

```java
@Override
Expand Down
2 changes: 1 addition & 1 deletion SampleApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ dependencies {
if (parent != null) {
compile project(':card.io')
} else {
compile 'io.card:android-sdk:4.0.2'
compile 'io.card:android-sdk:5.0.0'
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public void onScanPress(View v) {
Intent scanIntent = new Intent(this, CardIOActivity.class);

// customize these values to suit your needs.
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: true
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_EXPIRY, true); // default: false
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_CVV, false); // default: false
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false

Expand Down
Binary file renamed aars/card.io-4.0.2.aar → aars/card.io-5.0.0.aar
Binary file not shown.
8 changes: 8 additions & 0 deletions release_notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
card.io Android SDK change log and release notes
================================================

5.0.0
-----
* Add automatic expiry-scanning.
You can disable this feature via the new `EXTRA_SCAN_EXPIRY` extra of `CardIOActivity`.
Note: Expiry scans will not infrequently fail to obtain the correct expiry date.
We are continuing to work to improve expiry-scanning accuracy.
* Fix crash when the `DataEntryActivity` is missing extras [#19](https://github.com/card-io/card.io-Android-SDK/issues/19)).

4.0.2
-----
* Fix crash caused when an application's theme specifies no action bar [#44](https://github.com/card-io/card.io-Android-SDK/issues/44)).
Expand Down

0 comments on commit e39da0f

Please sign in to comment.