title: Android Kafka consumer integration problems
body: <p>I am trying to integrate kafka on Android app in order to be able to consume messages from a kafka topic.
  I have successfully added the kafka dependencies to build.gradle:</p>
  
  <pre><code>compile group: 'org.apache.kafka', name: 'kafka-clients', version: '0.10.2.0'
  compile group: 'org.apache.kafka', name: 'kafka-streams', version: '0.10.2.0'
  </code></pre>
  
  <p>but when the app is starting the following errors are displayed in console:</p>
  
  <p><code>Caused by: java.lang.ClassNotFoundException: Didn't find class "javax.management.DynamicMBean" on path: DexPathList[[zip file "/data/app/com.kafka.subscriber-Eurshxgjwg0oFE6vcMCe0g==/base.apk"</code></p>
  
  <p><code>E/AndroidRuntime: FATAL EXCEPTION: main
                    Process: com.kafka.subscriber.news, PID: 9193
                    java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/management/ManagementFactory;
                        at org.apache.kafka.common.utils.AppInfoParser.unregisterAppInfo(AppInfoParser.java:65)
                        at org.apache.kafka.clients.consumer.KafkaConsumer.close(KafkaConsumer.java:1568)
                        at org.apache.kafka.clients.consumer.KafkaConsumer.&lt;init&gt;(KafkaConsumer.java:715)
                        at org.apache.kafka.clients.consumer.KafkaConsumer.&lt;init&gt;(KafkaConsumer.java:597)
                        at org.apache.kafka.clients.consumer.KafkaConsumer.&lt;init&gt;(KafkaConsumer.java:579)</code></p>
  
  <p>Here is a dummy code that I'm trying to run:</p>
  
  <pre><code>public class MainActivity extends AppCompatActivity {
  
  @Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
      Properties properties = new Properties();
      properties.put("bootstrap.servers","localhost:8080");
      properties.put("value.deserializer","org.apache.kafka.common.serialization.StringSerializer");
      properties.put("key.deserializer","org.apache.kafka.common.serialization.StringSerializer");
      KafkaConsumer&lt;String,String&gt; kafkaConsumer = new KafkaConsumer&lt;&gt;(properties);
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Is someone who has an idea to resolve the above errors ? 
  I have need to consume messages from the kafka topic.</p>