[Sony Ericsson XPERIA X10 Mini] Emperor.dk:
Visual appearance in Theme Chooser etc

AndroidManifest.xml

This XML defines the visual part of the theme in Theme Chooser and the APK-information in Packet Installer and Application manager.

Here is an exampel:

<?xml version="1.0" encoding="utf-8"?>
<manifest android:hasCode="false" [COLOR="Red"]android:versionCode="1" android:versionName="1 Retro"[/COLOR] android:installLocation="internalOnly" [COLOR="red"]package="com.emperordk.theme.retro"[/COLOR]
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:pluto="http://www.w3.org/2001/pluto.html">
<uses-feature android:name="com.tmobile.software.themes" />
<application android:label="@string/theme_name" [COLOR="Blue"]android:icon="@drawable/icon"[/COLOR] android:hasCode="false" />
<theme pluto:themeId="XperiaEclair" [COLOR="Purple"]pluto:styleId="@style/Eclair"[/COLOR] [COLOR="Green"]pluto:name="@string/theme_name"[/COLOR] pluto:preview="@drawable/preview" pluto:wallpaperImage="@drawable/wallpaper" pluto:author="@string/author" pluto:copyright="@string/copyright" pluto:styleName="@string/style_appearance_name">
<meta-data android:name="com.tmobile.theme.redirections" android:resource="@xml/redirections" />
</theme>
</manifest>

The first thing the XML does, is define the theme version, and package ID (the red parts above).

To avoid collision with other apps and themes it's very important not to use a package ID that is used by other apps.

Eg. if I would make a retro-theme I would use this package ID:

or something like that :)

It's not very likely, that this ID is used by any other app :)

Next we notice, that the name of the theme comes from a string (gren part), so this is edited elswhere, se right below in this post.

In the same TAG the APK-icon is also defined (blue part).

"@drawable/icon" is a reference to the file "res/drawable-ldpi/icon.png" (asuming we make a LDPI-theme).

If the file does not exists in drawable-ldpi, Android looks for it in drawable-mdpi or drawable-hdpi.

Making a LDPI theme, everything should be made in true LDPI for faster and smoother response (Android resizes from MDPI and HDPI to LDPI, and that takes up some CPU-power).

Next we set the parrent style (purple part). This style must exist in the styles.xml (later in this guide).

In the same line a lot of strings are fetched, like theme name and so on, we also define the reference to the preview image the same way as the icon was defined, we must have a file for portrait and landscape. (Notice: wallpaper will not be set by Theme Chooser in CM7).

You should not edit any of the TAGs and/or arguments that are not marked by a color above.

Editing @xml/redirections will have no effect. Theme Chooser will use redirections.xml anyway (I realy want to be able to set the redirection master-XML to another XML-file, but I have not yet found the part of Theme Chooser where I can make it read the string from AndroidManifest.xml).

We can from this XML identify the existence of the folowing files:

res/drawable-ldpi/icon.png

res/drawable-hdpi/preview.png

res/drawable-land-mdpi/preview.png

YES! For some reason place the portrait-preview in "drawable-hdpi" and the landscape-preview in "drawable-land-mdpi", or Theme Chooser will return an error.

The size of LDPI icons is 36 x 36 px

The LDPI prewiew image should be 135 x 209 px (if lager, Android will just resize)

res/values/strings.xml

Here strings for APKs are defined.

As a theme APK realy doesn't do anything but being a container for theme-parts, there are only a very few strings.

This would be the content for a Retro-theme made by me:

<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Xperia Eclair Retro</string>
<string name="theme_name">Xperia Eclair Retro</string>
<string name="style_appearance_name">Retro</string>
<string name="author">Emperor</string>
<string name="copyright">2013</string>
</resources>