|
1 | 1 | package processing.mode.android;
|
2 | 2 |
|
3 | 3 | import processing.app.Base;
|
| 4 | +import processing.app.Preferences; |
4 | 5 | import processing.app.exec.ProcessHelper;
|
5 | 6 | import processing.app.exec.ProcessResult;
|
6 | 7 | import processing.core.PApplet;
|
@@ -43,21 +44,26 @@ public class AVD {
|
43 | 44 |
|
44 | 45 | /** "android-7" or "Google Inc.:Google APIs:7" */
|
45 | 46 | protected String target;
|
| 47 | + |
| 48 | + /** x86, x86_64 or armeabi-v7a **/ |
| 49 | + protected String abi; |
| 50 | + |
| 51 | + public static final String PREF_KEY_ABI = "android.sdk.abi"; |
| 52 | + public static final String[] ABI = {"armeabi-v7a", "x86", "x86_64"}; |
46 | 53 |
|
47 | 54 | /** Default virtual device used by Processing. */
|
48 |
| - static public final AVD defaultAVD = |
49 |
| - new AVD("Processing-0" + Base.getRevision(), |
50 |
| - "android-" + AndroidBuild.sdkVersion); |
| 55 | + static public AVD defaultAVD; |
51 | 56 | // "Google Inc.:Google APIs:" + AndroidBuild.sdkVersion);
|
52 | 57 |
|
53 | 58 | static ArrayList<String> avdList;
|
54 | 59 | static ArrayList<String> badList;
|
55 | 60 | // static ArrayList<String> skinList;
|
56 | 61 |
|
57 | 62 |
|
58 |
| - public AVD(final String name, final String target) { |
| 63 | + public AVD(String name, String target, String abi) { |
59 | 64 | this.name = name;
|
60 | 65 | this.target = target;
|
| 66 | + this.abi = abi; |
61 | 67 | }
|
62 | 68 |
|
63 | 69 |
|
@@ -138,12 +144,11 @@ protected boolean create(final AndroidSDK sdk) throws IOException {
|
138 | 144 | "-t", target,
|
139 | 145 | "-c", DEFAULT_SDCARD_SIZE,
|
140 | 146 | "-s", DEFAULT_SKIN,
|
141 |
| - "--abi", "armeabi" |
| 147 | + "--abi", abi |
142 | 148 | };
|
143 | 149 |
|
144 | 150 | // Set the list to null so that exists() will check again
|
145 | 151 | avdList = null;
|
146 |
| - |
147 | 152 | final ProcessHelper p = new ProcessHelper(params);
|
148 | 153 | try {
|
149 | 154 | // Passes 'no' to "Do you wish to create a custom hardware profile [no]"
|
@@ -171,8 +176,10 @@ protected boolean create(final AndroidSDK sdk) throws IOException {
|
171 | 176 | }
|
172 | 177 |
|
173 | 178 |
|
174 |
| - static public boolean ensureProperAVD(final AndroidSDK sdk) { |
| 179 | + static public boolean ensureProperAVD(final AndroidSDK sdk, final String abi) { |
175 | 180 | try {
|
| 181 | + defaultAVD = new AVD("Processing-0" + Base.getRevision(), |
| 182 | + "android-" + AndroidBuild.sdkVersion, abi); |
176 | 183 | if (defaultAVD.exists(sdk)) {
|
177 | 184 | // System.out.println("the avd exists");
|
178 | 185 | return true;
|
|
0 commit comments