Back to project page diceplus_test.
The source code is released under:
This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a co...
If you think the Android project diceplus_test listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.example.dice_test2; // w w w .j a v a 2 s .c om import android.util.Log; import us.dicepl.android.sdk.Die; import us.dicepl.android.sdk.responsedata.MagnetometerData; public class MagnetometerReadoutHandler extends DiceEventHandler { public static void onMagnetometerReadout(Die die, MagnetometerData readout, Exception exception, MainActivity _mainActivity) { final MainActivity mainActivity = _mainActivity; final long timestamp = readout.timestamp; final int x = readout.x; final int y = readout.y; final int z = readout.z; Log.d(TAG, "magnetometerstuff"); mainActivity.runOnUiThread(new Runnable() { @Override public void run() { mainActivity.magnetometerData.setText("Magnetometer: ts: " + timestamp + ", x: " + x + ", y: " + y + ", z: " + z); } }); } }