appium/appium — pull request #1325 by samaitra (2013-10-18 18:50:54+00:00)
Title: Add new command to press on the Home button for Android.

The Android UiDevice has method to press the Home button. To support this a new mobile command is added 'home'.

For Java binding, the client code will be...

((JavascriptExecutor)driver).executeScript("mobile: home");

This same functionality can also be achieved with the following client code but the above looks much cleaner.

HashMap keycode = new HashMap();
keycode.put("keycode", 3);
((JavascriptExecutor)driver).executeScript("mobile: keyevent", keycode);