Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal for Issue #85 'Add more configuration options for the AndroidManifest.xml'. #86

Closed
wants to merge 4 commits into from

Conversation

siamak-haschemi
Copy link

  • The idea is to allow arbritary json-data in the 'manifest' section of config.json, which is converted later to XML.
  • In order to avoid writing the complete AndroidManifest in the config.json, a default-manifest.json contains the default data. The json data of the 'manifest' section in the config.json gets MERGED with the default config.
  • pretty prints the resulting XML

With this extension, I can write arbritary manifest configs:

...
"package":{
        "android":{
            "method":"PhoneGap",
            "os":"Android",
            "sdk":"android-15",
            "package":"com.my.package",
            "activity":"MyActivity",
            "mode":"release",
            "keystore":"release-key.keystore",
            "keyalias":"release-key",
            "storepass":"******",
            "manifest":{
                "-android:versionCode":"1",
                "-android:versionName":"0.0.1",
                "uses-permission":[
                    { "-android:name":"android.permission.READ_CONTACTS" },
                    { "-android:name":"android.permission.WRITE_CONTACTS" }
                ],
                "uses-sdk":{ "-android:minSdkVersion":"10" }
            },
            "plugins":{
            },
            "plists":{
                "PhoneGap":{
                    "ExternalHosts":["*"]
                }
            },
            "autoScaleIcon":true
        }
    }
...

The resulting AndroidManifest.xml then looks like:

<?xml version="1.0" encoding="UTF-8" ?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.my.package" android:versionCode="1" android:versionName="0.0.1">
    <supports-screens android:largeScreens="true" android:normalScreens="true" android:smallScreens="true" android:xlargeScreens="true" android:resizeable="true" android:anyDensity="true" />
    <uses-permission android:name="android.permission.READ_CONTACTS" />
    <uses-permission android:name="android.permission.WRITE_CONTACTS" />
    <application android:label="@string/app_name" android:icon="@drawable/ic_launcher">
        <activity android:name=".MyActivity" android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
    <uses-sdk android:minSdkVersion="10" />
</manifest>

@4z3
Copy link
Contributor

4z3 commented May 20, 2012

I've submitted a cleaned up version of your pull request. See #87.

@4z3 4z3 closed this May 20, 2012
@siamak-haschemi
Copy link
Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants