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

  • SEARCH
  • Home
  • 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 6840763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:53:01+00:00 2026-05-26T23:53:01+00:00

I have software designed for 2.3.3 where I am using the gravity sensor. Code

  • 0

I have software designed for 2.3.3 where I am using the gravity sensor.

Code below –

private SensorManager sman = (SensorManager) getContext().getSystemService(Context.SENSOR_SERVICE);
private Sensor magnetfield, gravity;
...
magnetfield = sman.getDefaultSensor(Sensor.TYPE_MAGNETIC_FIELD);
gravity = sman.getDefaultSensor(Sensor.TYPE_GRAVITY);

I decided to add support for version 2.1. However it seems TYPE_GRAVITY is not supported in 2.1, and I get an error that Sensor.TYPE_GRAVITY is not recognized anymore.

Questions –
A) When I search for “Android gravity sensor 2.1” googles links to videos that demo gravity sensor in 2.1 devices. Does that mean there is a way to get access to it?
B) If not, what is the lowest version that can use this? Couldn’t find it in the SDK.

Thanks

  • 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-26T23:53:01+00:00Added an answer on May 26, 2026 at 11:53 pm

    By looking at the source code you can see that the gravity sensor is actually computed using a Butterworth filter. I also asked a question on dsp (here). Hope the link helps because it helped me understand quite a lot of things.

    For gravity sensor in versions < 2.3 you need to implement that filter yourself if you want the same results.

    Here is the source code.

    Later edit: Added a valid link!

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

Sidebar

Related Questions

I have a software that runs on mac (using terminal program) the program is
I have a program designed in VB.net for a wafer probing system. The software
We have software that runs fine under a normal Windows installation but when we
We have a software product that evolves at the rhythm of clients' needs and
I have a software diagnostic page on which I would like to list the
We have some software we use internally which is released via ClickOnce from VS
We have some software which relied on certain behavior from another ( very commonly
We have this software that has a webservices component. Now, the administrator of this
I have a software package placed in the root directory of my website. I'd
I have a software renderer that I am porting from PC to the iPhone.

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.