Welcome to the keeworld theme how-to. Here we will explain how to make a theme for keeworld.
Please note that right now, you will need to know how to use the Android SDK and build the simplest of an Android project in order to make a keeworld theme. If you do not know what this means and would like to try it out, please see the official Android SDK site first before reading the rest of this page. We plan to provide a tool in the future so that anyone can make themes for keeworld and are sorry for any current inconveniences this might incur.
Themes in keeworld are packaged in a way similar to widgets. This means that within one package, or one ‘application’ in the market, you can include multiple themes. This allows you to make theme packs for your users instead of releasing tens or individual themes that just flood the market. You are also able to package themes along-side a regular Android application in the same way as you can do with widgets.
Make a Single Theme
To make a theme in keeworld, you will need to create several files. They are listed here and explained below:
- Your package AndroidManifest.xml,
- a theme xml file that tells keeworld what images to use in your package,
- and a fake activity that does nothing so Android knows your theme exists.
As this is a required file for all Android applications you must have this file. It will tell the Android system that your theme exists and tell keeworld how to access your theme.
Besides the standard required sections of the file, you will need to add a new activity. This activity should be a dummy activity (meaning the java file is empty) as it will never be run. You’ll add a filter intent to the activity with an action and a category so that keeworld can find your theme. Finally you’ll add a meta-data tag to your activity that tells keeworld what xml configuration file to use to access your theme’s settings. Below is what a Manifest file would look like for a single theme.
<?xml version="1.0" encoding="utf-8"?>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<action android:name="com.saora.keeworld.theme.action.details" />
<category android:name="com.saora.keeworld.theme" />
<meta-data android:name="com.saora.keeworld.theme.configresource" android:resource="@xml/theme" />
<uses-sdk android:minSdkVersion="4" />
Anywhere you see ‘your.unique.package.name.here’ should be replaced with your own domain name (you can just make it up, it doesn’t have to be real, but it should be unique).
.ThemeOne should be replaced with the name of your fake activity (explained later).
@xml/theme is your actual theme file that keeworld will read. Change this to the name of the file you make for that theme.
The Fake Java Activity
In order for Android to recognize your theme, you must include an Activity as part of your theme. So you’ll create a new Java class that is an activity. Make sure you give the new Java class the same name as the name in the activity tag in your AndroidManifest.xml file. This file can be left alone and we will never do anything with it.
The Theme XML File
This is the heart of your theme. It is where you will tell keeworld what do display and where to display it. The format is the same as all other ‘values’ xml files in Android. If you are familiar to those, this will be easy for you.
Each item inside the file corresponds to a specific setting in keeworld. For example, if you wanted to set the wallpaper of your theme, you would use this code.
<item name="wallpaper" value="@drawable/wallpaper" />
The name of the item is wallpaper. Keeworld will see this name, and know that the following value will be the wallpaper for this theme. The value must be an Android Drawable (Any kind, not just an image). This uses the standard Android values syntax.
Below is the list of all current keeworld theme items that you can change. Use the items in this list as the ‘name’ as in the example above.
Note that you do not need to replace all of these. Anything you do not replace will just simply show the keeworld default theme’s image.
Android is a very diverse platform and supports many different screen sizes and densities. In order to make your theme work for any screen size you might encounter in the wild, you need to make three versions of all your images. All the information you could ever want on this can be found here: http://developer.android.com/guide/practices/screens_support.html.
With that, you export an apk file as you would a normal Android application and install it. No more work is required.
We plan on adding much more power to the theme engine in keeworld, like customizing colours, application icons, fonts and more. In due time, we will provide these features to you.