Reputation: 1621
Actually i need to get the device current position. like device is in south-west corner or device is in north-west corner. just like compass. I do not have any idea how can i get this done. I think i need to use sensor with type TYPE_MAGNETIC_FIELD. Please guide.
Upvotes: 3
Views: 2006
Reputation: 11038
To conclude your actual position the most accurate is to use GPS. (0,0) is for North pole.
To implement Compass you should use Sensor.TYPE_ORIENTATION
http://developer.android.com/reference/android/hardware/SensorEvent.html#values
For rough estimation of the North/South you can use Sensor.TYPE_MAGNETIC_FIELD.
Upvotes: 2