Skip to content

Commit 65074d3

Browse files
committed
2 parents 0fc715f + 8cd565d commit 65074d3

File tree

3 files changed

+21
-7
lines changed

3 files changed

+21
-7
lines changed

mode.properties

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ url = https://github.com/processing/processing-android
44
sentence = Create projects with Processing for Android devices
55
paragraph = This version of the Android Mode is for Processing 3.0b4+
66
imports=processing.mode.java.JavaMode
7-
version = 241
8-
prettyVersion = 3.0-alpha3
9-
minRevision = 242
7+
version = 242
8+
prettyVersion = 3.0-alpha4
9+
minRevision = 243
1010
maxRevision = 0

src/processing/mode/android/Manifest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ public void setPackageName(String packageName) {
9393

9494
public void setSdkTarget(String version) {
9595
XML usesSdk = xml.getChild("uses-sdk");
96-
usesSdk.setString("android:minSdkVersion", version);
96+
usesSdk.setString("android:minSdkVersion", "15");
97+
usesSdk.setString("android:targetSdkVersion", version);
9798
save();
9899
}
99100

src/processing/mode/android/SDKDownloader.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
import java.beans.PropertyChangeEvent;
2424
import java.beans.PropertyChangeListener;
2525
import java.io.*;
26+
import java.net.MalformedURLException;
2627
import java.net.URL;
2728
import java.net.URLConnection;
2829
import java.util.Enumeration;
@@ -32,11 +33,11 @@
3233
@SuppressWarnings("serial")
3334
public class SDKDownloader extends JFrame implements PropertyChangeListener {
3435

35-
private static final String URL_REPOSITORY = "https://dl-ssl.google.com/android/repository/repository-10.xml";
36+
private static final String URL_REPOSITORY = "https://dl-ssl.google.com/android/repository/repository-11.xml";
3637
private static final String URL_REPOSITORY_FOLDER = "http://dl-ssl.google.com/android/repository/";
3738
private static final String URL_USB_DRIVER = "https://dl-ssl.google.com//android/repository/latest_usb_driver_windows.zip";
3839

39-
private static final String PLATFORM_API_LEVEL = "10";
40+
private static final String PLATFORM_API_LEVEL = "22";
4041

4142
public static final String PROPERTY_CHANGE_EVENT_TOTAL = "total";
4243
private static final String PROPERTY_CHANGE_EVENT_DOWNLOADED = "downloaded";
@@ -135,7 +136,19 @@ protected void done() {
135136

136137
private void downloadAndUnpack(String urlString, File saveTo,
137138
File unpackTo) throws IOException {
138-
URL url = new URL(urlString);
139+
URL url = null;
140+
try {
141+
url = new URL(urlString);
142+
} catch (MalformedURLException e) {
143+
//This is expected for API level 14 and more
144+
try {
145+
url = new URL(URL_REPOSITORY_FOLDER + urlString);
146+
} catch (MalformedURLException e1) {
147+
//This exception is not expected. Need to return.
148+
e1.printStackTrace();
149+
return;
150+
}
151+
}
139152
URLConnection conn = url.openConnection();
140153

141154
InputStream inputStream = conn.getInputStream();

0 commit comments

Comments
 (0)