Re: [mono-android] JNI Help Please

2012-02-13 Thread digitalml
Jon, Any ideas on this please? I'm using the exact code you provided in the previous posts. -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/JNI-Help-Please-tp5144171p5480147.html Sent from the Mono for Android mailing list archive at Nabble.com. ___

Re: [mono-android] JNI Help Please

2012-02-06 Thread digitalml
Hi Jon, So using the above code that you posted is working for me, but the constructor to my .java object is being called multiple times and is producing some strange behavior. How many instances of my java object are created with the above code? Is it calling my object constructor more than once

Re: [mono-android] JNI Help Please

2012-02-03 Thread digitalml
Woo Hoo, thanks Jon! My problem was that I was calling YourJniHelper instead of instantiating MyJniHelper. The callback is now received. Now how do I convert that JavaArray cardData to something useful? Thanks -- View this message in context: http://mono-for-android.1047100.n5.nabble.com/JNI

Re: [mono-android] JNI Help Please

2012-02-03 Thread digitalml
Jon, First, thanks for all your help on this, its gotten me pretty far. I used your code to call the jni_helper and initialize the reader; however, the manged wrapper for the onReceiveMsgCardData() is never called. You were right in assuming that the 'uniMagReader' instance calls the onReceiveM

Re: [mono-android] package R does not exist

2012-01-16 Thread digitalml
The resource I'm trying to get an ID for is an xml file located in the .Net Resouces/raw folder. I tried this in the .java file to no avail. int resourceID = getResources().getIdentifier("xmlFileName", "raw", ".Net.Package.Path"); Note: I've substituted the values in getIdentifier() with fake

[mono-android] package R does not exist

2012-01-16 Thread digitalml
I'm calling a .java file via JNI that is using a resource path via R.path.resource. In regular java this works fine because R resolves to the package. In MonoDroid this is not working because R does not resolve to the MonoDroid package. I've tried replacing R in the .java file with the MonoDroid p

Re: [mono-android] JNI Help Please

2012-01-16 Thread digitalml
Hi Jon, Thanks for your help. Based on the exception info I was able to fix the issues with the .java code and can now call the methods via JNI. I still have the issue of the callback though. What happens in the .java code is that when a hardware event occurs it fires the onReceiveMsgCardData() ev

Re: [mono-android] JNI Help Please

2012-01-16 Thread digitalml
Hi Jon, An update to my previous post... I looked into that sanity check code and updated my code based on it's example. IntPtr helperClass = JNIEnv.FindClass("MagHelper/jni_helper"); IntPtr ctor = JNIEnv.GetMethodID(helperClass, "", "()V"); IntPtr methodId = JNIEnv.GetMethodID(helperClass, "Ini

Re: [mono-android] JNI Help Please

2012-01-16 Thread digitalml
Hi Jon, First, thank you for taking the time to create such it a detailed response, it's greatly appreciated Based on what you said, I've made the ctor public in the .java file. I then changed my JNI code to this, but I get an error on the JNIEnv.GetMethodID call. IntPtr _helperClass = JNIE

[mono-android] JNI Help Please

2012-01-13 Thread digitalml
I'm trying to implement a 3rd party jar file to read credit cards and I'm having issues. All JNI examples I've found either return an activity or use static methods and mine is not static and not really an activity I want to show on the screen. I want to call these methods of this class via JNI thr