sendkeys not working properly in Appium RemotewebDriver
<p>I am using Appium 1.4.16 to automate apk file stored in my system in real android device. I am using java-client 3.4.1 
Here is the code:</p>

<pre><code>public static void main(String[] args) {

    File app = new File("C:\\Users\\dell\\Downloads\\App.apk");


    DesiredCapabilities capabilities = new DesiredCapabilities();

    capabilities.setCapability("device", " Android");
    //mandatory capabilities
    capabilities.setCapability("deviceName","Android");

    capabilities.setCapability("platformName","Android");

    capabilities.setCapability("udid", "849e82c6");

    capabilities.setCapability("app",app.getAbsolutePath());

    capabilities.setCapability("appPackage", "xxxxxxxxxxx");

    capabilities.setCapability("appActivity", "xxxxxxxxxx.MainActivity");

    try{


    RemoteWebDriver driver = new RemoteWebDriver(new URL("http://127.0.0.1:4723/wd/hub"),capabilities);

    System.out.println("Device Started");

    driver.manage().timeouts().implicitlyWait(25, TimeUnit.SECONDS);

    RemoteWebElement number = (RemoteWebElement)driver.findElement(By.xpath("//android.widget.EditText[@resource-id='xxxx' and @content-desc = 'Mobile Number']")); 

    number.sendKeys("90002");

     RemoteWebElement passwordKey = (RemoteWebElement)driver.findElement(By.xpath("//android.widget.EditText[@resource-id='yyyyy']"));

     passwordKey.sendKeys("ezr123");  

     RemoteWebElement loginButton = (RemoteWebElement)driver.findElement(By.xpath("//android.view.View[@resource-id='ezm_submit_login_form']"));

     loginButton.click();

    }catch(Exception e){

        e.printStackTrace();
    }

}
</code></pre>

<p>}</p>

<p>I am not getting any error in Appium server but facing strange actions in UI.
While entering value in username field, it automatically clicks on Login Button then again enters value in password field. Here, it always starts with entering '2' in the field and ends with 8-digit password.But my supplied password is 6-digit long.Then nothing happens.</p>

<p>I have also tried giving Thread.sleep() between each action.But no change is observed.</p>