sumio / uiautomator-unicode-input-helper

helps you to input any (including non-ASCII) characters by using Android Uiautomator
Apache License 2.0
140 stars 70 forks source link

Very special Chars #1

Open elbajo opened 10 years ago

elbajo commented 10 years ago

Before i start, Any ideas if your project would solve my issue? http://code.google.com/p/android/issues/detail?id=62906

Thank you!

sumio commented 10 years ago

@elbajo, thank you for having interest! In issue 62906, is your example of character "PERSON WITH FOLDED HANDS" (U+1F64F)?

I wrote simple Activity with a EditText whose contentDescription is "\uD83D\uDE4F" (which is Java expression of U+1F64F) and launched uiautomatorviewer.

protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    EditText editText = (EditText)findViewById(R.id.editText1);
    editText.setContentDescription("\uD83D\uDE4F");
}

The results was the same as yours. the same exception occurred.

By contrast, uiautomator script to search the EditText was finished correctly with normal IME. Is it the same as you?

public void testEmoji() throws Exception {
    UiObject editText = new UiObject(new UiSelector().description("\uD83D\uDE4F"));
    editText.setText("Hello World!");
}

Anyway, Uiautomator Unicode Input Helper, my project, doesn't solve the issue of uiautomatorviewer, but enable you to input any android smileys (aka emoji) defined by Unicode 6.0 as follows:

public void testEmojiInput() throws Exception {
    UiObject editText = new UiObject(new UiSelector().description("\uD83D\uDE4F"));
    editText.setText(Utf7ImeHelper.e("\uD83D\uDE4F"));
}

But I tested the above code only on Nexus7 (2013), Android 4.4, it would run properly on Android 4.1 to 4.3.

Thank you!

elbajo commented 10 years ago

Thank you for your response, I use the github project "AndroidViewClient" so intreract with an android Phone but this project uses Uiautomator to locate the elements so it crashes each time there is an emoji... It's wired that when you use uiautomator it works and when "AndroidViewClient" uses it it crashes. But yes you reproduced the bug correctly, i hope google will do the same!

sumio commented 10 years ago

@elbajo, if you don't use AndroidViewClient, do you reproduce the bug? I wonder if AndroidViewClient triggers the bug or not. If the bug is reproduced by using with ONLY AndroidViewClient, I guess that AndroidViewClient parses a xml of view hierarchy like uiautomatorviewer and uiautomator doesn't.