Compass for android (orientation in 3D space)

by mboehmer » Mon, 29 Dec 2008 18:19:14 GMT


Sponsored Links
 Hello,

mobile phones usually show the point of the compass, when people are
on the move (estimation of a vector from gps track). The API says,
that android is also able to get the point of the compass. How is this
done? Is this done by software (estimating the vector) or has the G1
an build-in magnetic hardware compass? If not, does anyone know, if it
is possible to connect a magnetic compass via USB or bluetooth?

I am interested in the orientation of the phone in 3D space, while the
user is standing still. Does anyone know, how wikitude (http://
www.youtube.com/watch?v=8EA8xlicmT8) does this?

Best regards
mboehmer

--~--~---------~--~----~------------~-------~--~----~



Compass for android (orientation in 3D space)

by DSmith » Mon, 29 Dec 2008 23:44:16 GMT


 The easiest way is to use SENSOR_ORIENTATION ( http://code.google.com/ 
android/reference/android/hardware/
SensorManager.html#SENSOR_ORIENTATION).  It does all the necessary
calculations on the magnetometer and accelerometer values, throws in
some low-pass filtering, and spits out azimuth, pitch, and roll.  The
calculations aren't perfect - you'll see some strange things at the
branch cuts, like the az spinning backwards through the entire range
when you raise the phone over your head, but it's pretty good for most
practical uses.
--~--~---------~--~----~------------~-------~--~----~


Sponsored Links


Other Threads

1. How to make the consistent WebView (not lauching a new Web browser?)

Hi, I have a question about using WebView.

When I load a WebView, it is lauching a new Web browser? (it means
another application is lauched)
I want that the next linked response has contained the previous
WebView, not the new one.

When a link in the WebView was clicked, how to keep the WebView layout
display?

Thanks in advance for ur replies.

-- 

2. why my onScrollStateChanged(AbsListView view, int scrollState) effetct nothing

I use ListActivity , and implements OnScrollListener, and have my code
just like below
@Override
public void onScroll(AbsListView view, int firstVisibleItem, int
visibleItemCount, int totalItemCount) {
        Log.d(TAG,"onScroll");
        Toast.makeText(this, totalItemCount+"", Toast.LENGTH_SHORT).show();
}

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
        Log.d(TAG,"onScrollStateChanged");
        Toast.makeText(this, "onScrollStateChanged",
Toast.LENGTH_SHORT).show();
}

every time I scroll the listview, and ddms output  "onScroll"
right .but when I scroll to the end and still scroll. It seems the
ddms should ouput onScrollStateChanged and have a toast, but it
doesn't. why?


-- 

3. Is WIFI default mode of communcation to internet

4. How to register to Internet browser URL change events

5. Stream Sound Delay

6. how to get the total size of sdcard?

7. Can't use service with AIDL right after starting it with bindservice and BIND_AUTO_CREATE