IntPtr problem

G Giovanni Ferrari 2 years 11 months ago
7 4 0

we are developing our first app on motorola mc9200 (android) with visual studio, and we start explore the functionality with EMDK SDK, we looked examples and is all quite ok, but now we need to move the IEMDKListener interface from the main activity to one specialized class, we have implemented the interface IEMDKListener on class,
 
  public class BarCode : IDisposable, EMDKManager.IEMDKListener
....
 
but requiere IntPtr Handle property, how to implement it?
 
        public IntPtr Handle
        {
            get
            {
                return ??;
            }
        }
 
there are example of this situation?
 
another question, is possible enable/disable the led on device? we need to signal particular situation.
 
thanks

Please register or login to post a reply

4 Replies

G Giovanni Ferrari

thanks for the example, we start change the class..

about the leds on mc9200, i not mean flash led or similar (like on regular telephone), the mc9200 have led (orange) for battery (and flash when charging), also red led (3) that signal when barcode is not decoded and 3 leds (green) that indicate barcode recognized, i ask if is possible control this leds

C Charitha Mallawaarachchi

Hi Giovanni,

Sorry for taking long and hope this resolves your issue. Attached the modified sample. Basically you need to extend the class from Java.Lang.Object and remove Dispose and Handle functions generated from interface as it is taken from Object.

class Barcode: Java.Lang.Object, EMDKManager.IEMDKListener

This is a generic Xamarin usage query and explained in Xamarin docs: Android Callable Wrappers - Xamarin

Please get back to us if this is not resolving your issue.

Thanks,
Charith.

G Giovanni Ferrari

noone can help?

V Vedsatx Saddvv

Hello Giovanni,
     As of now, we have no EMDK for Xamarin examples that separate the IEMDKListener from the Activity. To help understand what you are trying to accomplish, could you included a sample of your code? I'm not sure I understand what you need to do.

As for the LED control, you would need to use the standard Android Notification APIs​ ( or the xamarin.android equivalent ) not the EMDK.

CONTACT
Can’t find what you’re looking for?