[Android Themes] nhnt11:
More detail

Stuff in the Manifest

The manifest contains several general properties of your app file.

The following are a few which are referenced here.

To change the ringtone: Just put your desired ringtones/notification sound in /assets/media/audio/<Ringtones/Notifications> To prevent your theme from changing the ringtones, delete the corresponding lines from AndroidManifest.xml. I'm sure you can figure out which lines to delete. Also, you can remove the /assets folder, unless you have some other asset in it. (in which case just delete the ringtone buried inside as mentioned above)

Your theme's wallpaper is set to /res/drawable/wallpaper.png. Again, remove the required line from AndroidManifest.xml to make sure you dont mess up your users'wallpapers.

Your theme's theme chooser preview is set to /res/drawable/preview.png. (NEW - I suggest that you DO NOT remove the backslash from the manifest! (see first post))

The icon of your theme's apk file is set to /res/drawable-_dpi/icon.png. You should have an icon for at least one screen-size (preferably hdpi), but its nice to have it for all three.

Variables

This is to help those who don't have dev experience. In android packages, wherever you see an "@" symbol, the part following it will refer to a variable. A variable is basically a name given to refer to a resource for convenient use.

Here are a few types of variables you should know about (note that the explanations may not apply to the theme chooser, but are general):

1. drawable

2. color

3. style

4. string

5. dimen

1. Drawables - Drawbles are, well, drawable. These are resources which android can draw. That includes your theme images, wallpaper, preview, and also stuff like the battery percentage xml's, progress bar xml's etc.

1. Colors - Colors are colors!! Duh! LOL :). Anyway, in /res/values/colors.xml you will find an editable list of colors. Say you use green a lot in your theme. Instead of typing "#ff00ff00" everywhere, you can simply define a color called "green" here, by adding the following line:

<color name="green">#ff00ff00</color>

Now, you can substitute "@color/green" wherever you want to use green.

3. Styles - these are a little advanced. They allow you to define a set of attributes and apply the entire set to different components.

Here's an example style:

<style name="mytext" parent="@android:style/TextAppearance.Small">
<item name="android:textColor">#ffff0000</item>
</style>

Let's break this down -

First of all, we're naming this style "mytext".

We're saying that its parent is "@android:style/TextAppearance.Small".

This means, that it automatically inherits ALL the properties of the android system style, "TextAppearance.Small" which can be found in the styles.xml in framework-res/res/values.

Now, we're adding an item with the android attribute, "textColor". There are many attributes to choose from, you can look in the attrs.xml in framework-res/res/values. (Note that an attribute may not be applicable to every situation)

Next we're giving the text color a value - in this case, red.

Now, this style can be applied anywhere to get red text in the normal system font size for small text.

Here's an example of how to use styles: post 88.

4. Strings - Strings let you make references to text. Maybe you have your theme name everywhere, and its really long. Maybe your theme name is "supercalifragilisticexpialidocious". Well, you dont want to type that every time. So you can add the following to /res/values/strings.xml:

<string name="myname">supercalifragilisticexpialidocious</string>

Now, wherever you want to use the word "supercalifragilisticexpialidocious", just substitute it with "@string/myname". And it will use whatever you defined for "myname" there.

5. Dimensions - These store values for sizes and so on. For example, its an easy way to remember a custom text size that you need a lot. Add the following to "/res/values/dimens.xml" (this does not exist by default)

<dimen name="mysize">33.4sp</dimen>

This will allow you to use the font size 33.4 by substituting "@dimen/mysize" wherever you want. For sizes in pixels, use "____.__dip" instead of "sp".

Comments

Comments are useful little dev tools. Comments basically let a developer (but they're useful to themers too) make comments in the code. Basically, the syntax of a comment (more on that in just a bit) tells the compiler to ignore that line(s). A side effect is that you can "comment" parts of your code - which means that you are marking it as a comment - which are not used (or not yet ready to be used), before compiling and releasing, while retaining the old code for future reference.

How to make a comment in xml files:

Simply surround the code you want to comment with "<!-- ......... -->.

The "<!--" part tells the compiler where a comment starts, and "-->" tells it where the comment ends.

More stuff will come here as I think of it.