U and I: Jake Berner
October 20, 2012 by Two-Bits. Filed under
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
Deprecated: Creation of dynamic property WP_Term::$cat_ID is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 378
Deprecated: Creation of dynamic property WP_Term::$category_count is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 379
Deprecated: Creation of dynamic property WP_Term::$category_description is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 380
Deprecated: Creation of dynamic property WP_Term::$cat_name is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 381
Deprecated: Creation of dynamic property WP_Term::$category_nicename is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 382
Deprecated: Creation of dynamic property WP_Term::$category_parent is deprecated in /var/www/twodee/blog/wp-includes/category.php on line 383
cs491 mobile, fall 2012, postmortems.
Deprecated: ltrim(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-includes/wp-db.php on line 3030
Deprecated: parse_str(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/class.jetpack.php on line 4255
Deprecated: Creation of dynamic property Jetpack_Carousel::$localize_strings is deprecated in /var/www/twodee/blog/wp-content/plugins/jetpack/modules/carousel/jetpack-carousel.php on line 339
My app is a relatively simple and familiar app. If you’re familiar with the class MadLib game of filling in the blanks to make a silly story, then this app is for you! It’s called BadLib because the scripts aren’t that great, and neither are the resulting stories.
The app makes use of TextView, EditText, GridView, Button, and Spinner.
The app starts up with a relatively blank screen and a Spinner at the top. Scripts are loaded from a resources file as an array of strings. Each string has the script’s title, followed by a pipe character, and then the story script. The spinner is populated with the titles of the scripts found.

Starting screen for BadLib
Upon selecting a valid script, a form appears with a GridView of EditText views, each with a hint corresponding to a word in the script that needs replacing. Below that are two buttons for resetting the form, or creating the final story.

User begins entering words acording to the hints.

The form is all filled out
When [Create Story] is clicked, the values the user entered are gathered up and sent along with the script to another activity. This activity assembles the final story and displays it in a TextView. It also has a button to return the user to the previous activity in order to create another script.

The finished story
I learned how to use the Spinner control (pretty basic) as well as how to iterate over GridView children. I learned that heirarchial data cannot be stored in the resources xml files (which seems somewhat odd considering that’s precisely what xml was for in the first place), and I had to encode the values to get an extra layer of depth. I learned how to pass ArrayLists of Strings to an intent. Somewhat unrelated to the mobile side of things, but I also learned how to dynamically replace patterns using regular expressions in Java.