[android-developers] Launch SoftKeyboard without view in Android

2011-11-23 Thread Deepak Kumar
Hi All,


I need the solution of following two things as early as possible:-
  1)How to launch a softKeyboard even when there is no edittext or
TextView present programmatically.
  2)And get each character that is typed on the soft keyboard.

Or wheather it is possible or not?





Thanks & Regards,
DEEPAK KUMAR

-- 
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] Launch SoftKeyboard without view in Android

2011-11-23 Thread anup Jaipurkar
Hi Deepak,
Not much known about, How to launch a softkeybord.
But, if your phone's UI showing some edittext field, you can definitely
write there via adb shell.
1. connect the device via adb
2. touch the edittext where you want to type
3. $ adb shell
4.#input text deepak

"deepak" will appear in edittext

Thanks
Anup


On Wed, Nov 23, 2011 at 6:43 PM, Deepak Kumar wrote:

> Hi All,
>
>
> I need the solution of following two things as early as possible:-
>   1)How to launch a softKeyboard even when there is no edittext or
> TextView present programmatically.
>   2)And get each character that is typed on the soft keyboard.
>
> Or wheather it is possible or not?
>
>
>
>
>
> Thanks & Regards,
> DEEPAK KUMAR
>
> --
> 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] Launch SoftKeyboard without view in Android

2011-11-23 Thread Deepak Kumar
Yeah, that is possible.

   But I want to know how to launch soft Keyboard programmatically
if there is no edittext or textview in layout?.
   Please reply anyone knows about this?



On Wed, Nov 23, 2011 at 7:28 PM, anup Jaipurkar wrote:

> Hi Deepak,
> Not much known about, How to launch a softkeybord.
> But, if your phone's UI showing some edittext field, you can definitely
> write there via adb shell.
> 1. connect the device via adb
> 2. touch the edittext where you want to type
> 3. $ adb shell
> 4.#input text deepak
>
> "deepak" will appear in edittext
>
> Thanks
> Anup
>
>
>   On Wed, Nov 23, 2011 at 6:43 PM, Deepak Kumar  > wrote:
>
>>   Hi All,
>>
>>
>> I need the solution of following two things as early as possible:-
>>   1)How to launch a softKeyboard even when there is no edittext
>> or TextView present programmatically.
>>   2)And get each character that is typed on the soft keyboard.
>>
>> Or wheather it is possible or not?
>>
>>
>>
>>
>>
>> Thanks & Regards,
>> DEEPAK KUMAR
>>
>> --
>> 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

-- 
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] Launch SoftKeyboard without view in Android

2011-11-23 Thread Eric Carman
I use this in a custom view. I must admit that it doesn't always seem to 
work - as reported by customers - but I've not had it fail for me in 
testing on a number of devices. I actually found this doing a lot of Google 
searches myself, so credit/blame goes elsewhere. While you may not need to 
do all of this exactly, perhaps it will get you a little closer.

public class MyView extends LinearLayout {



public View.OnLongClickListener mLongClickListener = new 
View.OnLongClickListener() {

@Override
public boolean onLongClick(View v) {

softKeyboardResults rr = new softKeyboardResults();

Configuration config = MyView.this.getResources()
.getConfiguration();
if (config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_YES
|| config.hardKeyboardHidden == Configuration.HARDKEYBOARDHIDDEN_UNDEFINED) 
{
InputMethodManager imm = (InputMethodManager) MyView.this.mContext
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(MyView.this,
InputMethodManager.SHOW_IMPLICIT, rr);
}
return false;
}

};

class softKeyboardResults extends ResultReceiver {

public softKeyboardResults() {
super(getHandler());
}

@Override
protected void onReceiveResult(int resultCode, Bundle resultData) {
super.onReceiveResult(resultCode, resultData);

switch (resultCode) {
case InputMethodManager.RESULT_HIDDEN:
case InputMethodManager.RESULT_SHOWN:
case InputMethodManager.RESULT_UNCHANGED_SHOWN:
break;
case InputMethodManager.RESULT_UNCHANGED_HIDDEN:
InputMethodManager imm = (InputMethodManager) MyView.this.mContext
.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(MyView.this,
InputMethodManager.SHOW_FORCED);
break;
default:
break;
}
}

}
}

Best Regards,
Eric

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