I am not able to scroll in real device...i have 2 class base and scrolling demo i am sharing

import java.net.MalformedURLException;
import java.time.Duration;
import java.util.concurrent.TimeUnit;

import org.openqa.selenium.By;
import org.openqa.selenium.Dimension;

import io.appium.java_client.MobileElement;
import io.appium.java_client.TouchAction;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;

public class Scrolling extends Base{

public static void main(String[] args) throws MalformedURLException {
	AndroidDriver<AndroidElement> driver = Capabilities("real");
	driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
	//Scrolling the window full without specifying any specific point(Like down we are specifying webview it will scroll till webview)
	


	
	//3-static method to swipe vertically
	public static void swipeVertical(AppiumDriver driver, double startPercentage, double finalPercentage, double anchorPercentage, int duration) throws Exception {
	    Dimension size = driver.manage().window().getSize();
	    int anchor = (int) (size.width * anchorPercentage);
	    int startPoint = (int) (size.height * startPercentage);
	    int endPoint = (int) (size.height * finalPercentage);
	    new TouchAction(driver).press(anchor, startPoint).waitAction(Duration.ofMillis(duration)).moveTo(anchor, endPoint).release().perform();     
	}
 
 		
	driver.findElementByXPath("//android.widget.TextView[@text='Views']").click();

	driver.findElementByAndroidUIAutomator("new UiScrollable( new UiSelector()).scrollIntoView(text(\"WebView\"));");	
	}

}

import java.io.File;
import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.remote.DesiredCapabilities;

import io.appium.java_client.AppiumDriver;
import io.appium.java_client.android.AndroidDriver;
import io.appium.java_client.android.AndroidElement;
import io.appium.java_client.remote.MobileCapabilityType;

public class Base {

public static  AndroidDriver<AndroidElement> Capabilities(String device) throws MalformedURLException  {
	// TODO Auto-generated method stub
	File f = new File("src");
	File fs = new File(f,"ApiDemos-debug.apk");
	
	DesiredCapabilities cap = new DesiredCapabilities();
	//running test cases in the Emulator
	//if(device.equals("emulator")) {
	
	cap.setCapability(MobileCapabilityType.DEVICE_NAME, "amit");
//	}else if(device.equals("real")) {
	//running Tset cases in the real device
	
	cap.setCapability(MobileCapabilityType.DEVICE_NAME, "Android Device");
	//}
	
	cap.setCapability(MobileCapabilityType.APP, fs.getAbsolutePath());
	AndroidDriver<AndroidElement> driver = new AndroidDriver<AndroidElement>(new URL("http://127.0.0.1:4723/wd/hub"),cap);
	
	return driver;
	
	//Android UiEmulator
	
	
	    
	}

	
	

}