SDK:
- add android screen instructions to AndroidManifest.xml git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9008 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
3d54ab3378
commit
5d6ac60c58
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user