About rotate screen use G-SENSOR

by lgbk » Mon, 17 May 2010 15:42:14 GMT


Sponsored Links
 Hi all,
  I'm debuging my gsensor in my devices.And now in my sensor HAL layer
code ,I return two types data.(ID_ACCELERATION and ID_ORIENTATION).I'm
confused how covert x,y,z data to pitch,roll.....In my code I use
                  pitch = atan(sensors.acceleration.y/
sensors.acceleration.z)*360/M_PI;
                  roll = atan(sensors.acceleration.x/
sensors.acceleration.z)*180/M_PI;
                  sensors.orientation.azimuth = 0.0;
But it seems have some error.Now I can not rotate my screen
automaitic,but can play some g-sensor game,like(labyrinthfull.apk).So
my question is that ,if I want to rotate screen automatic,which data
the system need to use?x,y,z? or pitch roll azimuth? or antoher data?
Can somebody show me some example,thanks.Any suggestion is appracite.

-- 



About rotate screen use G-SENSOR

by lgbk » Mon, 17 May 2010 17:28:26 GMT


 Some guys told me the sensor raw data is enough.So if it is right ,I
think the raw data I have covert and report successfull.So maybe I
forget some config in system.I also heared that I need config
something in init,rc but I didn,t know what need I add.Can anybody
told me or give me some suggestion,thanks!!!




-- 


Sponsored Links


Other Threads

1. Android Initialization (specifically, where does screen timeout get set ??)

I've been trying to find where the initial screen timeout gets set.
It seems to be 1 min, but I can't find where this is set.
And more generally, what is the Android initialization sequence?
Where does it start? How does the flow go?
Thanks.    Mike

--

2. How do I get phone number from a ListAdapter?

The following is the code from the "First Hand Look at Building an
Android Application"

@Override
 protected void onListItemClick(ListView l, View v, int position, long
id) {

super.onListItemClick(l, v, position, id);
                Intent i  = new Intent(Intent.ACTION_CALL);

                Cursor c  = (Cursor) mAdapter.getItem(position);
                long phoneId =
c.getLong( c.getColumnIndex( People.PREFE <--- the rest truncated by
screen
                i.setData( Phones.CONTENT_URI.addId(phoneId)):

                startActivity(i);
}

--

3. Co-operation

4. Problem in local host;

5. Facing problem while playing video on emulator

6. Textview Editable Place Holder

7. Add-ons and Platform folder empty...