Getsize().getwidth(); returning wrong value?

I am new to appium and doing automation for Android

MobileElement mobileElement = app.findElement(By.id(viewID));

int xvalue = mobileElement.getSize.getWidth();
int yvalue = mobileElement.getSize.getHeight();

TouchAction action = new TouchAction(app);

action.press(mobileElement, xvalue/4, yvalue/2).waitAction(3000).moveTo(mobileElement, xvalue/8, yvalue/2).release().perform;

I m using the above code for swiping right.
The value of xvalue and yvalue is returned as 28 and 1470 whereas the inspector shows size {1328, 1470}

The swiping action is not performed using above code.

I have also tried this:

mobileElement.swipe(RIGHT, duration)

which is causing unknown server exception while running.

Details
Android Device : Samsung S7 - v6.0.1
Appium version: 1.4.13
Environment: OS X 10.11.3
Language: JAVA