Skip to content

Commit 0bc2e9f

Browse files
committed
updated messages, added welcome message, removed debug printouts
1 parent 687eebd commit 0bc2e9f

File tree

3 files changed

+30
-10
lines changed

3 files changed

+30
-10
lines changed

src/processing/mode/android/AVD.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,12 +345,12 @@ protected void getImages(final ArrayList<String> images, final AndroidSDK sdk,
345345
output.addTarget(new LineProcessor() {
346346
@Override
347347
public void processLine(String line) {
348-
System.out.println("dummy output ---> " + line);
348+
// System.out.println("dummy output ---> " + line);
349349
if (images != null &&
350350
line.contains(";" + imagePlatform) &&
351351
line.contains(";" + imageTag) &&
352352
line.contains(";" + imageAbi)) {
353-
System.out.println(" added image!");
353+
// System.out.println(" added image!");
354354
images.add(line);
355355
}
356356
}

src/processing/mode/android/AndroidSDK.java

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,28 @@ class AndroidSDK {
133133

134134
private static final String PROCESSING_FOR_ANDROID_URL =
135135
"http://android.processing.org/";
136-
136+
137+
private static final String WHATS_NEW_URL =
138+
"http://android.processing.org/whatsnew.html";
139+
137140
private static final String DRIVER_INSTALL_URL =
138141
"https://developer.android.com/studio/run/oem-usb.html#InstallingDriver";
139142

140143
private static final String SDK_INSTALL_MESSAGE =
141144
"Processing just downloaded and installed the Android SDK succesfully. " +
142145
"The Android mode is now ready to use!<br><br>" +
143-
"For more information (reference, examples, and tutorials) " +
144-
"visit the <a href=\"" + PROCESSING_FOR_ANDROID_URL + "\">Processing for Android website</a>";
146+
"For documentation, examples, and tutorials, " +
147+
"visit the <a href=\"" + PROCESSING_FOR_ANDROID_URL + "\">Processing for Android website</a>, and " +
148+
"if you updated from version 3 of the mode, check the <a href=\"" + WHATS_NEW_URL + "\">what's new page</a>.";
149+
150+
private static final String SDK_EXISTS_TITLE = "SDK configured!";
151+
152+
private static final String SDK_EXISTS_MESSAGE =
153+
"Processing will use the existing Android SDK. " +
154+
"The Android mode is now ready to use!<br><br>" +
155+
"For documentation, examples, and tutorials, " +
156+
"visit the <a href=\"" + PROCESSING_FOR_ANDROID_URL + "\">Processing for Android website</a>, and " +
157+
"if you updated from version 3 of the mode, check the <a href=\"" + WHATS_NEW_URL + "\">what's new page</a>.";
145158

146159
private static final String DRIVER_INSTALL_MESSAGE = "<br><br>" +
147160
"If you are planning to use Google Nexus devices, then you need the " +
@@ -414,6 +427,13 @@ public static AndroidSDK load(boolean checkEnvSDK, Frame editor) throws IOExcept
414427
// gets knocked out later. For instance, by that pesky Eclipse,
415428
// which nukes all env variables when launching from the IDE.
416429
Preferences.set("android.sdk.path", sdkEnvPath);
430+
431+
// If we are here, it means that there was no SDK path in the preferences
432+
// and the user wants to use the SDK found in the environment. This
433+
// means we just installed the mode for the first time, so we show a
434+
// welcome message with some useful info.
435+
AndroidUtil.showMessage(SDK_EXISTS_TITLE, SDK_EXISTS_MESSAGE);
436+
417437
return androidSDK;
418438
} catch (final BadSDKException badEnv) {
419439
Preferences.unset("android.sdk.path");

src/processing/mode/android/SysImageDownloader.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public class SysImageDownloader extends JDialog implements PropertyChangeListene
7474
"You chose to run x86 images in the emulator. This is great but you need " +
7575
"to install the Intel Hardware Accelerated Execution Manager (Intel HAXM).<br><br>" +
7676
"Processing will try to run the HAXM installer now, which may ask for your " +
77-
"administrator password or additional permissions. Good luck!";
77+
"administrator password or additional permissions.";
7878

7979
private static final String KVM_LINUX_GUIDE_URL =
8080
"https://developer.android.com/studio/run/emulator-acceleration.html#vm-linux";
@@ -83,7 +83,7 @@ public class SysImageDownloader extends JDialog implements PropertyChangeListene
8383
"You chose to run x86 images in the emulator. This is great but you need " +
8484
"to configure VM acceleration on Linux using the KVM package.<br><br>" +
8585
"Follow <a href=\"" + KVM_LINUX_GUIDE_URL + "\">these instructions</a> " +
86-
"to configure KVM. Good luck!";
86+
"to configure KVM.";
8787

8888
private static final String IA32LIBS_TITLE = "Additional setup may be required...";
8989
private static final String IA32LIBS_MESSAGE =
@@ -386,7 +386,7 @@ public void hyperlinkUpdate(HyperlinkEvent e) {
386386
pane.setBackground(label.getBackground());
387387

388388
String[] options = new String[] {
389-
"Slow but safe", "I like speed!"
389+
"Use x86 image", "Use ARM image"
390390
};
391391
int result = JOptionPane.showOptionDialog(null, pane, title,
392392
JOptionPane.DEFAULT_OPTION, JOptionPane.QUESTION_MESSAGE,
@@ -417,10 +417,10 @@ public void run() {
417417
// In this case, we give the user the option to choose between ARM and x86
418418
final int result = showSysImageMessage();
419419
if (result == JOptionPane.YES_OPTION || result == JOptionPane.CLOSED_OPTION) {
420-
abi = "arm";
421-
} else {
422420
abi = "x86";
423421
installHAXM();
422+
} else {
423+
abi = "arm";
424424
}
425425
Preferences.set("android.emulator.image.abi", abi);
426426
}

0 commit comments

Comments
 (0)