Skip to content

Commit 5bcf8d9

Browse files
committed
use the SDK path stored in the preferences
1 parent fd0120f commit 5bcf8d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/processing/mode/android/SysImageDownloader.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import org.xml.sax.SAXException;
2929

3030
import processing.app.Platform;
31+
import processing.app.Preferences;
3132
import processing.app.ui.Toolkit;
3233
import processing.core.PApplet;
3334

@@ -96,8 +97,10 @@ class DownloadTask extends SwingWorker<Object, Object> {
9697
protected Object doInBackground() throws Exception {
9798
result = false;
9899

99-
File modeFolder = mode.getFolder();
100-
File sdkFolder = new File(modeFolder, "sdk");
100+
// The SDK should already be detected by the android mode
101+
String sdkPrefsPath = Preferences.get("android.sdk.path");
102+
File sdkFolder = new File(sdkPrefsPath);
103+
File modeFolder = mode.getFolder();
101104
if (!sdkFolder.exists()) {
102105
throw new IOException("SDK folder does not exist " + sdkFolder.getAbsolutePath());
103106
}
@@ -127,7 +130,7 @@ protected Object doInBackground() throws Exception {
127130
downloadAndUnpack(downloadUrls.sysImgWearUrl, downloadedSysImgWear, sysImgWearFinalFolder, false);
128131
fixSourceProperties(sysImgWearFinalFolder);
129132
} else {
130-
// default system images
133+
// mobile system images
131134
File downloadedSysImg = new File(tempFolder, downloadUrls.sysImgFilename);
132135
File tmp = new File(sysImgFolder, "android-" + AndroidBuild.target_sdk);
133136
if (!tmp.exists()) tmp.mkdir();

0 commit comments

Comments
 (0)