1

Is serial communication is possible in android device means When I type something in Edit text Of Device then It will show on Hyperterminal and When I will write some text in Hyperterminal then it will show on Android device.

Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
payaljain
  • 11
  • 1
  • 2
  • i think you need to connect android device with pc and run android application which are in your pc.so you need this: http://developer.android.com/guide/developing/device.html – Nikunj Patel Aug 26 '11 at 10:16

1 Answers1

0

You can implement a View.OnKeyListener to catch the keys as they are typed:

   yourEditText.setOnKeyListener(new View.OnKeyListener() {
        @Override
        public boolean onKey(View v, int keyCode, KeyEvent event) {
            // your code here
            return false;
        }
    });

More details on setting up the listener here and on the listener itself here.

I am not sure of what you mean by Hyperterminal. If it is on your PC or somewhere else, you'll have to send the entered keys to it using the network, and this can be triggered by the listener above.

The other way, when you receive characters you use the setText() method of your EditText.

I'm not elaborating on the network part here as I am not sure of what you would like to do.

Shlublu
  • 10,917
  • 4
  • 51
  • 70
  • and Hyperterminal is nothing it is like a terminal only where text transmitting and receiving both will happen – payaljain Aug 26 '11 at 11:03
  • I don't have any full source to send, @payaljain , these are only tips to start implementing the solution you are working on. Now you also have to think about the way you are going to transmit the characters across the network but it shouldn't be that difficult: a ServerSocket based server on your PC and a Socket based client on your Android app's side should make it quite easily. – Shlublu Aug 26 '11 at 11:38