Have a look at this SO question for more understanding about gravity.
Try to learn how compass works bye this example
I guess your looking for solution
ImageView move according to however the user tilts the device
which is exactly look like this accelerometer example