digital-compass

How to make a customized compass view in android

本小妞迷上赌 提交于 2019-12-21 17:37:34
问题 I am working with a simple compass application. I need to set the compass view with the sensor activity for that i choose a compass view class. But it is only drawing a circle and a line for the compass view. I need to customize this view by replacing this circle and line with my own drawable images somebody please help me to fix this. My view class import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.view

North calculation based on magnetometer and gyroscope

半世苍凉 提交于 2019-12-08 01:36:33
问题 I need to calculate "facing" (it doesn't matter if it will be based on true north or magnetic one). As it can be seen on the iOS devices the CLHeading objects returned by the CLLocationManager gives us both the true and the magnetic heading by corresponding properties. Also, we can very easily see, that those values are related to the top of the device (the positive Y axis of the devices coordinate system) wich is not good for my purposes. What I actually need is to calculate the facing

How to make a customized compass view in android

感情迁移 提交于 2019-12-04 09:13:26
I am working with a simple compass application. I need to set the compass view with the sensor activity for that i choose a compass view class. But it is only drawing a circle and a line for the compass view. I need to customize this view by replacing this circle and line with my own drawable images somebody please help me to fix this. My view class import android.content.Context; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.view.View; public class MyCompassView extends View { private Paint paint; private float position = 0;

Compass readings on SGS III

那年仲夏 提交于 2019-11-29 12:36:53
My app needs to show the current bearing of the device using its compass. The code I'm using (below) works perfectly fine on my Galaxy Nexus and Galaxy One, but the compass is spinning around wildly on a Samsung Galaxy S III. I've tried doing a figure-8 to recalibrate the device, but that doesn't change anything. The weird thing is that other compass apps downloaded from Google Play work just fine on the SIII. What could be the issue here? float[] mGravity; float[] mGeomagnetic; public void onSensorChanged( SensorEvent event ) { float azimuth = 0f; if (event.sensor.getType() == Sensor.TYPE

Compass readings on SGS III

穿精又带淫゛_ 提交于 2019-11-28 06:47:57
问题 My app needs to show the current bearing of the device using its compass. The code I'm using (below) works perfectly fine on my Galaxy Nexus and Galaxy One, but the compass is spinning around wildly on a Samsung Galaxy S III. I've tried doing a figure-8 to recalibrate the device, but that doesn't change anything. The weird thing is that other compass apps downloaded from Google Play work just fine on the SIII. What could be the issue here? float[] mGravity; float[] mGeomagnetic; public void

How do I get the correct bearing (magnetic orientation) regardless of screen orientation?

帅比萌擦擦* 提交于 2019-11-27 02:27:47
问题 I want to get the current magnetic orientation regardless of the current screen orientation (landscape or portrait). I found this example, but it's not orientation independant, right? And this didn't help me either. I did also read http://android-developers.blogspot.de/2010/09/one-screen-turn-deserves-another.html. This is my current approach with the deprecated way I don't want to use (short): mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION); private SensorEventListener