From 5d6ac60c5862732feccaddcf5afcc1fc9fdb7ee6 Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Mon, 9 Jan 2012 00:17:09 +0000 Subject: [PATCH] SDK: - add android screen instructions to AndroidManifest.xml git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9008 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/gde/android/AndroidSdkTool.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/sdk/jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java b/sdk/jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java index bf4702b52..874f2ba09 100644 --- a/sdk/jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java +++ b/sdk/jme3-android/src/com/jme3/gde/android/AndroidSdkTool.java @@ -285,13 +285,29 @@ public class AndroidSdkTool { Document configuration = XMLUtil.parse(new InputSource(in), false, false, null, null); in.close(); in = null; + boolean changed = false; Element sdkElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "uses-sdk"); if (sdkElement == null) { sdkElement = configuration.createElement("uses-sdk"); configuration.getDocumentElement().appendChild(sdkElement); + changed = true; } - if (!sdkElement.getAttribute("android:minSdkVersion").equals("8")) { + if (!"8".equals(sdkElement.getAttribute("android:minSdkVersion"))) { sdkElement.setAttribute("android:minSdkVersion", "8"); + changed = true; + } + Element screensElement = XmlHelper.findChildElement(configuration.getDocumentElement(), "supports-screens"); + if (screensElement == null) { + screensElement = configuration.createElement("supports-screens"); + screensElement.setAttribute("android:anyDensity", "true"); + screensElement.setAttribute("android:xlargeScreens", "true"); + screensElement.setAttribute("android:largeScreens", "true"); + screensElement.setAttribute("android:smallScreens", "true"); + screensElement.setAttribute("android:normalScreens", "true"); + configuration.getDocumentElement().appendChild(screensElement); + changed = true; + } + if (changed) { lock = manifest.lock(); out = manifest.getOutputStream(lock); XMLUtil.write(configuration, out, "UTF-8");