[Android Themes] yosterwp:
Hello XDA,

I've gotten a request to make a guide about theming. I am not going to make this an expert guide because there are many other guides out there that might suit others better. http://xdaforums.com/showthread.php?t=916814 <- That is a good resource for theming.

Anyways, I want to share how I themed my theme. I made a theme that was to be used with the Theme Chooser found in many roms.

Since I was new to theming, I decided that I was going to use another theme that worked with my xoom as a base for my theme. So for me, I downloaded jasonevil's Xperia S theme. It came in the form of an apk, as most theme chooser themes do.

So if you plan to do what I did and base your theme off of someone else's theme, here's what you do: Please read through the entire post first.

Before you begin, familiarize yourself with .png files and .9 files too. Also, prepare yourself for fustration. You may also want to print this out, unless you are using a multi-monitor setup.

------------------------------------------------------------------

NOTE: Throughout this guide, you should take regular backups. You can find "backups" under the "Extas" tab in VTS. Don't do that now, because you probably don't have VTS yet.

--------------------------------------------------------------------

1. Download a theme that you would like to use as your base. It should be made for the Theme Engine and should come in an apk. And it might be nice to work with a theme that works with your device.The theme should also theme everything (or more) of what you want to theme.

2. If you find the theme on a forum, remember to thank the author of the theme.

3. Ask the themer, preferably through a PM, for permission to use ANY part of their work in your theme, if you plan to distribute your theme to the public.

4. Make sure you have the Android SDK setup and ready to go. It should be in your path and ready for use.

5. Download a software called "Virtuous Ten Studio". We'll call it VTS. VTS is an amazing piece of software that makes theming and modifications very easy, and it comes with many tools that make it a must have. It's not required, but you might want to familiarize yourself with the software on the website.

6. Take a breath, you are in for a ride!

7. Open up VTS

8. Hit File>New Project

9. Give your new project a name. Make the project name something like template or the name of the theme you are theming. Don't worry, the name you give here will not be the name of your theme, infact, this isn't your theme at all. We are just going to keep this as a reference, you may not even use it at all.

10. Give your new solution name . Make the name of the solution something that you can understand, the name of your solution will not affect the theme directly. Think of the solution as your desk. It holds everything that is related to your final goal: the finished theme. This should probably be reflective of the theme you are going to make.

11. DON'T hit OK yet. OK? Before you do that, In the Create new project window, go to the second tab that says "Apk-Tool".

12. Make sure that "Generate Java Sources" is checked on. I don't really know why I have it checked off, but things worked when it was on.

13. Where it says "File:", navigate to where you have downloaded your template apk.

14. You have been patient enough, you can finally click the ok button!

15. On the left of the screen in VTS, you should see a structured layout of your solution and theme. On the top of that structure, you should see your solution name. Right click on that solution name and click add project.

16. Oh no! Not another screen like before! Not to worry, unless you are combining themes, this should be the last time you see this screen. In the dialog, where it asks for a project name, put a name that resembles your final theme, perhaps the name of your theme.

17. Repeat steps 11-14

18. Take a second to breathe, you'll need it!

19. Now take a look at the final theme project at the left. That project is exactly the same as the other one (template theme) in your solution. Right-Click on the final theme project's name and hit "Properties".

20. You'll see a window with a bunch of stuff, but the only thing you should change is the "APK-Name". In that field, delete everything that is already there and type the name of the final product. This is the name of the file that people will download from wherever. It doesn't have to be the name of the theme itself, but make it fairly short and descriptive. At the end of the name, put ".apk" at the end. It's better to not put any punctuation and spaces in that field. If you want to put spaces in between words, try a "-" or an underscore "_" instead. Click OK when done.

----------------------------------------------------------------------------------------

From now on, "your project" referrs to the final project. The other project that you named after the template theme is there in case you want some inspiration. And "your theme" referrs to essentially the same thing. The "original theme" referrs to the theme you are basing your theme off of.

---------------------------------------------------------------------------------------

Now lets understand what makes up our theme chooser theme:

Under your final project, you should see a file called "AndroidManifest.xml". This is an important file because this is how the Android system sees your final apk, sees it as a theme, and knows what to do with the theme. RIght now, the AndroidManifest tells the Android system that your theme is exactly the same theme as the one you are using as a base. You need to change that. BE REALLY CAREFUL when changing things in the AndroidManifest, as it can render the entire project useless if something is done improperly.

"res" is a folder where all of your theme's resources are stored. When I say resources, I mean all the images that you are using that make up your theme. The folder also has other .xml files that make up your theme. The xml files stored in the "values" folder are core components to your theme. The xml files in the "xml" folder are bits that are specific to certain apps.

