How to handle native android keyboard using appium

Linking https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/android-ime.md

Nice, work like a charm. thak you

driver.HideKeyboard();

Linking https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/android/android-ime.md

I am unable to perform search icon click operation in android native app keyboard .Please suggest me how to do this action i tried with pressKeyCode and Keys.Enter ,But these are not working.Thanks in advance.

HI can some one please help on how to click on search icon or pass enter after entering the value on search text area,

driver.findElementByXPath("//android.widget.EditText[@text=“Search”]").sendKeys(Tshirt\n");

this is not working ,even tried (“Tshirt”+"\n")

Am completely new into this, please guide me through

can anyone describe the code
How to create the driver object and and then send the keypress event ?

driver.executeScript("mobile: performEditorAction", ImmutableMap.of("action", "done"));

Finally I was able to solve it

driver.pressKey(KeyEvent(AndroidKey.TAB))
driver.pressKey(KeyEvent(AndroidKey.ENTER))

Hitting only pressKey was not enough for my case since focus is not changed until I hit to Tab.

Hello friends,
I am getting the below errors on

The method pressKey(io.appium.java_client.android.nativekey.KeyEvent) in the type PressesKey is not applicable for the arguments (com.thoughtworks.selenium.webdriven.commands.KeyEvent)

Might help to start a new thread and explain your issue from the beginning, looks like a different issue from where I’m standing.