fusesource/mqtt-client — Issue #5: Mqtt-client doesn't work on Android 3.x
Author: a-thomas
Created: 2012-02-06 15:19:28+00:00
State: open

I develop a Mqtt-client on Android for 3.x tablet version.

My client works well with Android 2.x version but not with Android 3.x. On Android 3.x, my request is never sent to my Broker (I use Mosquitto).
I debugged my project and I think I found out the problem's location:

The application blocks in the ``` pickThreadQueue ``` method of the ``` NioDispatchSource ``` class at the followed line:

```java
int s = threads[i].getNioManager().getSelector().keys().size();
```

The only difference between Android 3.x and Android 2.x is the Selector Implementation.
``` org.apache.harmony.nio.internal.SelectorImpl ``` on 2.x
``` java.nio.SelectorImpl ```on 3.x

So, it works with apache harmony Selector implementation and not with java.nio... Have you an idea why it doesn't work ?
Thanks for your answers.