Demonstrate using AltosLib from altosdroid
authorKeith Packard <keithp@keithp.com>
Thu, 23 Feb 2012 03:37:24 +0000 (16:37 +1300)
committerKeith Packard <keithp@keithp.com>
Sun, 3 Jun 2012 02:39:55 +0000 (19:39 -0700)
Get things hooked up so that we can use AltosLib functions from the
android application; it's a bit of a hack at present, but appears to
work. Some more 'official' technique would be nice...

Signed-off-by: Keith Packard <keithp@keithp.com>
altosdroid/.classpath
altosdroid/Makefile.am
altosdroid/local.properties.in
altosdroid/src/org/altusmetrum/AltosDroid/AltosDroid.java

index 6efcbb739a404c19ea33d343ff7c6c9514756163..d260cafa9fa7daecc06482f74eba146785e19742 100644 (file)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
        <classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/>
+       <classpathentry kind="lib" path="lib/AltosLib.jar"/>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="src" path="gen"/>
        <classpathentry kind="output" path="bin"/>
index 2c6ffc2ceb73b863d2a5c4e221795ecb10aa0974..557a572208fc4e8d961fd6a4a74d57a4a8c688ad 100644 (file)
@@ -23,6 +23,12 @@ SRC=\
 
 all: $(all_target)
 
+ALTOSLIB=bin/classes/AltosLib.jar
+
+$(ALTOSLIB):
+       mkdir -p bin/classes
+       cd bin/classes && ln -s ../../../altoslib/AltosLib.jar .
+
 if ANDROID
 install-release: bin/AltosDroid-release.apk
        $(ADB) install -r bin/AltosDroid-release.apk
@@ -30,10 +36,10 @@ install-release: bin/AltosDroid-release.apk
 install-debug: bin/AltosDroid-debug.apk
        $(ADB) install -r bin/AltosDroid-debug.apk
 
-bin/AltosDroid-debug.apk: $(SRC)
+bin/AltosDroid-debug.apk: $(SRC) $(ALTOSLIB)
        ant debug
 
-bin/AltosDroid-release.apk: $(SRC)
+bin/AltosDroid-release.apk: $(SRC) $(ALTOSLIB)
        ant release
 endif
 
index 14df0494361de26fac8c85bb7f9815ae951443f6..543ce2081e565c9bbbcfb1f1c63bb21a569cb1c1 100644 (file)
@@ -8,3 +8,4 @@
 # For customization when using a Version Control System, please read the
 # header note.
 sdk.dir=@ANDROID_SDK@
+extensible.libs.classpath=../altoslib
index 844ca39ee21a2c29c7e36cb9a5d6306d05bfdb65..87f89cf9b76317e610309644e80ec6bebc762b4d 100644 (file)
@@ -39,6 +39,7 @@ import android.widget.ListView;
 import android.widget.TextView;
 import android.widget.Toast;
 import org.altusmetrum.AltosDroid.R;
+import org.altusmetrum.AltosLib.*;
 
 /**
  * This is the main Activity that displays the current chat session.
@@ -48,6 +49,8 @@ public class AltosDroid extends Activity {
     private static final String TAG = "BluetoothChat";
     private static final boolean D = true;
 
+    private static final AltosLine q = new AltosLine();
+
     // Message types sent from the BluetoothChatService Handler
     public static final int MESSAGE_STATE_CHANGE = 1;
     public static final int MESSAGE_READ = 2;