[android-beginners] Android keyevent keycodes and scancodes

2009-11-11 Thread Android_n00b
Hi
I am writing a program which captures the keys pressed by user in
android and displays it in Ubuntu. According to what I read, Android's
input event device is structured around an interrupt or polling
routine that captures the device-specific scancode and converts it to
a standard form acceptable to Linux (as defined in input.h) before
passing it to the kernel with input_event(). There are the steps which
describe the translation from keyboard input to application action:
1. Window manager reads key event from Linux keyboard driver.
2. Window manager maps scancode to keycode.
3. Window manager sends both the scancode and the keycode to the
application.

Now in my application I have an EditText which returns the keycode of
any key which is pressed. So basically this is what I have:
public boolean onKey(View v, int keyCode, KeyEvent 
event) {
// TODO Auto-generated method stub
String a ="";a+=keyCode;
txt.setText(a);

return false;
}

Now I get this keycode value but it does not correspond to the
scancode value. For example, the keycode value for 'A' is 29 but the
scancode is 30. There is no correlation I can see between the input.h
scancodes and these keycodes either. My question is, I want to know
how step 2 (the mapping) above takes place. My applications aim is to
echo whatever I type on my android keyboard on my Ubuntu desktop (I
can connect between the 2 without a problem, so you don't have to
worry about that). Any help would be appreciated, as I have looked
online for quite a bit.

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


[android-beginners] Re: Socket client does not work with emulator

2009-10-08 Thread Android_n00b

Hi James,

Thanks a lot! I actually just figured it out as well and was about to
post my solution here.
http://developer.android.com/guide/developing/tools/emulator.html#emulatornetworking
So for anyone having a similar problem,

Basically 10.0.2.2 is the Android Emulator's alias to 127.0.0.1
The emulator does not understand when you specify "localhost"
So change the line:
Socket socket = new Socket("localhost", 5554);
to
Socket socket = new Socket("10.0.2.2", 5554);

Cheers!

On Oct 8, 4:26 pm, James Yum  wrote:
> Hi Android n00b,
>
> http://groups.google.com/group/android-developers/browse_thread/threa...
> <http://groups.google.com/group/android-developers/browse_thread/threa...>
> Cheers,
> James
>
>
>
> On Thu, Oct 8, 2009 at 12:57 PM, Android_n00b  wrote:
>
> > Hi,
>
> > I am trying to create a connection between a server socket program
> > written in C and an android client socket program. Now when I write a
> > regular java client program such as:
>
> > try
> > {
> >        Socket socket = new Socket("localhost", 5554);
> >        PrintWriter out = new PrintWriter(echoSocket.getOutputStream
> > (), true);
> > }
> > catch(Exception e)
> > {
> >              //
> > }
> > out.println("Hello World");
>
> > This program works perfectly and my server.c file receives the
> > message.
> > However, when I try the same program with the Android Emulator, I get
> > an "Error:java.net.ConnectException: localhost/127.0.0.1:5554 -
> > Connection refused" I have tried different ports as well (, 3490).
> > This works perfectly with the regular Java project, but the moment I
> > write the same code in an Android project I get that error. I have
> > been stuck on this all day and am really getting frustrated :( Would
> > appreciate any help!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Socket client does not work with emulator

2009-10-08 Thread Android_n00b

Hi,

I am trying to create a connection between a server socket program
written in C and an android client socket program. Now when I write a
regular java client program such as:

try
{
Socket socket = new Socket("localhost", 5554);
PrintWriter out = new PrintWriter(echoSocket.getOutputStream
(), true);
}
catch(Exception e)
{
  //
}
out.println("Hello World");

This program works perfectly and my server.c file receives the
message.
However, when I try the same program with the Android Emulator, I get
an "Error:java.net.ConnectException: localhost/127.0.0.1:5554 -
Connection refused" I have tried different ports as well (, 3490).
This works perfectly with the regular Java project, but the moment I
write the same code in an Android project I get that error. I have
been stuck on this all day and am really getting frustrated :( Would
appreciate any help!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: Help with error in Android code

2009-10-02 Thread Android_n00b

Try this and let me know if it works:

public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button loginButton = (Button) findViewById(R.id.login);
EditText usernameView = (EditText)
findViewById
(R.id.username);
EditText passwordView = (EditText)
findViewById
(R.id.password);
loginButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
mUsername = usernameView.getText().toString
();
mPassword = passwordView.getText().toString
();
if (verifyLogin()) {
callHome();
}
}
});
}

