diff --git a/mode/languages/mode.properties b/mode/languages/mode.properties index 867b8b78..4b2ecf6c 100644 --- a/mode/languages/mode.properties +++ b/mode/languages/mode.properties @@ -108,12 +108,15 @@ android_mode.warn.cannot_load_sdk_title = Bad news... android_mode.warn.cannot_load_sdk_body = The Android SDK could not be loaded.\nThe Android Mode will be disabled. android_mode.info.cannot_open_sdk_path = "Android SDK path couldn't be opened."; android_mode.error.cannot_create_avd = "Could not create a virtual device for the emulator."; +android_mode.error.emulator_installation_failed = "Encountered Issues with the emulator installation. Result Code is non-zero"; android_mode.dialog.no_devices_found_title = No devices found! android_mode.dialog.no_devices_found_body = Processing did not find any device where to run\nyour sketch on. Make sure that your handheld or\nwearable is properly connected to the computer\nand that USB or Bluetooth debugging is enabled. android_mode.status.no_devices_found = No devices found. android_mode.status.starting_project_build = Starting build... android_mode.status.building_project = Building Android project... android_mode.status.project_build_failed = Build failed. +android_mode.status.downloading_emulator = Downloading Emulator... +android_mode.status.downloading_emulator_successful = Emulator installation was successful. # --------------------------------------- # Android Preprocessor @@ -256,7 +259,7 @@ keystore_manager.country_code_label = Country code (XX): # Manifest manifest.warn.cannot_handle_file_title = Error handling %s -manifest.warn.cannot_handle_file_body = Errors occurred while reading or writing %s\nwhich means lots of things are likely to stop working properly.\nTo prevent losing any data, it's recommended that you use “Save As”\n"to save a separate copy of your sketch, and then restart Processing."; +manifest.warn.cannot_handle_file_body = Errors occurred while reading or writing %s\nwhich means lots of things are likely to stop working properly.\nTo prevent losing any data, it's recommended that you use “Save As”\n"to save a separate copy of your sketch, and then restart Processing."; # --------------------------------------- # Permissions diff --git a/mode/src/processing/mode/android/AndroidEditor.java b/mode/src/processing/mode/android/AndroidEditor.java index ba55227f..bf6c6c64 100644 --- a/mode/src/processing/mode/android/AndroidEditor.java +++ b/mode/src/processing/mode/android/AndroidEditor.java @@ -124,7 +124,7 @@ public boolean handleSaveAs() { public JMenu buildFileMenu() { String exportPackageTitle = AndroidToolbar.getTitle(AndroidToolbar.EXPORT_PACKAGE); - JMenuItem exportPackage = Toolkit.newJMenuItemExt(exportPackageTitle); + JMenuItem exportPackage = Toolkit.newJMenuItemShift(exportPackageTitle,'T'); exportPackage.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { handleExportPackage(); diff --git a/mode/src/processing/mode/android/AndroidMode.java b/mode/src/processing/mode/android/AndroidMode.java index 8b3b8686..b456bfc6 100644 --- a/mode/src/processing/mode/android/AndroidMode.java +++ b/mode/src/processing/mode/android/AndroidMode.java @@ -241,8 +241,16 @@ public void handleRunEmulator(Sketch sketch, AndroidEditor editor, build.build("debug", ""); if (sdk.getEmulatorTool() == null) { - System.out.println("Try to download the emulator using the SDK Manager..."); - sdk.downloadEmuOnDemand(); + // System.out.println("Try to download the emulator using the SDK Manager..."); + listener.statusNotice(AndroidMode.getTextString("android_mode.status.downloading_emulator")); + boolean emulatorInstallationSucceded = sdk.downloadEmuOnDemand(); + if (!emulatorInstallationSucceded) { + SketchException emulatorInstallationErrorException = new SketchException(AndroidMode.getTextString("android_mode.error.emulator_installation_failed")); + emulatorInstallationErrorException.hideStackTrace(); + throw emulatorInstallationErrorException; + } else { + System.out.println(AndroidMode.getTextString("android_mode.status.downloading_emulator_successful")); + } } boolean avd = AVD.ensureProperAVD(editor, this, sdk, build.isWear()); diff --git a/mode/src/processing/mode/android/RedirectStreamHandler.java b/mode/src/processing/mode/android/RedirectStreamHandler.java index cb784a5f..93366910 100644 --- a/mode/src/processing/mode/android/RedirectStreamHandler.java +++ b/mode/src/processing/mode/android/RedirectStreamHandler.java @@ -8,7 +8,7 @@ public class RedirectStreamHandler extends Thread { - // Streams to redirect from and to + // Streams Redirection- from and to private final InputStream input; private final PrintWriter output; @@ -24,11 +24,11 @@ public void run() { BufferedReader reader = new BufferedReader(new InputStreamReader(input)); String line; while ((line = reader.readLine()) != null) { + // print to output line by line output.println(line); } - } catch (IOException ioe) { - // OK to ignore... - System.out.println("Level.WARNING____I/O Redirection failure: "+ ioe.toString()); + } catch (IOException ioException) { + System.out.println("I/O Redirection failure: "+ ioException.toString()); } } }