------------------------------------------------------------------------------------------

21. If you are using someone else's theme as the base of your theme, it is imperitive you give them credit. I did that in my AndroidManifest. In the AndroidManifest.xml file, after "</manifest>" at the vert end, hit enter a couple times and then start the line with "<!--" This is important as "<!--" to the Android system means that the text that follows is not code, and is human language. Therefore it will skip it. With that, you should give credit to the work of the themer whose work you base yours off of. At the end of your note, put "-->". That closes off the comment.

22. In the AndroidManifest.xml you should see the word "package" in red. Next to that, you will see an "=" and a pair of quotation marks. Inside those quotation marks, change what ever is there to "com.[whatever]", What you put in there must be unique, as you want to make sure no other project, theme, or application in the world has that name. For me, I had package="com.yosterwp.theme.honeycombICS". I decided to put my username and the name of my theme in the name of the package. You may wish to put your username and theme name in, but anything else can work too. Don't put the theme in someone else's name.

23. In the rest of the AndroidManifest, you will see the name of theme you are basing your theme off of in multiple places. Replace those names with the name of the theme you are making. This is important because this is the name of your theme.

24. If the original theme has a wallaper, but you do not want a wallpaper to be bundled with your theme, delete "pluto:wallpaperImage=[whatever is here]". Do not delete anything else or anything else that begins with "pluto".

25. Press CTRL+S to save the file.

26. Now, in your project, expand the "res" folder. Then expand the "values" folder under it. If you see a file called "public.xml". Here's the scoop: public.xml is a file that tells theme chooser what your theme will theme, and where it is. This is a file generated by VTS (for the tech-savvy, apktool does that). The file gets generated by the smali code that comes out of the decompiled apk. But that is not important. What is important is removing that file. To get rid of it, you should right-click on the folder and click "open in explorer". This will open up an oh-so-familiar explorer window, Here you can just select "public.xml" and simply delete it like you would any other file. When you are done, close the explorer window.

27. Now you want to refresh VTS. To do that simply press File and then click on the name of your solution.

28. Yay! Everything has loaded! You have just scratched the surface of the surface in theming. I advise you take a break for 5 minutes. Drink some beverage. Look outside, smell the fresh air. Look away from your computer screen to give your eyes a break. Trust me, things go wrong when you are not relaxed.

29. Now that you changed some of the AndroidManifest, you need to change some other things too. Go to your project, look for res>values>strings.xml. Once you find strings.xml, change every occurence of the original theme's name to the name of your theme.

30. In the same strings.xml, replace the name of the author who made the original theme with your name. And also change the copyright to what you want too.

31. Press CTRL+S to save the file.

32. Now, look for res>values>styles.xml. At around the 3rd line, you should see something like "<style name="blahblah". Change "blahblah" to the name of your theme.

33. From there, you can replace files and change values in some of the various xml files. Except for the files in the smali and values folders, you can remove, modify and/or replace files in any folder. Don't touch the AndroidManifest. Only modify it if you want to change the version of your theme. If you are replacing files, make sure that the new file has the same name as the old file. And make sure it is of the same type too. You can change as many files as you want at a time when you are theming, but as soon as you return to VTS, reload your project. You can do that by clicking File and then your solution.

34. Once you have done all the modifications that you have wanted to do, it's time to get all that stuff in VTS into one apk again. Reload your project in VTS and then click "Build All". If you do not want the original theme to build, by now you can either delete it, or right-click on your theme and click "Build Project".

TIP: Before building a project, it is a good idea to clear the logs, so you can read it later to see any errors. Go to View>Clear Logs.

35. If you encounter errors while building, you can assume something went wrong. If you want to know what went wrong, go to Extras>Logs. There you can see everything that VTS throws at you. It may seem like a foreign language, but if you read it, it will start making sense, and you will know what to do pretty soon.

36. If all goes well and you get "Build Successful!" CONGRATULATIONS! You have made your first theme! If you have adb set up and you have your phone/tablet connected to your computer, then you can use the built in "Push to device" option in VTS, that automatically installs your theme on your device.

37. Finally, if you have permission to distribute your theme from the developer of the original theme, make a thread on XDA (put it in an appropriate place), and upload your theme! Put some screenshots in there too.

38. GIVE CREDIT TO THE DEVELOPER OF THE ORIGINAL THEME ON YOUR THREAD.

It isn't the most professional guide out there, but I hope this guide helps people get into the world of theming. If this guide helped you, say thanks through the button!

Please don't quote the entire OP.