Why did you tag this with MATLAB yet you are clearly trying to figure this out for Java / Android? I've removed the MATLAB tag because it's just nonsense.
– rayryengFeb 17 '15 at 01:04
Your post says you need to know how to do this on Java / Android yet your comment says you want to do it in MATLAB... so which one is it?
– rayryengFeb 17 '15 at 15:30