Help me! connecting arduino with android using cc3000 wifi modul

here is the arduino code

#include <Adafruit_CC3000.h>
#include <SPI.h>
#include "utility/debug.h"
#include "utility/socket.h"

#define ADAFRUIT_CC3000_IRQ   3 
#define ADAFRUIT_CC3000_VBAT  5
#define ADAFRUIT_CC3000_CS    10
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,SPI_CLOCK_DIVIDER); 
                                         
#define WLAN_SSID       "Hyzo"   
#define WLAN_PASS       "pass"
#define WLAN_SECURITY   WLAN_SEC_WPA2
#define LISTEN_PORT           80

Adafruit_CC3000_Server httpServer(LISTEN_PORT);

int bufindex = 0;
void setup() {
  Serial.begin(115200);
  cc3000.begin();
  cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY);
  delay(10000);
  cc3000.checkDHCP();

  httpServer.begin();
pinMode(8, OUTPUT);
}

void loop() {
  Adafruit_CC3000_ClientRef client = httpServer.available();
  
  byte kirim =(byte) client.read();
  Serial.write(kirim);
  if(kirim==1){digitalWrite(8,HIGH);}
  else{digitalWrite(8,LOW);}
  
client.close();
}

and this is the mainactivity in java(android studio)

import android.app.Fragment;
import android.graphics.Color;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;
import java.net.*;
import java.io.*;

public class MainActivity extends ActionBarActivity  {

    private static TextView lamp, tvuser;
    private static EditText user, pass;
    private Socket sock;
    private static String ipip = "192.160.10.103";
    private static int portport = 80;
    private static String response = "";
    private static byte[] buffer = new byte[1024];
    private static byte kirim=1;
    private static InputStream in;
    private static OutputStream out;
    private static int stat;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.content_main);
        lamp = (TextView) findViewById(R.id.lamp);

        try {
            sock = new Socket(ipip, portport);
            in= sock.getInputStream();
            out = sock.getOutputStream();

            //       out.write(kirim);

            stat = in.read(buffer);

        }catch (Exception e){

        }


    }

    public void onClick(View v){
        switch (v.getId()){
            case R.id.onon:
                kirim = 1;
                try{ out.write(kirim);}
                catch (Exception e){}
                try{ stat = in.read(buffer);}
                catch (Exception e){}
                if(stat == 1) {
                    lamp.setTextColor(Color.parseColor("#CCCC00"));
                }
                break;
            case R.id.offoff:
                kirim=0;
                try{ out.write(kirim);}
                catch (Exception e){}
                try{ stat = in.read(buffer);}
                catch (Exception e){}
                if(stat == 0) {
                    lamp.setTextColor(Color.parseColor("#000000"));
                }
                break;
        }
    }

}

2 side of program running, but they wont connect? why?

Hi!

Can you discoverd anything about this topic? I need to do something. I would like to make an APK that connects to the Arduino through the CC3000 module. If achieved some results please share. Will can do something using other techniques as well as POST and GET.

Regards, Daniel