android - Listen for location and orientation changes -


i working on idea android app requires me listen location changes , orientation changes.

basically want find out if facing towards point, require me find orientation of phone. want keep track of location changes want know if user closer or further away point. have location listener sorted can location against number of stored points in database.

how go listening orientation changes @ same time? possible implement 2 listeners in same activity.

by orientation changes mean changes in direction user facing not phone orientation such landscape or portrait. wanting monitor onsensorchanged , retrieve azimuth

for listening orientation changes can use onconfigurationchanged()

and add configchanges in manifest activity:

<activity android:name=".myactivity"           android:configchanges="orientation|keyboardhidden"           android:label="@string/app_name"> 

Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -