*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
// Service
private boolean mIsBound = false;
private Messenger mService = null;
final Messenger mMessenger = new Messenger(new IncomingHandler(this));
// Service
private boolean mIsBound = false;
private Messenger mService = null;
final Messenger mMessenger = new Messenger(new IncomingHandler(this));
ad.mTitle.append(str);
Toast.makeText(ad.getApplicationContext(), "Connected to " + str, Toast.LENGTH_SHORT).show();
ad.mAltosVoice.speak("Connected");
ad.mTitle.append(str);
Toast.makeText(ad.getApplicationContext(), "Connected to " + str, Toast.LENGTH_SHORT).show();
ad.mAltosVoice.speak("Connected");
void doBindService() {
bindService(new Intent(this, TelemetryService.class), mConnection, Context.BIND_AUTO_CREATE);
mIsBound = true;
void doBindService() {
bindService(new Intent(this, TelemetryService.class), mConnection, Context.BIND_AUTO_CREATE);
mIsBound = true;
void update_ui(AltosState state) {
mCallsignView.setText(state.data.callsign);
mRSSIView.setText(String.format("%d", state.data.rssi));
mSerialView.setText(String.format("%d", state.data.serial));
mFlightView.setText(String.format("%d", state.data.flight));
mStateView.setText(state.data.state());
void update_ui(AltosState state) {
mCallsignView.setText(state.data.callsign);
mRSSIView.setText(String.format("%d", state.data.rssi));
mSerialView.setText(String.format("%d", state.data.serial));
mFlightView.setText(String.format("%d", state.data.flight));
mStateView.setText(state.data.state());
- double speed = state.speed;
- if (!state.ascent)
- speed = state.baro_speed;
- mSpeedView.setText(String.format("%6.0f m/s", speed));
+ mSpeedView.setText(String.format("%6.0f m/s", state.speed()));
mAccelView.setText(String.format("%6.0f m/s²", state.acceleration));
mRangeView.setText(String.format("%6.0f m", state.range));
mHeightView.setText(String.format("%6.0f m", state.height));
mAccelView.setText(String.format("%6.0f m/s²", state.acceleration));
mRangeView.setText(String.format("%6.0f m", state.range));
mHeightView.setText(String.format("%6.0f m", state.height));
setContentView(R.layout.altosdroid);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
setContentView(R.layout.altosdroid);
getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title);
- // Set up the temporary Text View
- mTextView = (TextView) findViewById(R.id.text);
- mTextView.setMovementMethod(new ScrollingMovementMethod());
- mTextView.setClickable(false);
- mTextView.setLongClickable(false);
+ // Display the Version
+ mVersion = (TextView) findViewById(R.id.version);
+ mVersion.setText("Version: " + BuildInfo.version +
+ " Built: " + BuildInfo.builddate + " " + BuildInfo.buildtime + " " + BuildInfo.buildtz +
+ " (" + BuildInfo.branch + "-" + BuildInfo.commitnum + "-" + BuildInfo.commithash + ")");
mCallsignView = (TextView) findViewById(R.id.callsign_value);
mRSSIView = (TextView) findViewById(R.id.rssi_value);
mCallsignView = (TextView) findViewById(R.id.callsign_value);
mRSSIView = (TextView) findViewById(R.id.rssi_value);
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(D) Log.d(TAG, "onActivityResult " + resultCode);
switch (requestCode) {
public void onActivityResult(int requestCode, int resultCode, Intent data) {
if(D) Log.d(TAG, "onActivityResult " + resultCode);
switch (requestCode) {