From b2133ff8606f68e45857faac2b4aebe0c515553c Mon Sep 17 00:00:00 2001 From: Rupesh Kumar <46577873+rupeshkumar22@users.noreply.github.com> Date: Sat, 6 Aug 2022 04:21:29 +0530 Subject: [PATCH 1/4] Added Emu Progress Strings in mode.properties --- mode/languages/mode.properties | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 1ba72378b7ec5c492d9db87d0f2c1b12dbceb3f7 Mon Sep 17 00:00:00 2001 From: Rupesh Kumar <46577873+rupeshkumar22@users.noreply.github.com> Date: Sat, 6 Aug 2022 04:23:35 +0530 Subject: [PATCH 2/4] Update AndroidMode.java --- mode/src/processing/mode/android/AndroidMode.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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()); From 921a93e97c9e5b61dc926e5c1ddbe00de4133803 Mon Sep 17 00:00:00 2001 From: Rupesh Kumar <46577873+rupeshkumar22@users.noreply.github.com> Date: Sat, 6 Aug 2022 04:26:19 +0530 Subject: [PATCH 3/4] Resolves Issue[#702] --- mode/src/processing/mode/android/AndroidEditor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); From a92de0d238959c48a8da50e29ae5ae4a06c941e6 Mon Sep 17 00:00:00 2001 From: Rupesh Kumar <46577873+rupeshkumar22@users.noreply.github.com> Date: Sat, 6 Aug 2022 04:27:23 +0530 Subject: [PATCH 4/4] Update RedirectStreamHandler.java --- .../processing/mode/android/RedirectStreamHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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()); } } }