if
(m_acc_data !=
null
&& m_mag_data !=
null
) {
SensorManager.getRotationMatrix(m_rotation,
null
, m_acc_data, m_mag_data);
SensorManager.getOrientation(m_rotation, m_result_data);
String str;
m_result_data[
0
] = (
float
)Math.toDegrees(m_result_data[
0
]);
if
(m_result_data[
0
] <
0
) m_result_data[
0
] +=
360
;
str =
"azimuth(z) : "
+ (
int
)m_result_data[
0
];
m_result_view[
0
].setText(str);
str =
"pitch(x) : "
+ (
int
)Math.toDegrees(m_result_data[
1
]);
m_result_view[
1
].setText(str);
str =
"roll(y) : "
+ (
int
)Math.toDegrees(m_result_data[
2
]);
m_result_view[
2
].setText(str);
if
(m_result_data[
2
]>
20
)
{
Toast.makeText(
this
,
"This activity ends."
, Toast.LENGTH_SHORT).show();
String message =
"S"
;
BluetoothChat.sendMessage(message);
}
m_check_count++;
str =
"호출 횟수 : "
+ m_check_count +
" 회"
;
m_check_view.setText(str);
}
}
}