its create the socket between my android Mobile and my python server
but why its didnt send the cmd string  to the python ???!!



 public void connect(View view){




                            try {
                                String cmd=("My current location is: " );
                                clientSocket= new Socket("192.168.1.2",54636);
                                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");
                               InetSocketAddress address1 = new
InetSocketAddress("192.168.1.2",54636);
                               Text.append( "\n created a socket");
                                DatagramPacket request = new
DatagramPacket(cmd.getBytes(), cmd.length(), address1);

                                DatagramSocket socket = new DatagramSocket();

                                socket.send(request);

                            } catch (SocketException e) {

                                 e.printStackTrace();
                                }

        catch(Exception e){
                System.out.println("Error");
        }
    }
    }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to