How to Hide/dismiss a keyboard on a web browser on a real Android device?

Hi there,
I have a code, where the website launches on the Android real device, the web site has 2 fields a user name and password. When I send keys to user name field, the keyboard pops up. How do I dismiss this keyboard or click on done/next?

I do know hidekeyboard works on a web app. But how do you handle this on a web browser on a real device, following is my code

public void apptest1() throws Exception{
    DesiredCapabilities cap = new DesiredCapabilities();
    cap.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);   
    cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Device");
    cap.setCapability(MobileCapabilityType.BROWSER_NAME, "Chrome");
    cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "100");
    AndroidDriver driver = new AndroidDriver(new URL(""),cap) ; 


Try sending the back key.

Thanks for the reply.
The back key you mean to navigate the browser back?
I tired driver.navigate.back().
It only took the browser back.

How do I send commands to a device element when Im working on a browser element.? the hidekeyboard() works when I’m inside a web app. But it has no effect when I’m inside a browser .

Ok… so the following has fixed the problem


How can I hide keyboard on Safari browser of iOS real device using ruby.