Browse Source

SDK: Update creation of MainActivity and AndroidManifest to support jME 3.1
Add screen orientation to manifest and update the min version to 9.
Update MainActivity creation to remove references to properties removed from AndroidHarness.

iwgeric 10 years ago
parent
commit
d8dc4a67bc
1 changed files with 10 additions and 19 deletions
  1. 10 19
      jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java

+ 10 - 19
jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java

@@ -299,17 +299,15 @@ public class AndroidSdkTool {
                         changed = true;
                         changed = true;
                     }
                     }
                 }
                 }
-                // add the following after AndroidHarness.screenOrientation is depreciated
-                //   for jME 3.1
-//                if (sdkActivity != null) {
-//                    if (sdkActivity.hasAttribute("android:screenOrientation")) {
-//                        String attrScreenOrientation = sdkActivity.getAttribute("android:screenOrientation");
-//                    } else {
-//                        Logger.getLogger(AndroidSdkTool.class.getName()).log(Level.INFO, "creating attrScreenOrientation");
-//                        sdkActivity.setAttribute("android:screenOrientation", "landscape");
-//                        changed = true;
-//                    }
-//                }
+                if (sdkActivity != null) {
+                    if (sdkActivity.hasAttribute("android:screenOrientation")) {
+                        String attrScreenOrientation = sdkActivity.getAttribute("android:screenOrientation");
+                    } else {
+                        Logger.getLogger(AndroidSdkTool.class.getName()).log(Level.INFO, "creating attrScreenOrientation");
+                        sdkActivity.setAttribute("android:screenOrientation", "landscape");
+                        changed = true;
+                    }
+                }
             }
             }
 
 
             Element sdkElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "uses-sdk");
             Element sdkElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "uses-sdk");
@@ -319,7 +317,7 @@ public class AndroidSdkTool {
                 changed = true;
                 changed = true;
             }
             }
             if (!"8".equals(sdkElement.getAttribute("android:minSdkVersion"))) {
             if (!"8".equals(sdkElement.getAttribute("android:minSdkVersion"))) {
-                sdkElement.setAttribute("android:minSdkVersion", "8");
+                sdkElement.setAttribute("android:minSdkVersion", "9");
                 changed = true;
                 changed = true;
             }
             }
             Element screensElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "supports-screens");
             Element screensElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "supports-screens");
@@ -419,7 +417,6 @@ public class AndroidSdkTool {
                 + " \n"
                 + " \n"
                 + "import android.content.pm.ActivityInfo;\n"
                 + "import android.content.pm.ActivityInfo;\n"
                 + "import com.jme3.app.AndroidHarness;\n"
                 + "import com.jme3.app.AndroidHarness;\n"
-                + "import com.jme3.system.android.AndroidConfigChooser.ConfigType;\n"
                 + "import java.util.logging.Level;\n"
                 + "import java.util.logging.Level;\n"
                 + "import java.util.logging.LogManager;\n"
                 + "import java.util.logging.LogManager;\n"
                 + " \n"
                 + " \n"
@@ -435,15 +432,9 @@ public class AndroidSdkTool {
                 + "    public MainActivity(){\n"
                 + "    public MainActivity(){\n"
                 + "        // Set the application class to run\n"
                 + "        // Set the application class to run\n"
                 + "        appClass = \"" + mainClass + "\";\n"
                 + "        appClass = \"" + mainClass + "\";\n"
-                + "        // Try ConfigType.FASTEST; or ConfigType.LEGACY if you have problems\n"
-                + "        eglConfigType = ConfigType.BEST;\n"
                 + "        // Exit Dialog title & message\n"
                 + "        // Exit Dialog title & message\n"
                 + "        exitDialogTitle = \"Exit?\";\n"
                 + "        exitDialogTitle = \"Exit?\";\n"
                 + "        exitDialogMessage = \"Press Yes\";\n"
                 + "        exitDialogMessage = \"Press Yes\";\n"
-                + "        // Enable verbose logging\n"
-                + "        eglConfigVerboseLogging = false;\n"
-                + "        // Choose screen orientation\n"
-                + "        screenOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE;\n"
                 + "        // Enable MouseEvents being generated from TouchEvents (default = true)\n"
                 + "        // Enable MouseEvents being generated from TouchEvents (default = true)\n"
                 + "        mouseEventsEnabled = true;\n"
                 + "        mouseEventsEnabled = true;\n"
                 + "        // Set the default logging level (default=Level.INFO, Level.ALL=All Debug Info)\n"
                 + "        // Set the default logging level (default=Level.INFO, Level.ALL=All Debug Info)\n"