On Oct 2, 12:15 pm, sbruno74  wrote:
> Hello,
>
> I am working on a simple application that, for now, just presents a
> login page as the starting activity with username and password and a
> login button. When you click on the login button, it starts a new
> activity after verifying credentials. When I run the application in
> the emulator, it stops unexpectedly without even showing the main
> activity with this error message : The application ... has stopped
> unexpectedly. Please try again later.
>
> It seems that it is the code where I register a listener for the
> button click that causes the crash because when I comment the code, at
> leas the application starts normally. I can't find the error. Here's
> my onCreate method where I register the listener:
>
> public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.main);
>
>         Button loginButton = (Button) findViewById(R.id.login);
>
>         loginButton.setOnClickListener(new View.OnClickListener() {
>                 public void onClick(View v) {
>                         EditText usernameView = (EditText) findViewById
> (R.id.username);
>                         EditText passwordView = (EditText) findViewById
> (R.id.password);
>                         mUsername = usernameView.getText().toString();
>                         mPassword = passwordView.getText().toString();
>                         if (verifyLogin()) {
>                                 callHome();
>                         }
>                 }
>         });
>     }
>
> For now, verifyLogin() does nothing and just returns true. The callHome
> () method just builds an intent, registers username and password as
> extras and starts the other activity with the intent.
>
> When I comment the setOnClickListener() call, I do not get the error.
>
> Please what did I do wrong?
>
> I run eclipse 3.5 with the ADT plugin on Windows Vista 64-bit.
>
> Stéphane
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Sockets with Android.

2009-10-02 Thread Android_n00b

Hi
I'm implementing a program which uses sockets to communicate between
the client and server. I am getting this to work fine with just a
message. However, I want to have an EditText field in my application,
which when I hit a 'Send' button, sends the text from the field to my
server and logs it. I am trying to implement this, but my program
always crashes. Any help would be appreciated. Here is my code:

Android Client:
public class SocketTest extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Thread sThread = new Thread(new TCPServer());
Thread cThread = new Thread(new TCPClient());
sThread.start();
try {
   Thread.sleep(1000);
  } catch (InterruptedException e) { }

  cThread.start();
}
}

TCP Server:
public class TCPServer implements Runnable{

public static final String SERVERIP = "127.0.0.1";
public static final int SERVERPORT = ;
public void run() {
 try {
  Log.d("TCP", "S: Connecting...");

  ServerSocket serverSocket = new ServerSocket
(SERVERPORT);
  while (true) {
 Socket client = serverSocket.accept();
 Log.d("TCP", "S: Receiving...");
 try {
  BufferedReader in = new BufferedReader(new
InputStreamReader(client.getInputStream()));
  String str = in.readLine();
  Log.d("TCP", "S: Received: '" + str + "'");
} catch(Exception e) {
Log.e("TCP", "S: Error", e);
} finally {
 client.close();
 Log.d("TCP", "S: Done.");
}

  }

 } catch (Exception e) {
   Log.e("TCP", "S: Error", e);
 }
}
}

TCP Client:
 public class TCPClient extends Activity implements Runnable {

final EditText msg = (EditText) findViewById(R.id.message);
final Button sendButton = (Button) findViewById(R.id.sendserver);

public void run() {
sendButton.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
try {

   InetAddress serverAddr = 
InetAddress.getLocalHost();
   Log.d("TCP", "C: Connecting...");
   Socket socket = new Socket(serverAddr,
TCPServer.SERVERPORT);
   String message = msg.toString();
   try {
Log.d("TCP", "C: Sending: '" + message 
+ "'");
PrintWriter out = new PrintWriter( new
BufferedWriter( new OutputStreamWriter(socket.getOutputStream
())),true);

out.println(message);
Log.d("TCP", "C: Sent.");
  Log.d("TCP", "C: Done.");

 } catch(Exception e) {
 Log.e("TCP", "S: Error", e);
} finally {
  socket.close();
}
 } catch (Exception e) {
  Log.e("TCP", "C: Error", e);
 }
}
}) ;

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



