Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 822743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T02:50:33+00:00 2026-05-15T02:50:33+00:00

I can’t find much information out there on Android’s hardware compass. I keep trying

  • 0

I can’t find much information out there on Android’s hardware compass. I keep trying to setup my criteria to force Android to use the hardware compass. Basically my problem is I want the bearing to update even while the device is stationary.

From my understanding the GPS will only update your bearing when your moving. I’d like bearing to update regardless if you’re moving or not. I’ve tried tricking the device in to thinking it’s moving by setting the speed at a constant 10 but the bearing returns 0.0 always.

My device for testing (currently) is a HTC Tattoo. It has a compass so that’s not the problem. So my question is, is there a way to get the bearing to update using hardware compass or not? regardless if your moving or not?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T02:50:33+00:00Added an answer on May 15, 2026 at 2:50 am

    Have you seen this example code? Here a SensorListener is used to query the orientation:

    mSensorManager = (SensorManager)getSystemService(Context.SENSOR_SERVICE);
    mListener = new SensorListener() {
        public void onSensorChanged(int sensor, float[] values) {
            if (Config.LOGD) Log.d(TAG, "sensorChanged (" + values[0] + ", " + values[1] + ", " + values[2] + ")");
            mValues = values;
            if (mView != null) {
                mView.invalidate();
            }
        }
    mSensorManager.registerListener(mListener, 
                        SensorManager.SENSOR_ORIENTATION,
                        SensorManager.SENSOR_DELAY_GAME);
    

    Ok, so this is deprecated code. Now the SensorManager has a getOrientation() method that can be used. This does need a rotation matrix though. See here for an example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone help me trying to find out why this doesn't work. The brushes
Can't work out a way to make an array of buttons in android. This
Can someone please help me figure out why my accordion script at http://www.mincovlaw.com/services/copyright gets
Can't figure out how to do this in a pretty way : I have
Can I set a maximum fps? Is there any way to limit fps in
Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can you tell me what is the difference between abstraction and information hiding in
Can someone please point me to the direction where there is a example on
Can we update a javascript array variable, with out reloading a page as well
Can anyone help me find a software stack for doing near real time video

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.