我正在使用Android应用程序中的paypal sdk并成功集成并使用paypal和creditcard付款。现在我想在现有应用程序中集成卡io。
我已完成以下添加的代码 -
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_CVV, false); // default: false
scanIntent.putExtra(CardIOActivity.EXTRA_REQUIRE_POSTAL_CODE, false); // default: false
// MY_SCAN_REQUEST_CODE is arbitrary and is only used within this activity.
startActivityForResult(scanIntent, MY_SCAN_REQUEST_CODE);
}
但它返回异常:
Failed to load native library: Couldn't load cardioDecider from loader dalvik.system.PathClassLoader
Processor type is not supported
ERROR_NO_DEVICE_SUPPORT: This device cannot use the camera to read card numbers.
我在android 4.4.4上测试它,并在我项目的lib文件夹中添加了paypal sdk - PayPalAndroidSDK-2.8.4和card.io-Android-SDK-4.0.2。
清单代码 -
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.CAMERA" />
<!-- Permission to vibrate - recommended, allows vibration feedback on scan -->
<uses-permission android:name="android.permission.VIBRATE" />
<!-- 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" />
<activity
android:name="io.card.payment.CardIOActivity"
android:configChanges="keyboardHidden|orientation" />
<activity
android:name="io.card.payment.DataEntryActivity" />
我的代码中有什么问题?
答案 0 :(得分:3)
答案 1 :(得分:1)
Jeff来自card.io。最新的PayPalAndroidSDK(2.8.7
)已经捆绑了card.io 4.0.1
。当两个具有相同名称的card.io类冲突时,包括card.io库将导致构建问题。
您需要做的就是集成最新的PayPalAndroidSDK,然后像往常一样使用card.io API。