i've spent like 10 hours yday to get card io working with my xamarin application... after long long battles i managed to see what i wanted... i did not see the above error about 2 interfaces, i've had an issue with 'a' field in 'A' class and there as an error telling that "IN" interface does not exist (this is an interface, so no problem with double base class should be shown there, that's odd).
not sure if all my steps are necessary to make it working but (surprise, surprise) i was to tired to clean that up and check which chagnes were really essencial. lots of problems are cause by the code obfuscation of the card io jar.
nevermind, back to the topic:
- create new binding project, add the jar as embeded jar, add the .so files as embided native libraries (use the existing structure)
- open EnumMethods.xml and add there a mapping:
<mapping jni-class="io/card/payment/CardIOActivity">
<method jni-name="onActivityResult" parameter="p1" clr-enum-type="Android.App.Result" />
</mapping>
(this changes int to enum type used by .net xamarin in the onActivityResult method (which is overloaded by one of the classes in card.io.jar)
3. open Metadata.xml and add below nodes (some might be unnecessary):
<attr path="/api/package[@name='io.card.payment']/class[@name='A']/field[@name='a']" name="managedName">AProp</attr>
<attr path="/api/package[@name='io.card.payment']/class[@name='M']" name="visibility">public</attr>
<attr path="/api/package[@name='io.card.payment']/class[@name='M']" name="name">Mcl</attr>
<attr path="/api/package[@name='io.card.payment']/interface[@name='N']" name="visibility">public</attr>
<attr path="/api/package[@name='io.card.payment']/interface[@name='N']" name="name">Nifc</attr>
<attr path="/api/package[@name='io.card.payment']/class[@name='L']" name="visibility">public</attr>
<attr path="/api/package[@name='io.card.payment']/class[@name='L']/field[@name='a']" name="managedName">aProp</attr>
<attr path="/api/package[@name='io.card.payment']/class[@name='L']/method[@name='a']" name="managedName">aMethod</attr>
<attr path="/api/package[@name='io.card.payment']/class[@name='L']" name="name">Lcl</attr>
above nodes change some visibilities to public (most needed) and change some names of classes or iterfaces (not sure if needed, but it was useful to me at some point)
add reference to the binding project in the main one.
open AndroidManifest.xml in the main project and add there:
<activity android:name="io.card.payment.CardIOActivity" android:configChanges="keyboardHidden|orientation" />
<activity android:name="io.card.payment.DataEntryActivity" android:screenOrientation="portrait"/>
nodes should be added under application node (which is a child of main node - manifest)
now you should be able to invoke the CardIOActivity and use what you want (invoking and using is available and seems to be described well in the examples provided by the creators)
one more hint, nothing big, but when i finally succeeded in getting the library working i missed it... to get result as CreditResult object in OnActivityResult method use java cast:
var scanResult = data.GetParcelableExtra(CardIOActivity.ExtraScanResult).JavaCast();
ordinary c# cast won't work.
if you have any problems let me know, perhaps i missed something (especially that i'm not yet xamarin expert).
good luck!
ps: answer placed @xamarin forum too
EDIT:
Completet solution with binding, checked and working uploded to github:
https://github.com/wiadran/card.io.xamarin.binding.git