From 515a4c4fd1c6cc3a033c137f806d310ab7bdfda4 Mon Sep 17 00:00:00 2001 From: James Cotton Date: Sat, 19 Mar 2011 20:00:12 -0500 Subject: [PATCH] Start of a widget for monitoring telemetry status --- androidgcs/AndroidManifest.xml | 43 +++++++++++++------ androidgcs/res/layout/telemetry_widget.xml | 7 +++ .../openpilot/androidgcs/TelemetryWidget.java | 31 +++++++++++++ 3 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 androidgcs/res/layout/telemetry_widget.xml create mode 100644 androidgcs/src/org/openpilot/androidgcs/TelemetryWidget.java diff --git a/androidgcs/AndroidManifest.xml b/androidgcs/AndroidManifest.xml index 6c89f2632..9a3d1dd25 100644 --- a/androidgcs/AndroidManifest.xml +++ b/androidgcs/AndroidManifest.xml @@ -1,23 +1,38 @@ - + package="org.openpilot.androidgcs" android:versionCode="1" + android:versionName="1.0"> + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/androidgcs/res/layout/telemetry_widget.xml b/androidgcs/res/layout/telemetry_widget.xml new file mode 100644 index 000000000..6af378104 --- /dev/null +++ b/androidgcs/res/layout/telemetry_widget.xml @@ -0,0 +1,7 @@ + + + + diff --git a/androidgcs/src/org/openpilot/androidgcs/TelemetryWidget.java b/androidgcs/src/org/openpilot/androidgcs/TelemetryWidget.java new file mode 100644 index 000000000..90ab80899 --- /dev/null +++ b/androidgcs/src/org/openpilot/androidgcs/TelemetryWidget.java @@ -0,0 +1,31 @@ +package org.openpilot.androidgcs; + +import android.appwidget.AppWidgetManager; +import android.appwidget.AppWidgetProvider; +import android.content.Context; +import android.content.Intent; +import android.os.Bundle; +import android.widget.RemoteViews; + +public class TelemetryWidget extends AppWidgetProvider { + + private static boolean connected = false; + + public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { + final int N = appWidgetIds.length; + + // Perform this loop procedure for each App Widget that belongs to this provider + for (int i=0; i