Skip to content

Commit 8138163

Browse files
committed
store target SDK in preferences file
1 parent 9f15853 commit 8138163

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/processing/mode/android/AndroidBuild.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,17 @@ class AndroidBuild extends JavaBuild {
9595
static public final String min_sdk_handheld = "21"; // Lollipop (5.0)
9696
static public final String min_sdk_watchface = "23"; // Marshmallow (6.0)
9797

98-
// Hard-coded target SDK, no longer user-selected.
99-
static public final String target_sdk = "25"; // Nougat (7.1.1)
100-
static public final String target_platform = "android-" + target_sdk;
98+
// Target SDK is stored in the preferences file.
99+
static public String target_sdk;
100+
static public String target_platform;
101+
static {
102+
target_sdk = Preferences.get("android.sdk.target");
103+
if (PApplet.parseInt(target_sdk) < 25) { // Must be Nougat (7.1.1) or higher
104+
target_sdk = "25";
105+
Preferences.set("android.sdk.target", target_sdk);
106+
}
107+
target_platform = "android-" + target_sdk;
108+
}
101109

102110
// Versions of Support, AppCompat, Wear and VR in use
103111
// All of these are hard-coded, as the target_sdk. Should obtained from the

0 commit comments

Comments
 (0)