BlinkStick Xamarin (android)

Hi all,

Has anyone had much luck communicating with the BlinkStick from within an Xamarin (android) project? I’m trying to determine what the best course of action is. So far I have two options:

  1. Create a binding library to the android-support.v4.jar
  2. Manually port the code from the java src to xamarin.

Option 1 I’m not familiar with and seems to result in a whole bunch of errors whilst trying to compile the mapping library. Hopefully someone else has managed to do this.

Option 2 seems a better route. Well, that is until I get to the ControlTransfer methods. It seems Xamarin framework doesn’t support the addressing I need (0x20) for the UsbAddressing parameter.

Anyone had luck with this?

Regards.

Can you integrate standard Android libraries into Xamarin? Don’t have much experience with the framework, but I would presume they should allow to do that. There is BlinkStick Android implementation available here:

Thanks for such a quick response, I appreciate that.

I’m aware of the Android API you linked. I saw that it contains a jar file, which is what I was originally mapping to. When the mapping failed I decided to port the java source across to a standard library which is usable in xamarin. This basically wraps up Android calls within its framework. This is when I came across the addressing issue I mentioned earlier.

To be fair I think I’m probably making this more complex than it needs to be. I might just stick with creating a project in android studio using java and use the API you mentioned from there.

Quick update. Got it working! I went the Java (Android Studio) route in the end. I basically wanted to make a car app so I can change the colours of the lights in the footwell.

https://youtu.be/zZGBzBZtMmA

I will probably end up buying another flex for the other side. Quick question, how does the BlinkStick flex cope with being put into a USB splitter, power-wise? I have limited USB slots in the car.