How to use sendKeyEvent in AndroidDriver - java-client 3.3.0?

I’m not able to find the method driver.sendKeyEvent() for AndroidDriver using java-client 3.3.0. Pls help.

Use pressKeyCode method instead of sendKeyEvent()

public void pressKey(int androidKeyCode){
        try {
            AndroidDriver androidDriver = (AndroidDriver) appiumDriver;
            printDebug("Key " + androidKeyCode + " clicked");
        }catch (Exception e){


Hi Degard…
I need to click on the search button on the keyboard of android mobile…
Trying to use your code…
But how do u get appiumDriver?
I am using java client 3.4.0.jar…do i need to update my java client?
Please help us.