Monday, December 12, 2011

Skyrim Alchemy Lab using XSLT, XML and SQLITE3 for android application.

I wrote an alchemy lab for Skyrim.  Here is an example usage.

The app when it first comes up.  It shows all ingredients in the top list.

Then when you select an ingredient in the scroll-able list, it will show its effects in the bottom section.  Thi screenshot shows when "Bee" is selected.


Then when you have bee selected, you can click the "Ravage Stamina" effect in the bottom and it will repopulate the ingredient list to show only ingredients which have this effect.  This screenshot shows the list of ingredients with this effect.

Clicking the reset button will reset the list.  Rather than use screen realestate to disply the current list filter, I use a toast message to pop-up the selected item.

This code was built by pulling the html code from a website that listed all the ingredients and effects.  The html was filtered using a combination of xslt and vimfu to create a xml file using saxon.  I built a java program to use the saxon jar file and was going to use it with android but it did not work.  Saxon used javax api's and android complained that these routines are reserved for new virtual machines.  Rather that go that way, I rewrote the saxon xslt to make a dos batch file which did inserts into a sqlite database.  Then I put the database in the app and used androids sqlite api to query it and display results.