[android-beginners] Re: How to launch android emulator

2009-09-24 Thread Android_n00b

You have to be more specific. Did you create an avd?

On Sep 24, 12:31 pm, Androidbeginner  wrote:
> I followed the instruction to load Android in  (http://
> source.android.com/download). I am using Ubuntu ver9.03. I am having
> trouble to launch emulator. Message I got: emulator:cannot excute
> binary file. Anyone has ideas why?
>
> Thanks
> Androidbeginner.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: name of the event which gets trigger when i push/pull the file in FS

2009-09-24 Thread Android_n00b

What's with hijacking this thread?

On Sep 24, 11:20 am, Sriniamul Senthil  wrote:
> Hi,
>
>     Media Scanner doesn't get activate when i push/pull the file using DDMS. 
> Media Scanner gets called only when the phone boots up and also when SD card 
> is removed / inserted.
>
>     Does anyone know,
>
> 1. How to activate the media scanner ?
> 2. What is the name of the event which gets trigger when i push/pull the file 
> in File System ?
>
> Thanks & Regards,
> S.Sriniamul
>
>       From cricket scores to your friends. Try the Yahoo! India 
> Homepage!http://in.yahoo.com/trynew
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: onKeyboardActionListener vs onKeylistener

2009-09-24 Thread Android_n00b

Also, I am writing an application to use an Android device as a
virtual keyboard/trackpad for a desktop. I am currently simulating the
desktop with the EditText field. I would like to use the the
KeyboardListener if someone knows how it can be done. Thanks for your
help!

