diff --git a/android/todo.txt b/android/todo.txt index cdee71fb2..4be65d6a9 100644 --- a/android/todo.txt +++ b/android/todo.txt @@ -75,12 +75,24 @@ X prevent adding the opengl library when it's not needed X preprocessor removes the code by before export X added a note to the wiki X implement android menu +X reset option +X permissions +X run the 'android' application (since finding its location is painful) +o remove the need for a "Reset Android" menu option +o might need to just put this in the menu for times when things go weird +o http://dev.processing.org/bugs/show_bug.cgi?id=1392 +o http://code.google.com/p/processing/issues/detail?id=209 earlier X if sketchRenderer() et al are used in android, need to add to desktop X remove processing.opengl.* classes and finish PGraphicsAndroid3D X http://dev.processing.org/bugs/show_bug.cgi?id=1401 +android menu +_ something to bring up the full console window +_ signing tool +_ selection of which avd (emulator), or plugged-in devices (if multiple) + _ throw an error if a file in the 'data' dir ends with .gz P1 _ exceptions with StreamPump and adb devices on osx and linux @@ -257,12 +269,6 @@ W/System.err( 242): at android.app.ApplicationContext.openFileOutput(Applicati W/System.err( 242): at android.content.ContextWrapper.openFileOutput(ContextWrapper.java:158) W/System.err( 242): at processing.core.PApplet.createOutput(PApplet.java:3677) -android menu -_ something to bring up the full console window -_ signing tool -_ selection of which avd (emulator), or plugged-in devices (if multiple) -_ run the 'android' application (since finding its location is painful) - P2 _ need to prevent hitting 'run' twice (threaded, so would work) P2 _ currently things just keep restarting the build, bad state P2 _ http://dev.processing.org/bugs/show_bug.cgi?id=1387 @@ -299,11 +305,6 @@ P4 _ don't require android tools to be installed already P4 _ or implement automatic download/install of android tools P4 _ http://dev.processing.org/bugs/show_bug.cgi?id=1383 -P5 _ remove the need for a "Reset Android" menu option -P5 _ might need to just put this in the menu for times when things go weird -P5 _ http://dev.processing.org/bugs/show_bug.cgi?id=1392 - - . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . diff --git a/android/tool/src/processing/app/tools/android/AndroidMode.java b/android/tool/src/processing/app/tools/android/AndroidMode.java index 4179f6978..7087be22a 100644 --- a/android/tool/src/processing/app/tools/android/AndroidMode.java +++ b/android/tool/src/processing/app/tools/android/AndroidMode.java @@ -83,13 +83,12 @@ public class AndroidMode implements DeviceListener { toggleItem = Base.newJCheckBoxMenuItem("Android Mode", 'D'); toggleItem.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { - System.out.println("maybe?"); updateMode(); } }); menu.add(toggleItem); - item = new JMenuItem("Wiki..."); + item = new JMenuItem("Guide"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { Base.openURL("http://wiki.processing.org/w/Android"); @@ -99,7 +98,7 @@ public class AndroidMode implements DeviceListener { menu.addSeparator(); - item = new JMenuItem("Options"); + item = new JMenuItem("Sketch Options"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { //new Permissions(editor); @@ -107,7 +106,7 @@ public class AndroidMode implements DeviceListener { }); menu.add(item); - item = new JMenuItem("Permissions"); + item = new JMenuItem("Sketch Permissions"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new Permissions(editor); @@ -117,7 +116,24 @@ public class AndroidMode implements DeviceListener { menu.addSeparator(); - item = new JMenuItem("Reset"); + item = new JMenuItem("Signing Key Setup"); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + new Keys(editor); + } + }); + menu.add(item); + + item = new JMenuItem("Android SDK & AVD Manager"); + item.addActionListener(new ActionListener() { + public void actionPerformed(ActionEvent e) { + File file = sdk.getAndroidTool(); + PApplet.exec(new String[] { file.getAbsolutePath() }); + } + }); + menu.add(item); + + item = new JMenuItem("Reset Connections"); item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { AndroidEnvironment.killAdbServer(); diff --git a/android/tool/src/processing/app/tools/android/AndroidSDK.java b/android/tool/src/processing/app/tools/android/AndroidSDK.java index c7d016473..193fc4dfd 100644 --- a/android/tool/src/processing/app/tools/android/AndroidSDK.java +++ b/android/tool/src/processing/app/tools/android/AndroidSDK.java @@ -4,6 +4,7 @@ import java.awt.Frame; import java.io.File; import java.io.IOException; import javax.swing.JOptionPane; + import processing.app.Base; import processing.app.Platform; import processing.app.Preferences; @@ -198,7 +199,7 @@ class AndroidSDK { adbCmd = cmd; } // printing this here to see if anyone else is killing the adb server - PApplet.println(adbCmd); + if (AndroidMode.DEBUG) PApplet.println(adbCmd); // try { ProcessResult adbResult = new ProcessHelper(adbCmd).execute(); // Ignore messages about starting up an adb daemon diff --git a/android/tool/src/processing/app/tools/android/Keys.java b/android/tool/src/processing/app/tools/android/Keys.java new file mode 100644 index 000000000..dbb3a183b --- /dev/null +++ b/android/tool/src/processing/app/tools/android/Keys.java @@ -0,0 +1,46 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2010 Ben Fry and Casey Reas + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +package processing.app.tools.android; + +import java.awt.*; +import java.awt.event.*; +import java.util.ArrayList; +import java.util.HashMap; + +import javax.swing.*; +import javax.swing.border.*; +import javax.swing.event.*; + +import processing.app.Base; +import processing.app.Editor; +import processing.app.Preferences; + + +public class Keys extends JFrame { + Editor editor; + + + public Keys(Editor editor) { + this.editor = editor; + setVisible(true); + } +} \ No newline at end of file diff --git a/android/tool/src/processing/app/tools/android/Permissions.java b/android/tool/src/processing/app/tools/android/Permissions.java index 2b28d4cda..55c6a4946 100644 --- a/android/tool/src/processing/app/tools/android/Permissions.java +++ b/android/tool/src/processing/app/tools/android/Permissions.java @@ -1,3 +1,24 @@ +/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */ + +/* + Part of the Processing project - http://processing.org + + Copyright (c) 2010 Ben Fry and Casey Reas + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 + as published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software Foundation, + Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + package processing.app.tools.android; import java.awt.*;