Yes, I have a compass and I'm using:

    public void onSensorChanged(SensorEvent event) {
    // TODO Auto-generated method stub
    if (event.sensor.getType() == Sensor.TYPE_ORIENTATION) {

mDraw.setOrientationString((int)event.values[0],(int)event.values[1],(int)event.values[2]);
             }
    }

I the View class I'm extracting the azimuth, pitch and roll...but then I
don't know how to use those numbers to check the camera direction.

Thanks for your reply.

-raich.

On Thu, Feb 18, 2010 at 6:57 AM, Kitzy <[email protected]> wrote:

> You first have to be sure your phone has a compass, otherwise you
> won't know which way you are facing.
>
> The other option would be to use GPS, but you'll have to move. Start
> position --> second position == dirrection I'm facing.
>
> -Kitzy
>
> On Feb 17, 3:54 pm, raich <[email protected]> wrote:
> > Hi,
> >
> > I'm writing a small app which will track a Target location. I know
> > target location's longitude,latitude,bearing.
> >
> > Now I'll hold my android phone and spin around slowly.
> >
> > My aim is to locate the Target location  using Sensor/Location
> > Manager. Whenever my android device is aligned in the direction of
> > target a Toast will open up "Your target location is in this
> > direction". How can I achieve this?
> >
> > Regards
> > -raich
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Beginners" group.
>
> NEW! Try asking and tagging your question on Stack Overflow at
> http://stackoverflow.com/questions/tagged/android
>
> To unsubscribe from this group, send email to
> [email protected]<android-beginners%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-beginners?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.

NEW! Try asking and tagging your question on Stack Overflow at
http://stackoverflow.com/questions/tagged/android

To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en

Reply via email to