On Sep 24, 11:00 am, Android_n00b  wrote:
> Hi Balwinder,
>
> That is pretty much what I'm doing. I'm running 1.6. I guess it's
> working for me as well that way, but why do I have to hit the back
> button on the emulator for the text to be copied? On a real device
> this would be kind of frustrating.
>
> On Sep 24, 8:52 am, "Balwinder Kaur (T-Mobile USA)" 
> mobile.com> wrote:
> > Another thought. How are you copying and pasting from A to B ?
> > I was able to do it using this snippet.
>
> > CharSequence c = ((EditText)v).getText();
> > edittext2.setText(c);
>
> > Balwinder Kaur
> > ·T· · ·Mobile· stick together
>
> > The views, opinions and statements in this email are those of the
> > author solely in their individual capacity, and do not necessarily
> > represent those of T-Mobile USA, Inc.
>
> > On Sep 23, 9:54 pm, "Balwinder Kaur (T-Mobile USA)" 
> > mobile.com> wrote:
> > > hmm..I don't know what is going in your environment. For me (using SDK
> > > 1.5) Your code as is,  works too. When I hit  the back button on the
> > > emulator,  the virtual keyboard exits, HELLO gets copied to the
> > > EditTextA.
>
> > > Balwinder Kaur
> > > ·T· · ·Mobile· stick together
>
> > > The views, opinions and statements in this email are those of the
> > > author solely in their individual capacity, and do not necessarily
> > > represent those of T-Mobile USA, Inc.
>
> > > On Sep 23, 1:10 pm, Android_n00b  wrote:
>
> > > > I apologize about the last part of that message. I meant that I read
> > > > online about KeyboardView.OnKeyboardActionListener, but do not know
> > > > how it works.
>
> > > > On Sep 23, 4:08 pm, Android_n00b  wrote:
>
> > > > > Thanks for the reply. If I type HELLO and hit the back button, only O
> > > > > gets copied into box B. It's weird. Here is the relevant part of my
> > > > > code:
>
> > > > > @Override
> > > > >     public void onCreate(Bundle savedInstanceState) {
> > > > >         super.onCreate(savedInstanceState);
> > > > >         setContentView(R.layout.virtualkeyboard);
> > > > >         final EditText boxA= (EditText) findViewById(R.id.boxA);
> > > > >         final EditText boxB= (EditText) findViewById(R.id.boxB);
> > > > >         boxA.setOnKeyListener(new OnKeyListener() {
> > > > >                         @Override
> > > > >                         public boolean onKey(View v, int keyCode, 
> > > > > KeyEvent event) {
> > > > >                                 // TODO Auto-generated method stub
> > > > >                                 if(event.getAction() == 
> > > > > KeyEvent.ACTION_UP)
> > > > >                                 {
>
> > > > >                                         //copy text from box A to B
>
> > > > >                                 }
> > > > >                                 return false;
> > > > >                         }
> > > > >                 });
>
> > > > > Now just to repeat my problem, the above code works perfectly when I
> > > > > use a physical keyboard, or the emulators hard keyboard. It is only
> > > > > when I use the virtual(soft) keyboard does it not work. I saw some
> > > > > posts online about using setOnKeyListener instead. But I do not know
> > > > > how that works since it is not a method for EditText.
>
> > > > > On Sep 23, 3:54 pm, "Balwinder Kaur (T-Mobile USA)" 
> > > > > mobile.com> wrote:
> > > > > > Did you try hitting the backbutton on the emulator ( that would 
> > > > > > remove
> > > > > > virtual keyboard) and see if EditBox B gets updated or not ? I think
> > > > > > it should.
>
> > > > > > If not, please past your code here, so folks can take a look at it.
>
> > > > > > Thanks,
> > > > > > Balwinder Kaur
> > > > > > Open Source Development Center
> > > > > > ·T· · ·Mobile· stick together
>
> > > > > &g

[android-beginners] Re: onKeyboardActionListener vs onKeylistener

2009-09-24 Thread Android_n00b

Hi Balwinder,

That is pretty much what I'm doing. I'm running 1.6. I guess it's
working for me as well that way, but why do I have to hit the back
button on the emulator for the text to be copied? On a real device
this would be kind of frustrating.

On Sep 24, 8:52 am, "Balwinder Kaur (T-Mobile USA)"  wrote:
> Another thought. How are you copying and pasting from A to B ?
> I was able to do it using this snippet.
>
> CharSequence c = ((EditText)v).getText();
> edittext2.setText(c);
>
> Balwinder Kaur
> ·T· · ·Mobile· stick together
>
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Sep 23, 9:54 pm, "Balwinder Kaur (T-Mobile USA)" 
> mobile.com> wrote:
> > hmm..I don't know what is going in your environment. For me (using SDK
> > 1.5) Your code as is,  works too. When I hit  the back button on the
> > emulator,  the virtual keyboard exits, HELLO gets copied to the
> > EditTextA.
>
> > Balwinder Kaur
> > ·T· · ·Mobile· stick together
>
> > The views, opinions and statements in this email are those of the
> > author solely in their individual capacity, and do not necessarily
> > represent those of T-Mobile USA, Inc.
>
> > On Sep 23, 1:10 pm, Android_n00b  wrote:
>
> > > I apologize about the last part of that message. I meant that I read
> > > online about KeyboardView.OnKeyboardActionListener, but do not know
> > > how it works.
>
> > > On Sep 23, 4:08 pm, Android_n00b  wrote:
>
> > > > Thanks for the reply. If I type HELLO and hit the back button, only O
> > > > gets copied into box B. It's weird. Here is the relevant part of my
> > > > code:
>
> > > > @Override
> > > >     public void onCreate(Bundle savedInstanceState) {
> > > >         super.onCreate(savedInstanceState);
> > > >         setContentView(R.layout.virtualkeyboard);
> > > >         final EditText boxA= (EditText) findViewById(R.id.boxA);
> > > >         final EditText boxB= (EditText) findViewById(R.id.boxB);
> > > >         boxA.setOnKeyListener(new OnKeyListener() {
> > > >                         @Override
> > > >                         public boolean onKey(View v, int keyCode, 
> > > > KeyEvent event) {
> > > >                                 // TODO Auto-generated method stub
> > > >                                 if(event.getAction() == 
> > > > KeyEvent.ACTION_UP)
> > > >                                 {
>
> > > >                                         //copy text from box A to B
>
> > > >                                 }
> > > >                                 return false;
> > > >                         }
> > > >                 });
>
> > > > Now just to repeat my problem, the above code works perfectly when I
> > > > use a physical keyboard, or the emulators hard keyboard. It is only
> > > > when I use the virtual(soft) keyboard does it not work. I saw some
> > > > posts online about using setOnKeyListener instead. But I do not know
> > > > how that works since it is not a method for EditText.
>
> > > > On Sep 23, 3:54 pm, "Balwinder Kaur (T-Mobile USA)" 
> > > > mobile.com> wrote:
> > > > > Did you try hitting the backbutton on the emulator ( that would remove
> > > > > virtual keyboard) and see if EditBox B gets updated or not ? I think
> > > > > it should.
>
> > > > > If not, please past your code here, so folks can take a look at it.
>
> > > > > Thanks,
> > > > > Balwinder Kaur
> > > > > Open Source Development Center
> > > > > ·T· · ·Mobile· stick together
>
> > > > > The views, opinions and statements in this email are those of the
> > > > > author solely in their individual capacity, and do not necessarily
> > > > > represent those of T-Mobile USA, Inc.
>
> > > > > On Sep 23, 11:13 am, Android_n00b  wrote:
>
> > > > > > Hi,
> > > > > > I am new to Android, and am writing an app which has 2 EditTexts
> > > > > > (Let's call them A and B) and whenever I hit any key in A, it is
> > > > > > automatically copied to B. For example, if I type HELLO in A, it 
> > > > > > will
> > > > > > copy each letter into B. I m

[android-beginners] Re: onKeyboardActionListener vs onKeylistener

2009-09-23 Thread Android_n00b

I apologize about the last part of that message. I meant that I read
online about KeyboardView.OnKeyboardActionListener, but do not know
how it works.

On Sep 23, 4:08 pm, Android_n00b  wrote:
> Thanks for the reply. If I type HELLO and hit the back button, only O
> gets copied into box B. It's weird. Here is the relevant part of my
> code:
>
> @Override
>     public void onCreate(Bundle savedInstanceState) {
>         super.onCreate(savedInstanceState);
>         setContentView(R.layout.virtualkeyboard);
>         final EditText boxA= (EditText) findViewById(R.id.boxA);
>         final EditText boxB= (EditText) findViewById(R.id.boxB);
>         boxA.setOnKeyListener(new OnKeyListener() {
>                         @Override
>                         public boolean onKey(View v, int keyCode, KeyEvent 
> event) {
>                                 // TODO Auto-generated method stub
>                                 if(event.getAction() == KeyEvent.ACTION_UP)
>                                 {
>
>                                         //copy text from box A to B
>
>                                 }
>                                 return false;
>                         }
>                 });
>
> Now just to repeat my problem, the above code works perfectly when I
> use a physical keyboard, or the emulators hard keyboard. It is only
> when I use the virtual(soft) keyboard does it not work. I saw some
> posts online about using setOnKeyListener instead. But I do not know
> how that works since it is not a method for EditText.
>
> On Sep 23, 3:54 pm, "Balwinder Kaur (T-Mobile USA)" 
> mobile.com> wrote:
> > Did you try hitting the backbutton on the emulator ( that would remove
> > virtual keyboard) and see if EditBox B gets updated or not ? I think
> > it should.
>
> > If not, please past your code here, so folks can take a look at it.
>
> > Thanks,
> > Balwinder Kaur
> > Open Source Development Center
> > ·T· · ·Mobile· stick together
>
> > The views, opinions and statements in this email are those of the
> > author solely in their individual capacity, and do not necessarily
> > represent those of T-Mobile USA, Inc.
>
> > On Sep 23, 11:13 am, Android_n00b  wrote:
>
> > > Hi,
> > > I am new to Android, and am writing an app which has 2 EditTexts
> > > (Let's call them A and B) and whenever I hit any key in A, it is
> > > automatically copied to B. For example, if I type HELLO in A, it will
> > > copy each letter into B. I managed to get this to work perfectly with
> > > the setOnKeyListener(). However, in the emulator I found that the
> > > virtual keyboard did not respond to this listener the same way. For
> > > some weird reason, the number keys in the Virtual Keyboard (0-9)
> > > responded to the onKeyListener but none of the others did. After doing
> > > a Google search of my issue, I found some people with similar
> > > problems, but no real solution. I realized there is a
> > > KeyboardView.OnKeyboardActionListener which listens for inputs from
> > > the virtual keyboard. However, I have no idea how to use this in my
> > > edittext field. I would appreciate some sort of help with this matter.
>
> > > Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] Re: onKeyboardActionListener vs onKeylistener

2009-09-23 Thread Android_n00b

Thanks for the reply. If I type HELLO and hit the back button, only O
gets copied into box B. It's weird. Here is the relevant part of my
code:

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.virtualkeyboard);
final EditText boxA= (EditText) findViewById(R.id.boxA);
final EditText boxB= (EditText) findViewById(R.id.boxB);
boxA.setOnKeyListener(new OnKeyListener() {
@Override
public boolean onKey(View v, int keyCode, KeyEvent 
event) {
// TODO Auto-generated method stub
if(event.getAction() == KeyEvent.ACTION_UP)
{

//copy text from box A to B

}
return false;
}
});

Now just to repeat my problem, the above code works perfectly when I
use a physical keyboard, or the emulators hard keyboard. It is only
when I use the virtual(soft) keyboard does it not work. I saw some
posts online about using setOnKeyListener instead. But I do not know
how that works since it is not a method for EditText.

On Sep 23, 3:54 pm, "Balwinder Kaur (T-Mobile USA)"  wrote:
> Did you try hitting the backbutton on the emulator ( that would remove
> virtual keyboard) and see if EditBox B gets updated or not ? I think
> it should.
>
> If not, please past your code here, so folks can take a look at it.
>
> Thanks,
> Balwinder Kaur
> Open Source Development Center
> ·T· · ·Mobile· stick together
>
> The views, opinions and statements in this email are those of the
> author solely in their individual capacity, and do not necessarily
> represent those of T-Mobile USA, Inc.
>
> On Sep 23, 11:13 am, Android_n00b  wrote:
>
> > Hi,
> > I am new to Android, and am writing an app which has 2 EditTexts
> > (Let's call them A and B) and whenever I hit any key in A, it is
> > automatically copied to B. For example, if I type HELLO in A, it will
> > copy each letter into B. I managed to get this to work perfectly with
> > the setOnKeyListener(). However, in the emulator I found that the
> > virtual keyboard did not respond to this listener the same way. For
> > some weird reason, the number keys in the Virtual Keyboard (0-9)
> > responded to the onKeyListener but none of the others did. After doing
> > a Google search of my issue, I found some people with similar
> > problems, but no real solution. I realized there is a
> > KeyboardView.OnKeyboardActionListener which listens for inputs from
> > the virtual keyboard. However, I have no idea how to use this in my
> > edittext field. I would appreciate some sort of help with this matter.
>
> > Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~--~~~~--~~--~--~---



[android-beginners] onKeyboardActionListener vs onKeylistener

2009-09-23 Thread Android_n00b

Hi,
I am new to Android, and am writing an app which has 2 EditTexts
(Let's call them A and B) and whenever I hit any key in A, it is
automatically copied to B. For example, if I type HELLO in A, it will
copy each letter into B. I managed to get this to work perfectly with
the setOnKeyListener(). However, in the emulator I found that the
virtual keyboard did not respond to this listener the same way. For
some weird reason, the number keys in the Virtual Keyboard (0-9)
responded to the onKeyListener but none of the others did. After doing
a Google search of my issue, I found some people with similar
problems, but no real solution. I realized there is a
KeyboardView.OnKeyboardActionListener which listens for inputs from
the virtual keyboard. However, I have no idea how to use this in my
edittext field. I would appreciate some sort of help with this matter.

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



[android-beginners] Arayadapter only shows text when highlighted

2009-09-17 Thread Android_n00b

I have an arrayadapter which stores the names of the 12 months of the
year:
final String[] Months = new String[]
{"January","February","March","April","May","June","July","August",
"September","October","November","December"};
ArrayAdapter monthArray = new ArrayAdapter(this,
android.R.layout.simple_list_item_1, Months);

I also have a textview where if I enter some text, the matching text
in the arrayadapter appears below the textbox.
final AutoCompleteTextView textView = (AutoCompleteTextView)
findViewById(R.id.testAutoComplete);
textView.setAdapter(monthArray);

For example, if I start typing the characters of January, I should see
the word January appear below the textbox (like how google suggest
works). So my program seems to be working, but when I start typing Jan
for example, a box appears below with the word January in it, but I
can only see the text when it is highlighted. So for some reason, the
text is the same colour as the background box(white in this case).
Anyone know why this is happening?

Thanks!

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