socket to send the current location
<p>now i'm creating a socket in my android project to be able to send my lat and long of my current location to my python server my android code is working on Samsung mini galaxy . here is my code </p>

<pre><code>public void connect(View view){
    try{
        clientSocket= new Socket("192.168.1.2",54635); 
        Text.append( "\n created a socket");
        outToServer = new DataOutputStream(clientSocket.getOutputStream());
        Text.append( "\n created a datastream");
        inFromServer = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));
        Text.append( "\n created a bufferReader");

    }catch(Exception e){
        System.out.println("Error");
    }
    } 
        public void onLocationChanged(Location loc)

    {

        GeoPoint point = new GeoPoint((int) (loc.getLatitude() * 1E6),
                (int) (loc.getLongitude() * 1E6));
        String cmd=("My current location is: " +

        "Latitud =" + loc.getLatitude()*1E11+ 

        "Longitud =" +loc.getLongitude()*1E11);
        try {
              Connect=(Button)findViewById(R.id.connect);
           InetSocketAddress address = new InetSocketAddress("192.168.1.2",54631);
            DatagramPacket request = new DatagramPacket(cmd.getBytes(), cmd.length(), address);
            DatagramSocket socket = new DatagramSocket();
            socket.send(request);
        } catch (SocketException e) {

      System.out.print("SSSS");
            }
         catch (IOException e) {

           System.out.print("SSS");
            }
        }
</code></pre>

<p>the problem is i want the connect message to have ability to send the lat and long because the <code>InetSocketAddress</code> force closes.  so please what could be a solution  </p>
