You must use Path . The docs say:
The Path class encapsulates the composition of a (multi-loop) geometric path, consisting of straight line segments, quadratic curves, and cubic curves ....
For example, you can expand the view and add touch event positions to the Path method in the onTouchEvent(MotionEvent event) your view. Then you need to create random positions corresponding to the latest touch event and add them to other instances of the path. Finally, in the onDraw() method of your view, draw all the paths. Hope this snippet helps you understand my idea:
public class NetCanvas extends View { private static final double MAX_DIFF = 15; Path path0 = new Path(); Path path = new Path(); private Paint p0; private Paint p; public NetCanvas(Context context) { super(context); p0 = new Paint(); p0.setShader(new LinearGradient(0, 0, 230, getHeight(), Color.GREEN, Color.RED, Shader.TileMode.CLAMP)); p0.setStyle(Style.STROKE); p = new Paint(); p.setShader(new LinearGradient(0, 0, 230, getHeight(), Color.BLUE, Color.MAGENTA, Shader.TileMode.CLAMP)); p.setStyle(Style.STROKE); } @Override public boolean onTouchEvent(MotionEvent event) { float x0 = event.getX(); float y0 = event.getY(); float x = generateFloat(event.getX()); float y = generateFloat(event.getY()); if (event.getAction() == MotionEvent.ACTION_DOWN) { path0.moveTo(x0, y0); path0.lineTo(x0, y0); path.moveTo(x, y); path.lineTo(x, y); } else if (event.getAction() == MotionEvent.ACTION_MOVE) { path0.lineTo(x0, y0); path.lineTo(x, y); } else if (event.getAction() == MotionEvent.ACTION_UP) { path0.lineTo(x0, y0); path.lineTo(x, y); } invalidate(); return true; } @Override public void onDraw(Canvas canvas) { canvas.drawPath(path0, p0); canvas.drawPath(path, p); } private float generateFloat(Float f){ double d = (Math.signum(2*Math.random() - 1)) * Math.random() * MAX_DIFF; return (float) (f + d); } }
In the above code, I used two Path s, but you can use three or more . Also, the result depends on the speed of your finger on the screen. For instance:

or it might look like this:

Edit:
Above the class ( NetCanvas ) extends the view , so you can create an instance of it and use this instance like other types. For example, you can simply set its instance as a ContentView its activity. Here I override the onCreate() Activity method:
@Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(new NetCanvas(this)); }
Although you can modify NetCanvas to extend SurfaceView with some other changes.