[android-developers] Re: why cant send the string to the python server

2011-05-25 Thread ingy abbas
05-25 15:10:04.049: ERROR/ActivityManager(175): ANR in Demo.Chat
(Demo.Chat/.Client)
05-25 15:10:04.049: ERROR/ActivityManager(175): Reason:
keyDispatchingTimedOut
05-25 15:10:04.049: ERROR/ActivityManager(175): Load: 5.52 / 5.46 /
5.21
05-25 15:10:04.049: ERROR/ActivityManager(175): CPU usage from 12224ms
to 4054ms ago:
05-25 15:10:04.049: ERROR/ActivityManager(175):   system_server: 1% =
1% user + 0% kernel
05-25 15:10:04.049: ERROR/ActivityManager(175):   d.process.acore: 1%
= 1% user + 0% kernel / faults: 41 minor
05-25 15:10:04.049: ERROR/ActivityManager(175):   ksdioirqd/mmc1: 0% =
0% user + 0% kernel
05-25 15:10:04.049: ERROR/ActivityManager(175): TOTAL: 6% = 5% user +
0% kernel + 0% softirq


On May 25, 4:07 am, Kumar Bibek coomar@gmail.com wrote:
 Any errors on you logcat?

 Kumar Bibekhttp://techdroid.kbeanie.comhttp://www.kbeanie.com







 On Wed, May 25, 2011 at 4:42 AM, ingy abbas ingy.abba...@gmail.com wrote:

  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

-- 
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


Re: [android-developers] Re: why cant send the string to the python server

2011-05-25 Thread Kostya Vasilyev

Don't run networking code on the UI thread.

http://developer.android.com/guide/topics/fundamentals/processes-and-threads.html#Threads

-- Kostya

25.05.2011 17:12, ingy abbas пишет:

05-25 15:10:04.049: ERROR/ActivityManager(175): ANR in Demo.Chat
(Demo.Chat/.Client)



--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
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


[android-developers] Re: why cant send the string to the python server

2011-05-25 Thread ingy abbas
SO how to solve it !!

On May 25, 3:18 pm, Kostya Vasilyev kmans...@gmail.com wrote:
 Don't run networking code on the UI thread.

 http://developer.android.com/guide/topics/fundamentals/processes-and-...

 -- Kostya

 25.05.2011 17:12, ingy abbas пишет:

  05-25 15:10:04.049: ERROR/ActivityManager(175): ANR in Demo.Chat
  (Demo.Chat/.Client)

 --
 Kostya Vasilyev --http://kmansoft.wordpress.com

-- 
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


Re: [android-developers] Re: why cant send the string to the python server

2011-05-25 Thread Kostya Vasilyev
Start by using AsyncTask, it's an easy way to get most of it right. Then as
you learn more about how to use thread in Android, you can improve on that
as necessary.

-- Kostya

2011/5/25 ingy abbas ingy.abba...@gmail.com

 SO how to solve it !!

 On May 25, 3:18 pm, Kostya Vasilyev kmans...@gmail.com wrote:
  Don't run networking code on the UI thread.
 
  http://developer.android.com/guide/topics/fundamentals/processes-and-...
 
  -- Kostya
 
  25.05.2011 17:12, ingy abbas пишет:
 
   05-25 15:10:04.049: ERROR/ActivityManager(175): ANR in Demo.Chat
   (Demo.Chat/.Client)
 
  --
  Kostya Vasilyev --http://kmansoft.wordpress.com

 --
 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


-- 
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