ad.mTitle.setText(R.string.title_connected_to);
ad.mTitle.append(str);
Toast.makeText(ad.getApplicationContext(), "Connected to " + str, Toast.LENGTH_SHORT).show();
+ //TEST!
+ ad.mSerialView.setText(Dumper.dump(ad.mConfigData));
break;
case TelemetryService.STATE_CONNECTING:
ad.mTitle.setText(R.string.title_connecting);
}
break;
case MSG_TELEMETRY:
- //byte[] buf = (byte[]) msg.obj;
- // construct a string from the buffer
- //String telem = new String(buf);
- //ad.mSerialView.append(telem);
+ // TEST!
+ ad.mSerialView.setText(Dumper.dump(msg.obj));
break;
}
}
}
});
- // Start Telemetry Service
- startService(new Intent(AltosDroid.this, TelemetryService.class));
-
- doBindService();
}
@Override
Intent enableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
startActivityForResult(enableIntent, REQUEST_ENABLE_BT);
}
+
+ // Start Telemetry Service
+ startService(new Intent(AltosDroid.this, TelemetryService.class));
+
+ doBindService();
}
@Override
public synchronized void onResume() {
super.onResume();
if(D) Log.e(TAG, "+ ON RESUME +");
-
}
@Override
public void onStop() {
super.onStop();
if(D) Log.e(TAG, "-- ON STOP --");
+
+ doUnbindService();
}
@Override
public void onDestroy() {
super.onDestroy();
-
- doUnbindService();
+ if(D) Log.e(TAG, "--- ON DESTROY ---");
if (tts != null) tts.shutdown();
-
- if(D) Log.e(TAG, "--- ON DESTROY ---");
}