Hello,

Firstly, i realise that i may be breaching group etiquette here by 
re-posting a question in this group that i've also raised in another group, 
(android-ndk), However the question does straddle both areas, (ndk and 
sdk), and i suspect there will be many on here who probably know the answer 
to this post and can offer advice and information from the sdk point of 
view. If i have breached etiquette then please accept my apologies and feel 
free to delete this post. (Though another reason for posting twice is i'm 
up against a deadline! ;)

I'm writing a Android NDK application, targeted at API 8, based on the *
hello-gl2* example and so uses a single full-screen OpenGL2.0 view, 
(extended *GLSurfaceView*).

I need to bring up the on-screen keyboard and pass the user entered text 
down to c code processing. I've managed to get this working based on this 
stackoverflow 
answer <http://stackoverflow.com/a/7425536/1184595>, (I don't get 
notification if the user closes the keyboard but from comments elsewhere in 
this group that seems to be the way things are. :)

All is well with this method until i switch to *Swype* or any other 
more-advanced-then-stock keyboard input manager then i rarely get the key 
events.
After reading the *KeyEvent* developer doc class overview what i'm seeing 
seems to be the expected behaviour:

 "*You should never rely on receiving KeyEvents for any key on a soft input 
method.*"

So i've been trying to work out a way in which to capture and/or extract 
text and i'm not having much luck.

I've got this code in my extended *GLSurfaceView *class:

  @Override
  public InputConnection onCreateInputConnection(EditorInfo outAttrs)
  {
      outAttrs.actionLabel = "";
      outAttrs.hintText = "";
      outAttrs.initialCapsMode = 0;
      outAttrs.initialSelEnd = outAttrs.initialSelStart = -1;
      outAttrs.label = "";
      outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | 
EditorInfo.IME_FLAG_NO_EXTRACT_UI;
      outAttrs.inputType = InputType.TYPE_NULL;

      return new BaseInputConnection(this, false);
  }

  @Override
  public boolean onCheckIsTextEditor()
  {
    return true;
  }

And i'm calling:

  *public boolean showSoftInput(View view, int flags)*

passing in the view returned from '*getCurrentFocus*', from native code to 
display the keyboard.

Is it possible to be able to extract the text from the on-screen software 
keyboard not using the keyup event?
Is it possible to update what i've got to be able to do this or should i be 
looking at a completely different method?

Apologies for the questions, as you can tell, the non-native Java side of 
Android development is quite new to me. :)

Many thanks for any help or advice offered,
Andy

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

Reply via email to