Java tutorial
//package com.java2s; import android.animation.ObjectAnimator; import android.view.View; import android.view.animation.CycleInterpolator; public class Main { public static void makeSnake(View v) { ObjectAnimator snake = ObjectAnimator.ofFloat(v, "translationX", 0, 10).setDuration(300); snake.setInterpolator(new CycleInterpolator(2)); snake.start(); } }