How to swipe a carousel slider in android app through appium[+java] without using X and Y co-ordinates to swipe the app

How to swipe a carousel slider in android app through appium[+java] without using X and Y co-ordinates to swipe the app.

Is there any inbuilt functions or methods to do this.

Hi @nv_sateesh

((MobileElement)element).swipe(SwipeElementDirection.UP, intSwipeTime);

where
SwipeElementDirection can be UP,DOWN,LEFT,RIGHT
intSwipeTime is duration of Swipe action

Thanks,
-Mani