Theming Applications

Post Reply
User avatar
HaGGardSmurf
Ally of Robinhood
Ally of Robinhood
Posts: 4088
Joined: Tue Feb 03, 2009 9:46 am
Location: Alberta, Canada

Theming Applications

Post by HaGGardSmurf »

Theming Applications & Widgets

Image

If you want to theme an application (replace/edit images and text) its pretty easy, and can be done on stock rom's with or without root.

This is most useful if you want to remove a widget background, or change icon's to better fit your theme. You cant change where images will be placed, what they do etc, thats part of the application coding itself. All we are doing here is swapping out images.

* First thing you will need to do is get the apk of the app you want to theme.
* Second is download and install the android SDK http://developer.android.com/sdk/index.html" onclick="window.open(this.href);return false;
* Third is make sure java is installed http://www.java.com/en/download/install ... =jre&try=1" onclick="window.open(this.href);return false;
* Fourth and final thing is to make sure you have added java and android sdk to your PATH.
(Only needed if you are resigning apk's which you will need to do if your using a stock rom)

Adding Java & SDK To PATH
  • Right click my computer
  • Select properties
  • Select Advanced system settings
  • Select Environment Variables
  • Then from the bottom half ("System Variables")
  • Scroll down to path and double click it
  • Now, add a semi colon at the end of your current path, then path to your java semi colon, and android sdk directory
For example this is my path:

Code: Select all

...C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Java\jre6\bin;C:\AndroidSDK\tools
As you can see, I added "C:\Program Files (x86)\Java\jre6\bin;C:\AndroidSDK\tools" to the end of my PATH. I have like 6 or 7 other directories in my path, and you probably will too, but to keep this thread neat, I didnt include them.

Now for actual theming

For an example in this tutorial I will be 'theming' facebook for android.
  • You will need to find your APK, so if you've downloaded through the market, use a file manager (I use astro) go into /system/app and look for your application, copy the apk to your sd card, then copy from sd to your computer.
  • [color=#FF0080]If you have downloaded a version of the apk, then updated later, you will probably need to go into the market, uninstall the application, then reinstall it. If you do that you won't have any problems finding the right APK on your phone. The first time I tried to theme an app, I grabbed the APK from my system/app folder, unannounced to me this was an older revision of the app I wanted to theme, and couldn't understand why I could not find certain images.[/color]
  • Once the APK is on your computer, you will need to rename it to .zip so we can extract the image folder and begin editing the images.
  • [color=#FF0080]When editing files like this, and changing the file type, you should go into a folder, press alt, go to tool's > Folder Options > View and uncheck "hide extentions for known file types" and press ok[/color]
  • Once you've renamed to .zip, open the zip archive up and go into the res folder, now extract the drawable folder(s) onto your desktop
  • [color=#FF0080]This folder contains the images used by the application, and the background. Some apps will have a drawable-hdpi and mdpi folder these folders contain other images the app uses. Depending on your phone you will need to edit either the hdpi or mdpi images. Depending on what kind of phone you have, the application will use either the hdpi or mdpi. Edit one image in the hdpi and one in the mdpi and see which one changed on your phone.[/color]
  • For example with this app, I will be removing the background of the widget, and will be replacing the newsfeed, profile, friends, photos, events, messages, and requests images as an example.
  • [color=#FF0080]There is often various sizes of the same images used for various things in the application, so when replacing for example the news feed image, make sure you go through and change all the various sizes also. IE: In this app there is the normal sized news feed image for the main application, there is also a smaller 24 x 24 image used in the title bar. So we will need to take our replacement image, resize to 24 x 24 and replace the title bar news feed icon also. [/color]
  • Be cautious, if the image you are trying to edit is a .9.png file you will need to convert back to .9.png when finished editing
  • [color=#FF0080]To convert back to .9.png you will need to go into your androidsdk/tools folder, and launch draw9patch.bat it will load up a java application in which you will need to drag and drop the image you wish to convert onto. Once the application opens your image, click file > save, and your done.[/color]
  • When editing the background, if you wish to make the background transparent, dont just delete the image, take it, open in photoshop or whatever other image editor you wish, and erase everything so its just a blank canvas, then save that image. Otherwise you will cause errors within your application
  • [color=#FF0080]Most widget background images are .9.png's so watch for that.[/color]
  • Once finished editing all images etc, you will now need to repack the apk, so rename the .zip to .apk. If your using a stock rom you will need to resign the apk, otherwise you can just install the apk on your phone
  • [color=#FF0080]To resign, you need apkmanager, and need to make sure java is added to your path (instructions above)[/color]
  • Put the APK in the "place-apk-here-for-modding", and launch the script.bat. You will want to select your project (22), and type in the number of your project, then enter. You will now want to extract the apk (1). Then zip it (3) you'll be asked how you want to zip it, just do a normal zip (2). Now resign (4). Once finished type 24 and enter.
  • [color=#FF0080]Now your done, copy the "signed<app name>.APK" to your phone, and install[/color]

Video tutorial comming soon (tomorrow probably)
Post Reply

Return to “General Information & Questions”