This application is built in the Android Studio IDE using Java and XML. First, I created the layout using XML, using a combination of the drag and drop (which ended up resulting in some ugly code) and typing in code by hand. The application interface itself consists of a view TextViews, 2 RadioGroups of RadioButtons, and a Button. There are 16 RadioButtons divided into two RadioGroups, with eight on each side. On the left side it determines the reference planet. In the activity (in Java), I first converted this to your age in Earth years (as a way to normalize the inputs) and then converted it into the age on the target planet, determined by the group on the right side. Upon selection of these RadioButtons and the click of the button, the program picks the correct conversion factor and outputs the age in years that one would be on the reference planet when converting from the target planet.
Published September 13, 2014
Comments