Commit 86775114 authored by Dave Griffiths's avatar Dave Griffiths
Browse files

version number added, gps change and toast fix, version 1.3

parent 830f56fa
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=""
<application android:label="@string/app_name"
......@@ -516,13 +516,14 @@
(define (drawlist-line colour width points) (list "line" colour width points))
(define (drawlist-text text x y colour size align) (list "text" text x y colour size align))
(define (toast msg) (list "toast" 0 "toast" msg))
(define (toast msg) (list "toast" 0 "toast" msg 30))
(define (toast-size msg size) (list "toast" 0 "toast" msg size))
(define (play-sound wav) (list "play-sound" 0 "play-sound" wav))
(define (vibrate time) (list "vibrate" 0 "vibrate" time))
(define (make-directory name) (list "make-directory" 0 "make-directory" name))
;; treat this like a dialog so the callback fires
(define (list-files name path fn) (list "list-files" 0 "list-files" name fn path))
(define (gps-start name fn) (list "gps-start" 0 "gps-start" name fn))
(define (gps-start name fn min-msecs min-metres) (list "gps-start" 0 "gps-start" name fn min-msecs min-metres))
(define (delayed name delay fn) (list "delayed" 0 "delayed" name fn delay))
(define (network-connect name ssid fn) (list "network-connect" 0 "network-connect" name fn ssid))
(define (http-request name url fn) (list "http-request" 0 "http-request" name fn url))
......@@ -1075,6 +1075,7 @@
(mbutton2 "main-manage" "Manage Packs" (lambda () (list (start-activity "manage-packs" 2 "")))))
(image-view 0 "mongooses" fillwrap)
(text-view (make-id "version") app-version 10 fillwrap)
(mtext "foo" "Your ID")
(edit-text (make-id "main-id-text") "" 30 "text" fillwrap
(lambda (v)
......@@ -1099,7 +1100,8 @@
(set-current! 'location loc)
(list (toast (string-append
(number->string (car loc)) ", "
(number->string (cadr loc)))))))
(number->string (cadr loc))))))
(* 3 60 1000) 5)
(update-widget 'edit-text (get-id "main-id-text") 'text user-id))))
(lambda (activity) '())
(lambda (activity) '())
......@@ -45,6 +45,8 @@ import android.view.Gravity;
import android.view.KeyEvent;
import android.text.TextWatcher;
import android.text.Editable;
import org.json.JSONException;
import org.json.JSONObject;
......@@ -125,12 +127,21 @@ public class starwisp extends StarwispActivity
int year = c.get(Calendar.YEAR);
int timezone_offset_mins = (c.get(Calendar.ZONE_OFFSET) + c.get(Calendar.DST_OFFSET)) / 60000;
String version = "Version not found";
try {
PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
version = pInfo.versionName;
} catch (NameNotFoundException e) {
Log.e("starwisp", "Error getting version " + e.toString());
// pass in a bunch of useful stuff
m_Scheme.eval("(define dirname \"/sdcard/"+dirname+"\")"+
"(define date-day "+day+")"+
"(define date-month "+month+")"+
"(define date-year "+year+")"+
"(define timezone-offset-mins "+timezone_offset_mins+")");
"(define timezone-offset-mins "+timezone_offset_mins+")"+
"(define app-version "+version+")");
Log.i("starwisp","started, now running starwisp.scm...");
m_Scheme.eval(m_Scheme.readRawTextFile(this, "starwisp.scm"));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment