Manifest + apk confusion, please help!

Monkey Targets Forums/Android/Manifest + apk confusion, please help!

Grey Alien(Posted 2015) [#1]
Hi all, I wanted to know a couple of things about the manifest:

1) Is it actually embedded in the .apk? At the moment when I build, I get the following files in the android/bin folder:

AndroidManifest.xml
MonkeyGame-debug.apk
And a bunch of other files which seem to be compile related.

I assume I can just edit that AndroidManifest.xml file, but if it's also embedded in the .apk then I guess I should edit it at some other place in the Monkey ecosystem first and then recompile.

2) Is it safe to just rename that apk? e.g. TitanAttacks.apk. It's not actually a debug version btw, but for some reason it always outputs as that even when I have release build selected in Monkey.

3) In the AndroidManifest.xml file there are these lines:

android:name="MonkeyGame"
android:label="Titan Attacks"

Should I alter android:name?

I've also setup a package of package="com.puppygames.titanattacks"

Thanks! I can't find any kinda of total noob manifest guide.


MikeHart(Posted 2015) [#2]
did you see the config settings for android?

'Android settings, defaults shown
'
#ANDROID_APP_LABEL="Monkey Game"
#ANDROID_APP_PACKAGE="com.monkeycoder.monkeygame"
#ANDROID_SCREEN_ORIENTATION="portrait"              'one of: user, portrait, landscape
#ANDROID_VERSION_CODE="1"
#ANDROID_VERSION_NAME="1.0"
#ANDROID_NATIVE_GL_ENABLED=False                    'for use with the opengl modules
#ANDROID_KEY_STORE="../../release-key.keystore"
#ANDROID_KEY_ALIAS="release-key-alias"
#ANDROID_KEY_STORE_PASSWORD="password"
#ANDROID_KEY_ALIAS_PASSWORD="password"
#ANDROID_SIGN_APP=False



secondgear(Posted 2015) [#3]
Off the top of my head:

1) Manifest is embedded in the APK. APK files are signed (either with debug key or with your key). Changing the content of the APK after it's assembled will alter the checksum, and will probably make the apk unusable.
2) You can safely rename the apk to whatever you want and then load it to the device/emulator using adb install <your apk file>. Unless you tell Monkey to sign your apk, the generated apk is signed with Android debug key (or whatever it's called), and such apk cannot be distributed through the market, unless you re-sign it with your key.
3) android:label is what is shown under the icon on the device, so edit freely. android:name is the Java class name of your game - don't change it.

Like MikeHart said, most of the important manifest settings are set in config.monkey, but if you want to fine-tune something, you can either edit the manifest template that Monkey provides, or edit the generated manifest.xml in the root of "build/android" folder (not in "build/android/bin") and then run your project in Eclipse.


Grey Alien(Posted 2015) [#4]
@MikeHart Yep I'm using those. For the current project it's not for Google Play but will be distributed so that people can just run it on their devices (it'll all become clear in a week or two). So I'm not currently signing it with any known key, is that still OK? (sounds like the Android debug key will be used according to secondgear.) It seems to work fine if I send the apk to friends. My configs contain this (note that SIGN_APP is commented out):

#ANDROID_KEY_STORE="../../yourProject.keystore"
#ANDROID_KEY_ALIAS="yourProject.keystore"
#ANDROID_KEY_STORE_PASSWORD="123456"
#ANDROID_KEY_ALIAS_PASSWORD="123456"
'#ANDROID_SIGN_APP=True


@secondgear Ah OK so the manifest is embedded in the APK, fair enough. It's weird that it's also in the bin folder but I guess that's an intermediate stage in building the apk? So it's normal for the compile to output MonkeyGame-debug.apk then even though it's a release build? Got it re: android:name. Thanks for your help!