소스 검색

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 년 전
부모
커밋
664dfc037c
1개의 변경된 파일10개의 추가작업 그리고 19개의 파일을 삭제
  1. 10 19
      sdk/jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java

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

@@ -299,17 +299,15 @@ public class AndroidSdkTool {
                         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");
@@ -319,7 +317,7 @@ public class AndroidSdkTool {
                 changed = true;
             }
             if (!"8".equals(sdkElement.getAttribute("android:minSdkVersion"))) {
-                sdkElement.setAttribute("android:minSdkVersion", "8");
+                sdkElement.setAttribute("android:minSdkVersion", "9");
                 changed = true;
             }
             Element screensElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "supports-screens");
@@ -419,7 +417,6 @@ public class AndroidSdkTool {
                 + " \n"
                 + "import android.content.pm.ActivityInfo;\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.LogManager;\n"
                 + " \n"
@@ -435,15 +432,9 @@ public class AndroidSdkTool {
                 + "    public MainActivity(){\n"
                 + "        // Set the application class to run\n"
                 + "        appClass = \"" + mainClass + "\";\n"
-                + "        // Try ConfigType.FASTEST; or ConfigType.LEGACY if you have problems\n"
-                + "        eglConfigType = ConfigType.BEST;\n"
                 + "        // Exit Dialog title & message\n"
                 + "        exitDialogTitle = \"Exit?\";\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"
                 + "        mouseEventsEnabled = true;\n"
                 + "        // Set the default logging level (default=Level.INFO, Level.ALL=All Debug Info)\n"