From d9499ce009e01ac13f7109aebe0f64ecbe8089c2 Mon Sep 17 00:00:00 2001 From: benfry Date: Sun, 6 Dec 2009 18:54:51 +0000 Subject: [PATCH] more android tweaks for new sdk, things now working again --- android/todo.txt | 3 ++ .../processing/app/tools/android/Android.java | 31 +++++++++++++++++-- .../processing/app/tools/android/Build.java | 22 +++++++------ todo.txt | 7 +++++ 4 files changed, 51 insertions(+), 12 deletions(-) diff --git a/android/todo.txt b/android/todo.txt index 550c52043..bf6d72c40 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -5,6 +5,9 @@ X why aren't mouse drag events coming through? X http://dev.processing.org/bugs/show_bug.cgi?id=1382 X "taskdef class com.android.ant.SetupTask cannot be found" on Linux X http://dev.processing.org/bugs/show_bug.cgi?id=1407 +X update to r4 of android sdk +X this release will not run on r3 or earlier +X download core.zip from local files P1 this is embarrassing, need to fix ASAP P2 need to fix before beta release diff --git a/app/src/processing/app/tools/android/Android.java b/app/src/processing/app/tools/android/Android.java index a7b2f002a..febfbc998 100644 --- a/app/src/processing/app/tools/android/Android.java +++ b/app/src/processing/app/tools/android/Android.java @@ -65,7 +65,7 @@ public class Android implements Tool { static final String ADB_SOCKET_PORT = "29892"; static final String ANDROID_CORE_URL = - "http://dev.processing.org/android/core.zip"; + "http://dev.processing.org/processing/android/core.zip"; static final String ANDROID_CORE_FILENAME = "processing-android-core.zip"; @@ -195,10 +195,35 @@ public class Android implements Tool { */ return true; } + + + static protected File getCoreZipFile() { + // for debugging only, check to see if this is an svn checkout + File debugFile = new File("../../../android/core.zip"); + if (!debugFile.exists() && Base.isMacOS()) { + // current path might be inside Processing.app, so need to go much higher + debugFile = new File("../../../../../../../android/core.zip"); + } + if (debugFile.exists()) { + System.out.println("Using version of core.zip from local SVN checkout."); + return debugFile; +// } else { +// //System.out.println("no core.zip at " + debugFile.getAbsolutePath()); +// try { +// System.out.println("no core.zip at " + debugFile.getCanonicalPath()); +// } catch (IOException e) { +// e.printStackTrace(); +// } + } + + // otherwise do the usual + return new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME); + } protected boolean checkCore() { - File target = new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME); + //File target = new File(Base.getSketchbookFolder(), ANDROID_CORE_FILENAME); + File target = getCoreZipFile(); if (!target.exists()) { try { URL url = new URL(ANDROID_CORE_URL); @@ -756,7 +781,7 @@ public class Android implements Tool { System.out.println("creating runner"); //System.out.println("editor from Android is " + editor); AndroidRunner ar = new AndroidRunner(editor, editor.getSketch()); - System.out.println("launching vm"); +// System.out.println("launching vm"); return ar.launch(ADB_SOCKET_PORT); //System.out.println("vm launched"); diff --git a/app/src/processing/app/tools/android/Build.java b/app/src/processing/app/tools/android/Build.java index 2f2db272a..e24216d2e 100644 --- a/app/src/processing/app/tools/android/Build.java +++ b/app/src/processing/app/tools/android/Build.java @@ -422,11 +422,16 @@ public class Build { writer.println(" "); writer.println(" "); - writer.println(" "); - writer.println(" "); - writer.println(" "); - writer.println(" "); - writer.println(" "); +// writer.println(" "); +// writer.println(" "); +// writer.println(" "); +// writer.println(" "); +// writer.println(" "); + writer.println(" "); + writer.println(" "); + writer.println(" "); + writer.println(" "); + writer.println(" "); writer.println(" "); writer.println("