Implementing content from main method (Java) into Android Application?

view story

http://stackoverflow.com – I want to apply some code from a Java application I made earlier into my Android application that I am currently working on. This activity will contain an algorithm that I have written up to encrypt a message (using a simple substitution cipher). My main problem is this: I have two instance variables in the class and a main method, which obviously will not integrate well in Java, as follows. public class subcipher_1 { //Use Static variables so main class can recognize them int key = 0; static char ch; /*Create main method *Will contain GUI prompts and encryption algorithms */ public stat (HowTos)