Software Engineering

Pocket Beer Reference Application for Android Mobile
Adam Dille
A Project Submitted in Partial Fulfillment of the Requirements for the Degree of Master of Engineering in Software Engineering Department of Computer Science, University of Colorado at Colorado Springs 1420 Austin Bluffs Parkway Colorado Springs, CO 80918
Submitted on 11/5/2010

ABSTRACT Completion of this project will involve the design and development of an Android “mashup” application that will provide a mobile beer style reference for home brewers of beer. The application will provide several useful methods of mapping widely accepted style guidelines to specific commercial beer examples. In addition, the application will allow user interaction for the purpose of determining the source of an “off flavor” in a specific beer.

search engine. The results from searches against the API are formatted as JSON and passed back to the application for parsing. 1.2. JSON Parsing in Android Frank Ableson, in his July 2010 IBM technical publication entitled “Using XML and JSON with Android”, details how to use XML and JSON responses in an Android application. This information was particularly useful to this project after the decision was made to use Google‟s REST Search API, which returns JSON-formatted data. The JSONArray and JSONObject classes are used in Android to parse JSON responses and convert them into objects which can be queried for their data (Ableson, F. 2010). Google‟s API responds with a JSON structure containing four top-level objects. Two of those objects contain nested arrays of other objects. With the JSON classes available, and the examples provided by Ableson in his publication, it will be much easier to build a function for parsing these responses and sending them to Views within the application. 1.3. Security Considerations In an October 2008 iSEC Partners publication entitled “Developing Secure Mobile Applications for Android”, Jesse Burns gives a full run down on the Android Security Model. He explains how, at design time, an Android application must declare explicit permissions for the operations that it needs to carry out. These permissions are then presented to the user when the application is installed, and they can either accept or reject the application based on those permissions (Burns, J. 2008). This paper helped to provide some background into the methods that Android uses to secure its running

1. RELATED WORK At the time of this writing, Android is still relatively new (it turned 2 years old on October 21, 2010). In addition, it is and always has been a community supported platform. Because of this, much of the available research and documentation currently comes in the form of blogs, developer forums and technical publications. Unfortunately, this means that there are currently no published conference papers on Android development that are directly related to this particular project. Instead, a selection of technical publications was chosen for research. These publications are directly related to several of the most vital development topics of this project. 1.1. Web Service Decisions In his 2009 paper entitled “Web Service Clients on Mobile Android Devices”, Johannes Knutsen discusses the advantages that a client application gains when using a Web Service Gateway. Web service gateways offer the client an interface that is simpler than the web service itself and they convert responses into lightweight packages like XML and JSON (Knutsen, J. 2009). The lightweight responses, in particular, are extremely useful for a mobile application as they cut down on data usage and battery drain. This project will utilize a Google REST Search API that is essentially a web service gateway against the Google

1

Pocket Beer Reference Application for Android Mobile applications. Armed with this information, this project‟s application was designed to require a minimum set of permissions to be accepted by the user. Only two permissions are requested: Full Internet Access, and View Network State. Of those two, only Full Internet Access is presented to the user as a possibly dangerous permission. Since most users understand that internet access is necessary for this type of application, these design decisions will ensure that users feel comfortable installing the application, since they won‟t be bombarded by a list of requested permissions. It also means that the application will be very secure, since it will be prohibited from performing a myriad of dangerous operations on the system such as accessing contacts, reading emails, dialing phone numbers and so on. 1.4. Phonetic Search Certain features of this application will require searches over a table of text strings within a database. Finding a desired string within that list will allow the user to link to that string‟s corresponding data and read the details that they are looking for. This could be performed rather simply using a full or partial string match where a function would check to see if the user‟s search term matched any part of any string within the database table. However, this would prevent results from being returned when words are misspelled. Since spelling errors are common, it was desired that this feature be developed to find the desired results, even for misspelled words. One of the most popular ways to handle spelling errors is through the use of a phonetic search algorithm. These algorithms, sometimes called “sound alike” algorithms input a word or name and return an encoded key (Philips, L. 2000). Keys for two words can be compared to determine whether or not they match phonetically. One of the best phonetic search algorithms was published by Lawrence Philips in his 2000 publication entitled “The Double Metaphone Search Algorithm”. Double Metaphone allows for resultant keys to be of any length specified, which can increase match accuracy for certain words. It also introduces alternate pronunciations, which gives two possible keys for some words, thus increasing potential matches (Philips, L. 2000). The Double Metaphone algorithm implemented in the Apache Commons project is used in this application with great success in thwarting spelling errors during string searches. 2. INTRODUCTION Brewing beer at home, known as “Homebrewing”, is a hobby for many people around the world. In America, it is estimated that more than 750,000 households brew at least once each year (How many homebrewers are there in the United States? Talking Points). One of the most popular American Homebrewing online forums runs a thread to track its members‟ yearly beer production. In 2009, members of the forum logged roughly 31,000 gallons of beer brewed at home. Members estimate that the tally on that forum thread most likely represents about 1% of the world‟s homebrewing production (How many gallons of homebrew in 2009? Forum Topic. Homebrew Talk). If those stats ring true, then homebrewers produce somewhere around 3 million gallons of beer each year. In the world of homebrewing, styles reign supreme. Beer style guidelines provide both beginner and expert brewers with a framework that their creation should fall within. Crafting a quality beer is actually quite difficult because there are many variables that play into the brewing process. A brewer must be conscious of time, temperature, ingredient quality, equipment, cleanliness, procedure and technique. In addition, a typical beer takes around 6 weeks from brewing to consumption, meaning that the opportunity for mistakes is spread out over a long period of time. Even a small mistake can lead to a beer with noticeable “off flavors”, resulting in a waste of time and money (Palmer, J. 1999). Building a beer recipe to conform to a particular style guideline gives a brewer some level of assurance that aroma, mouthfeel and taste characteristics of the creation will turn out better than they might have if a random recipe had been thrown together with no guidelines. The style guidelines used almost universally by homebrewers are published by the Beer Judge Certification Program (BJCP) (BJCP Competition Beer Styles, 2008), and updated every few years. BJCP styles are used for categorization and judging in just about every homebrew competition in America. These styles come in extremely handy for a homebrewer, as they include ranges for beer gravities, bitterness levels, color, and alcohol level. They also contain descriptions of aroma, feel, taste and other characteristics one would judge when tasting a specific beer. They hold lists of ingredients often used in each style and a few example beers of each style. Whereas most other beer style lists are just names used

2

a brewer might read through the details of a particular style and grow interested in brewing a beer of that style. BeerAdvocate categorizes every single beer on their site into a style that they came up with. Even if a brewer is armed with a great recipe that adheres to a particular BJCP style guideline. BeerAdvocate. taking a specific beer and figuring out what style it falls under. Adding this search function into the mix will provide a quick method for getting a user to their specifically requested beer page on BeerAdvocate. Inversely. the #2 result in a Google search of the word “beer” is BeerAdvocate.com immediately showed up in web searches and it proved to be the place for beer on the web. With that mapping in place. after using the BJCP Styles List. PROJECT EVOLUTION Originally. this area of weakness didn‟t seem to have any solutions available in the marketplace. or the inverse. PROBLEM STATEMENT As useful as they are. 3. shortly after implementation of this idea began. there will inevitably be times when things go wrong. The idea was to allow a home brewer to create a recipe from scratch by choosing a BJCP Category. the BJCP styles contain a wealth of valuable information for a brewing hobbyist to reference. and given a BJCP style. 6. This feature will use a database of flavor characteristics. an individual with an experienced palate will know almost immediately by judging aroma. In addition.Pocket Beer Reference Application for Android Mobile for categorization. However. creating an app to address this weakness would allow for the reuse of all of the existing Styles List code. The app would then tell the brewer how closely their recipe was falling within the chosen style category. Rather than re-invent the wheel it became a priority to find a new idea and shift gears. But. In addition to these style-related functions. separate from the BJCP (Beer Styles Beer Advocate). Finding the style of a particular beer or a list of example beers for a particular style would be possible by pulling in a data set containing information about commercial beers. right after the Wikipedia entry for Beer (Google Search: ‘beer’). To simplify the process of pinpointing a specific beer on the BeerAdvocate website. tracking down the cause of an “off flavor” in a beer is not an intuitive process. the plan was to create a simple mapping between BJCP styles and BeerAdvocate styles. A brewer will often try a commercial brew. given a specific beer page on BeerAdvocate. and component ingredients. and then decide that he would like to brew his own clone version. These two scenarios actually pop up quite often for the average homebrewer.com. the application will have an interactive feature that will allow a brewer to track down the cause of an undesirable flavor in his beer. With the completed Style List feature in active use. Feature Designs Using BeerAdvocate‟s existing categorizations. The search began for a place on the internet with a comprehensive list of example beers that could be referenced in a mash up with the BJCP Style Guidelines. Inversely.1. Fortunately. In fact. 4. before brewing they‟d like to try an example first and see if they actually like it well enough to spend the time and effort on it. APPROACH AND GOALS 6. a search View will be included to accept a user‟s query and provide results from Google‟s REST Search API. In these cases. the application would be able to grab the BeerAdvocate style number and use the mapping to return the associated BJCP style. 5. Fortunately. the application would know exactly which BeerAdvocate style page to visit and poll for top beer examples of that style. which will be related to causes of those characteristics. the BJCP styles fall short when it comes to finding popular example beers for a particular style. this project was going to be devoted to the design of a recipe creation application for Android. All of the code necessary to populate BJCP Style tables and give the user details about any particular style was already implemented. PROPOSED SOLUTION It was immediately clear. a point of weakness with the styles themselves began to show up. an application hit the Android market to do just that. Those results will be filtered to BeerAdvocate index entries. Unfortunately. Each cause will also have a description of 3 . mouthfeel or taste that something is not quite right. This categorization would prove to be the most important criteria for connecting BJCP Styles to commercial examples on the market. that a mash up application would help the brewer to quickly pinpoint new and useful information related to those styles.

Project Management There are several great tools available for project management and bug tracking such as Trac and Mingle. This system allowed development items to be tracked at home and on the go and required almost zero set up time. Once these Eclipse plug-ins are installed and configured. 4 . Google Tasks is a simple task list within Google Calendar.4. the following list of UI goals was laid out for this project:  Centralized. Nightly backups of the repository were made to a separate server to ensure the safety of the project artifacts. one of the main goals of testing this application was to ensure compliance with the User Interface goals of the project. Source Control A Subversion repository was installed and configured on a home server to house all of the artifacts for this project including source code. so an attractive and functional user experience is of great importance when I set out to create any piece of consumer software. 7. with a single developer and a project lifespan of just a few months. My employment background includes plenty of web design. L.  All Views should scale gracefully to any screen size that might be encountered on an Android device (anywhere from 2.2.  All lists of data provided by the application (styles.3. 6. No general list should be provided that requires the user to browse for what they are looking for. However. For a larger project. graphics and documentation.Pocket Beer Reference Application for Android Mobile things that can be done to make sure that the flavor doesn‟t show up in future brews and. This algorithm will help to catch spelling errors and should prove very helpful in tracking down specific flavor characteristics. in some cases. 2000). Testing Aside from catching obvious bugs.  All Views should display data in an easily readable format. CONFIGURATION MANAGEMENT 7. Projects are continuously compiled as development progresses. This meant testing the application for compatibility on different android devices. They also provide emulators and drivers necessary for physical device connections. Development All development was performed using the Eclipse IDE. This feature will employ a search using a phonetic algorithm (Philips. With great user experience as a priority. 7. it was simpler to track to-do items and known bugs using Google Tasks. A simple click of the Run or Debug buttons installs the latest binaries to the connected device and runs the application. This server has an associated domain name and was given a public port for Subversion Server access. These can be used to run or debug a project in an actual Android environment. binaries.  Long-running operations should always be performed on new threads with the UI providing cues to notify the user of that operation‟s status. and tastes) should be filterable/searchable using an intuitive search and list View. These packages facilitate native android development within Eclipse. what can be done to remedy the “off flavor” in the currently affected beer. which can be synced out to a mobile app called GTasks. reusable styles should be used as often as possible to create consistency between different Views within the application. UI Approach The final design step will involve placing an intuitive UI on top of all of these different sources of data to create a seamless experience for the user.  All Views should rotate and display gracefully when toggled between portrait and landscape orientations.  All graphics should feel modern and should be provided in a range of resolutions to accommodate different screen densities and sizes. 7.8 to 10 inches diagonally). This allowed check-ins and updates to occur from anywhere with internet access and proved to be very useful during development. This will keep the user experience responsive at all times and give the impression of snappy performance.1. commercial examples. Google distributes a set of SDKs and plug-ins for Eclipse called the Android Development Toolkit. developing an application using a physical Android device is simple. it would most definitely be advantageous to set up a more robust project management solution.2. 7.

Thread All Data Operations Initially this application was designed using the UI‟s thread to perform all operations. which can be passed to the getResources(). supporting database refactoring only required small changes to the resource files.<name> where name is the name given to the string in the XML file. it would be initially shown as a blank black screen. This proved to be absolutely invaluable when database usage began to increase during development. this design decision quickly became a problem. If a strings. This was an introduction to Android development and a return to Java after 6 years in a Microsoft world.xml file is created under an Android project‟s res\values folder. Resources Are Your Best Friend Fortunately. resource file. activity titles. This covers about 99. However. When a View was rendered that required web data.9% of Android phones currently in use as of this writing (Platform Versions – Android Developers). LESSONS LEARNED Many lessons were learned about Android development as this project progressed.1. each and every string was placed in the string.string. Initially.xml file. headings. but it would also become impossible to press the back button since the UI thread was blocked waiting for a web response. Sprint Samsung Epic 4G. For this project. In addition emulators were set up to test all versions of Android from 1. all of the initial development used data from the database to render Views.4.1. Once development moved on to querying of web results. some of the intricacies of development stood out more than others. database file name. Sprint HTC Evo 4G and Sprint Samsung Moment. Additional functions on an AsyncTask allow certain operations to be performed on the UI thread specifically for 5 7. This figure shows debugging using a 10 inch tablet in the emulator. Since all database table and column names were in resource files. labels.Pocket Beer Reference Application for Android Mobile This application was tested on a Verizon HTC Droid Eris. this worked well. However. including application name. However. then any String located in that file can be accessed using R. so the lessons were coming almost nonstop. URLs. The answer to this was to thread all of a View‟s longrunning operations. While the data was being retrieved from the appropriate URL. 8. The application was tested using Android Virtual Devices for varying screen sizes. database column names. Those changes then rolled automatically into all files using the resources. 8.2. HTTP request headers and regex search strings. When a View was shown. These phones and emulators represent a variety of screen sizes within the range that the User Interface guidelines specified. Extending the AsyncTask class and including all long-running operations in that Task‟s doInBackground() function allows the UI thread to create an instance of that Task and execute it to ensure that all doInBackground() functions will automatically be executed on a thread separate from the UI. This section will serve to highlight some of those important experiences. This returns an ID. go out and get the necessary data and then perform rendering of those data values onto the View. database table names. the View would render and then immediately go back to the previous View. the decision was made in the beginning of this project to put every string in the application in a . Verizon HTC Droid Incredible.5 and up. the View would remain black. Android‟s built-in solution is called an AsyncTask. if the user had pressed the back button during the retrieval. 8. it would perform initial set up of the UI. the view would be rendered and shown as expected. When the data was finally received.getString() function to get the String itself.

8.1. as well as the inverse where a single BJCP Style mapped to several more-granular styles on BeerAdvocate. Scottish Export 80/-“. The progress indicator on this dialog would actively spin while operations of the AsyncTask were happening on a separate thread. BeerAdvocate has a single style called “Scottish Ale” whereas BJCP actually splits beers of this style into three categories called “9A. Specialty Beer” this means going out to ten separate style pages on BeerAdvocate and rolling up the results into a single list of beers. retrieve the results of each. The inverse example would be BJCP‟s style “11A. sort them by rating. The result was that a View would pop up and immediately show a ProgressDialog containing a message such as “Retrieving Top Examples”. In addition to creating AsyncTasks for each View‟s long-running operations. Scottish Light 60/-“. it gave the application a much snappier feel. For example. ProgressDialog objects were used to provide the user with a notification about the operations going on in the background. That particular case is 8. Most of these mappings were one-to-one. there were cases where multiple BJCP Styles corresponded to a single BeerAdvocate Style. they contain all of the possible BJCP Styles that the beer might fall under. since BeerAdvocate only has one style to provide ratings for.3. When multiple BeerAdvocate styles exist for a single BJCP Style category (like the „11A. “9B. For a BJCP Style such as “23A. This requires the app to go out to the top examples page for each BeerAdvocate style.2. throw all of the results into a collection. When the AsyncTask completed and the View was rendered in the Task‟s onPostExecute() function. and no more than 10 seconds on a slow 3G connection. Mild‟ example above) viewing the top commercial examples for that BJCP Style will actually query all of the corresponding BeerAdvocate Styles and create a roll up of those commercial examples.Pocket Beer Reference Application for Android Mobile onPreExecute(). Scottish Heavy 70/-“ and “9C. Long running data operations should run on their own thread and provide the user with notifications. In this project that 6 . When multiple BJCP Styles exist for a single style on BeerAdvocate (like the „Scottish Ale‟ example above). a mapping between the two had to be created by hand. since they affect different Views within the application. meaning that one BJCP Style mapped directly to one BeerAdvocate Style. There was a separate answer for each case. onPostExecute() and onProgressUpdate() types of UI updates. However. When the details for a specific beer within that BeerAdvocate style are rendered. viewing the top commercial examples for any of those three BJCP styles would present the same list of beers. and then present the resulting list to the user. Mashups Require Some Special Considerations While the end result of a mashup application is often easy to use and provides a seamless view of two or more separate sources of data. difficulty arose in the mapping between BJCP Competition Beer Styles and BeerAdvocate‟s own list of styles used to categorize all commercial beers on their site. Since BJCP and BeerAdvocate use different style lists. The entire operation takes only a second on a WIFI connection. since the user had progress notification and no longer lost control of the back button during data retrieval. Mild” which corresponds to two separate styles on BeerAdvocate called “English Pale Mild Ale” and “English Dark Mild Ale”. it can sometimes be tricky for a developer to get to that end result. Even though this didn‟t change the speed with which these particular Views were loaded and rendered. The application would have to be designed to handle both of these unbalanced mappings. the dialog would be hidden and the View would be available for user interaction.

attaching event handlers to the search field and search button. The 8. A ListView spans most of the space within the View with search controls sometimes on top and branding for BeerAdvocate sometimes on bottom. is that the views that render their data based on web responses will have to go out and retrieve those responses each time the screen is turned. This view contained a row of search controls with a search field.onRetainNonConfigurationInstance . 8. since it inherited much of its functionality from the GenericSearchableListView. it was a simple process to add its new View. an icon for clearing the search field. When a beer falls under a BeerAdvocate Style that maps to more than one BJCP Style. This adds data usage and battery drain that is completely unnecessary.3. The problem presented by Views that re-create on screen rotate. In the end. there turned out to be four: Search Styles. Android‟s answer to this scenario is the onRetainNonConfigurationInstance() function that is part of every Activity. clearing the search text when the clear button was pressed and going to the BeerAdvocate home page when the BeerAdvocate logo was pressed in the footer.1. This function is called by the system.4. However. Android provides another built-in piece of functionality to make the problem a non-issue. Search Beers. When the late addition of the flavor search feature came up. Each View was set up to show and hide components of the generic View as necessary and to hook up customized event handlers to the generic View‟s search components. when it is known that a new instance will immediately be created for the new configuration (Activity. and a search button. Below that row was the List View itself. 8. This makes perfect sense. This is not exactly intuitive and it presented some interesting challenges on this project. This strategy worked beautifully once completed. Generalize as Much as Possible By the time development was about halfway complete on this project. To simplify the addition of future List Views. All existing List Views were then refactored to use this generic View. Search Flavors and List Top Example Beers. Ignoring the style differences of each row within these views. Use onRetainNonConfigurationInstance() One intricacy of Android that took a bit of time to understand was the way in which Android renders Views.5.11 in the Appendix for a display with all of these controls in one View). all possible BJCP Styles are listed. Luckily. the structure is mostly identical. a View is also recreated whenever the screen is rotated and orientation is switched. a master view called GenericSearchableListView was created.Pocket Beer Reference Application for Android Mobile an excellent example of how a mashup application can make a complex operation feel seamless for the user. since the web response was already retrieved and the user never even moved away from the View that displayed that data. A class was then created with static functions to perform actions on this generic view. A single static function was created to hook up events that would occur for all instances of the view. such as setting 7 . that Activity‟s View steps through its onCreate() function. setting the hint text in the search field and grabbing the text entered into the search field. visibility of any of the components. Finally. Any time an Activity is spawned. it became clear that there would be quite a few ListViews in the completed application. attached to the bottom of the view was a row with BeerAdvocate branding (see Figure A. such as showing the clear button when any text was entered into the search field. as part of destroying an Activity due to a configuration change.Android Developers). It also shows that mashups often require consideration of edge cases by the developer to cover all possible scenarios.

Taste. the beers returned would be cached by BeerAdvocate Style ID.1. 9. However. This would provide the user with a quick method of finding fresh local examples of a style that he is interested in. and serve the purpose for which they were developed. This would aid in making decisions when visiting an establishment for a meal. the details would be cached by BeerAdvocate Beer ID. there are some improvements that could be made to make it even more efficient. This would fit well on the Beer Details View. These reviews are responsible for the overall score and grade for each beer. Many carriers are moving to tiered data plans. Top Examples and Beer Details Views all make web requests each time the user asks them to start. lazy loading of reviews would provide the best performance. Reading them is really the only way to determine what interesting characteristics a particular beer has. and it performs quite well. BeerAdvocate Reviews One popular piece of BeerAdvocate that was not included in this application is the Beer Review feature. The Beer Search. the user‟s location would be used to find local breweries. The Top Examples and Beer Details could definitely be modified to cache their data. Again. see available beers. For this project. which can then be retrieved with the getLastNonConfigurationInstance() function when the Activity is being recreated. and link from that list to some of the currently available actions such as beer details and associated styles. One of the first future improvements to this application would be the inclusion of individual reviews. With a dataset as large as the set of reviews on most BeerAdvocate beers. For Beer Details. 9. the application would be modified to grab the user‟s current location and show breweries that are close by. The end result is that all views in the application rotate with no delay and there are no repeated trips to retrieve data that was already collected. results from 8 . The new Activity was then rendered using the old data. BeerAdvocate members enjoy sitting down with a beer and judging its Appearance. which require their users to keep closer tabs on the amount of data that they use during each billing cycle. As a user nears the end of currently loaded reviews. Drinkability and Overall Impression. both of which are included in this application. For both of these. Phonetic Search Improvements Currently the phonetic features of the Flavor Search work well. Aroma. The beer offerings of those breweries would then be scanned to find matches of the given BJCP style.2. From the Browse Styles action. especially for Top Examples. This data would be utilized to create a couple of additional enhancements. BeerAdvocate Brewery Details BeerAdvocate maintains a list of breweries and associates each reviewed beer with its brewer. In both of these cases. If cache data exists. This caching would help to cut down on some unnecessary data usage. Misspellings by the user are caught and handled using phonetic matching. FUTURE ENHANCEMENTS 9. the application would spawn a thread to go out to the web and load more. which are likely to be shown more frequently than specific beers. 9. that meant that one dying Activity was able to pass object collections. where reviews could be loaded into a scrollable ListView. a function for “Find Nearby Examples” would allow the user to find beers of a particular BJCP style that are brewed nearby.3.4. Many individual beers on BeerAdvocate have well over 2000 total reviews. For Top Examples. Brewery details and reviews would provide the user with some information about the brewery‟s food offerings and the quality of service received. Since almost all breweries have an address. to the next lifecycle of that Activity. The individual reviews provide great insight into individual opinions of specific beers. Any time cache data exists for a requested BeerAdvocate Style or Beer. they will be dropped from the database and new data will be downloaded from the web. While this application was designed with data usage in mind. containing the data retrieved from the web. Mouthfeel.Pocket Beer Reference Application for Android Mobile function can return any object. The breweries themselves can then be reviewed and the list of all beers that the brewery offers can be browsed. instead of retrieving it all over again from the web. but the entries are expired. Caching of Web Data An important consideration when designing any web application is the amount of data that the application consumes. A design like this is used in Google‟s own Gmail application. the application would bypass the web request and render the View based on the cache. The user would be able to open a given brewery‟s details. 9. the cache entries would be given an expiration date based on a configuration setting.

The first match contains the word “harshness”. CONCLUSION This project provided me with an excellent gateway into mobile development and a return to the Java programming language after years of developing C# and ASP. L.homebrewersassociation. With improvements to ordering.com/search?q=beer Beer Styles. I feel fortunate to have had the opportunity to learn these new skills.com/f14/how-many-gallons-homebrew-2009-a99440/index184. currently a search for “harsh” returns three taste matches. The result of this project is an application that functions well and is architected to easily accommodate future enhancements.html#onRetainNo nConfigurationInstance() 9 .org/pages/government-affairs/talkingpoints How many gallons of homebrew in 2009? Forum Topic.com/software/dw/xml/xandbene1/x-andbene1-pdf.com/reference/android/app/Activity. I thoroughly enjoyed developing for the Android platform.howtobrew.divaportal.ibm.com/beer/style BJCP Competition Beer Styles.com/resources/dashboard/platform-versions. 18.1.pdf Burns. A Study on Architectural Alternatives and Client Performance.html Activity.android.com/section4/chapter21-2. Eastern Michigan University. http://www. REFERENCES 11. 11. J.dhe. http://public. American Homebrewers Association.NET code. Part 1: Explore the benefits of JSON and XML in Android Applications.com/files/iSEC_Securing_Android_Apps. Department of Computer Science.Pocket Beer Reference Application for Android Mobile that search are simply returned in the order that they come out of the database. the second contains two occurrences of the word “harsh” and the third contains one occurrence of the word “harsh”. MSCS Masters Candidacy Review Paper. This new mobile application will no doubt prove to be extremely useful and attractive to homebrewers and beer connoisseurs alike.html Google Search: ‘beer’ http://www. J. I have learned more in the three months that I have spent developing this application than I ever have on any other single project. For example. Web References How many homebrewers are there in the United States? Talking Points. https://isecpartners. (2008) Beer Judge Certification Program. as I hope to have some involvement in mobile application development in my future career activities.google. IBM DeveloperWorks. 6 (Jun. http://www.bjcp.php Palmer.org/2008styles/catdex. these results would be reordered to have the multiple exact matches appear first and the single partial match appear last. C/C++ Users J. 2000). Published References Speckmann. (2010) Using XML and JSON with Android. An introduction to making secure Android applications. 10. (1999) Is My Beer Ruined? Common Off-Flavors How to Brew http://www.homebrewtalk.pdf Knutsen.android. Beer Advocate.2. (2000). J. http://ntnu. (2009) Web Service Clients on Mobile Android Devices. MSCS Masters Candidacy Thesis.org/smash/get/diva2:348784/FULLTEXT01 Ableson. (2008) The Android Mobile Platform. http://www.emich. (2008) Developing Secure Mobile Applications For Android. http://beeradvocate. The double metaphone search algorithm.edu/compsci/projects/Master_Thesis__Benjamin_Speckmann. Some improvements should be made to the Flavor Search to provide an ordering that is based on relevance of matches. Homebrew Talk. Technical Library. Technical Publication.onRetainNonConfigurationInstance . iSEC Partners. 38-43. F. 11. Norwegian University of Science and Technology Department of Computer and Information Science. B.Android Developers http://developer. and I found Google‟s tools and API‟s to be easy to work with and well architected.html Platform Versions – Android Developers http://developer.pdf Philips. http://www.

choose „Install‟ and the application will be installed onto the device. Figure A.2 Select the Pocket Beer Reference Application from the resulting list of selections.3 At the security warning screen. Product Installation Figure A. . 10 .Pocket Beer Reference Application for Android Mobile APPENDIX A.4 Figure A. A new program icon will appear in the app drawer under „Pocket Beer Reference‟.1 Open the Android Market and search for „Pocket Beer‟ Figure A.USER GUIDE I.

Styles List View showing filtering function.Pocket Beer Reference Application for Android Mobile II.5 When the application is launched. III.8 Colored boxes next to each style indicate the average color that a beer of that style will be. the user can choose between the application‟s three main functions. Typing „Stout‟ into the search box filters styles down to only Stout Styles. Figure A. the activities view is shown. Browse Styles Activity Figure A. Main Activities View Figure A. 11 .7 Figure A. displaying all BJCP Style Categories.6 Choosing the „Browse Styles‟ activity brings the user to the BJCP Styles List. Here.

9 Choosing a particular style from the BJCP Styles List beings the user to a View showing all of that style‟s details.9 pulls the top 50 beers of the chosen style from BeerAdvocate.11 Pushing the “Go to BeerAdvocate Examples” button on Figure A. Figure A. 12 .12 When a specific beer is selected from the list. Figure A. Figure A.com and displays them in a ListView. the user is presented with that beer‟s details.Pocket Beer Reference Application for Android Mobile Figure A.10 Style details are shown in a scrolling panel with a text format that is easy to read and pleasing to the eye.

15 Entering a search term (beer name.13 Pressing “Go to BeerAdvocate Details” takes the user to the beer‟s home page on BeerAdvocate. Results are filtered by the application to include only links directly to specific beers. rather than news articles or forum topics. IV. Beer Search Activity Figure A. Figure A. beer characteristic) will populate search results from a Google API search. brewery name.com.16 When a specific beer is selected from the list.Pocket Beer Reference Application for Android Mobile Figure A. Figure A. the user is presented with that beer‟s details. brewery name are shown in the list. when possible. Beer name and.14 The initial Beer Search View presents the user with a search box prompting them to enter a beer search term. 13 .

Figure A.17 Pressing „Find Similar Beers‟ on the Beer Details screen will take the user to the top examples for that style. What’s That Flavor? Activity Figure A. the results are filtered down to flavors with characteristics that match the search term. Figure A.Pocket Beer Reference Application for Android Mobile V.19 Flavor Search initially opens with a search view populated with all 22 flavors prompting the user to enter a flavor search term.13. pressing “Go to BeerAdvocate Details” takes the user to the beer‟s home page on BeerAdvocate. using phonetic matching to catch spelling errors.20 As a user types a search term. 14 . Figure A.com. Words that were matched in the search are bolded and underlined directly within the results.18 As in Figure A.

So. BJCP Style Listing 2.bjcp.org/docs/xmlstyleguide. such as a Brewery Search. o Follow latest (2008) published style guidelines located at: http://www. o The Style List will have a search field. Figure A. Browse Styles and Flavor Search. So. “stout” would filter the results down to “Dry Stout”. “Oatmeal Stout”. shows that flavor‟s details including causes and remedies.21 Another example of the phonetic search feature.org. o The application shall provide an opening navigation screen to allow the user to choose between Beer Search. allowing the user to filter the displayed styles.Pocket Beer Reference Application for Android Mobile Figure A.  Style category will be searched.22 Choosing a specific flavor from the search view. 15 . This will provide a location for future activities to be located. “Sweet Stout”. etc. The application shall provide a complete list of BJCP Beer Style Guidelines for reference and comparison. REQUIREMENTS Features Activity Navigation 1.  Style name will be searched. APPENDIX B.zip o Obtain permission for usage from communication_director@bjcp. “13” would filter the results down to styles 13A through 13F.

com. with results isolated to pages on BeerAdvocate.com/f84/ebc-srm-color-rgb-78018/#post1874887 4. o The tops beers for a style should include the following information about each beer:  Rank  Beer Name  Brewery Name 5. which includes the following items:  Name  Category Number  Style Letter Designator  Original Gravity Range Low  Original Gravity Range High  Final Gravity Range Low  Final Gravity Range High  International Bittering Units Range Low  International Bittering Units Range High  SRM Color Range Low  SRM Color Range High  Alcohol By Volume Percentage Range Low  Alcohol By Volume Percentage Range High  Aroma  Appearance  Flavor  Mouthfeel  Impression  History  Comments  Ingredients  Examples: The few example beer names included with the BJCP style listings should be eliminated. pushing the link for a search result shall take the user to a view with details about that specific beer. 16 . o Each style’s SRM color range should be averaged and shown in its details view.com using an available data connection. a button or link shall provide the top rated beers for that particular style. Google will be polled using the search term. From the Google search results. A mapping between SRM color units and HEX color values can be found here: http://www. o o o The application shall provide a View that allows the user to search for specific beers by beer or brewery name. This action shall also be Top Beers of BJCP Style Beer Search Beer Details 6. rather than raw URL. o The top beers for that style will be fetched from BeerAdvocate.Pocket Beer Reference Application for Android Mobile BJCP Style Details 3. From a given style’s Details View. since this application’s purpose is to map styles to a live view of related beers on BeerAdvocate.com. Selecting a specific style from the BJCP Style Listing shall provide the full set of that style’s details. From the Beer Search View.homebrewtalk. Using an available data connection.com will be listed for the user. links that lead to specific beer pages on BeerAdvocate. The listed links themselves will be displayed as beer and brewery name.

17 . The application shall employ a common Android theme using a black background with white and grey content text. shall contain logos and/or text descriptions crediting the owner. 11. square and landscape orientations. The logo and branding for the application shall be custom designed by the application developer. o The following information should be shown for the “off flavor”:  Flavor / Compound Name  Flavor characteristics  Causes  Remedies User Experience Color Scheme Device Compatibility Orientation Logos Third-Party Branding 9. The application shall provide a View that allows the user to search for common “off flavors” by providing a flavor characteristic term. Views that contain data from third-party providers such as BeerAdvocate and the BJCP. The following information should be shown for the beer:  Beer Name  Brewery Name  Brewery State (if an American beer)  Brewery Country  Average Rating  Letter Grade  Alcohol By Volume  Physical image of beer  BJCP Style(s) that the beer falls under The BJCP Style(s) displayed for the beer will be links that will take the user to the BJCP Style Details View for that style if pressed.Pocket Beer Reference Application for Android Mobile o o o o accessible by choosing a beer from the Top Beers of BJCP Style shown in Requirement #4 above. From the Flavor Search. 13. 10.com page for that beer if pressed. A button or link on the view will take the user to the BeerAdvocate. o Flavor Details 8. Flavor Search 7. All Views should scale gracefully to any screen size that might be encountered on an Android device (anywhere from 2. The search should take spelling errors into account to allow users to find characteristics despite misspelling or partially spelling their search terms. A button or link will take the user to the Top Examples that are similar to the beer being viewed. pushing the link for a flavor result shall take the user to a View that provides the details of that specific “off flavor”. 12.8 to 10 inches diagonally). All Views within the application shall be rendered correctly in portrait.

Android has no Layout type that wraps contents. This mapping will be downloaded on the first launch of the application and stored in a local database. and stored in a local database. parsed. This will allow the application to be used as a style reference in situations where a data connection is unavailable. inversely.Pocket Beer Reference Application for Android Mobile Graphics 14. storing BeerAdvocate styles. will cut down on the data required to retrieve from the web when example beers are requested. Use graphics for each navigation option. parsed. Requirement: The application shall provide a complete list of BJCP Beer Style Guidelines for reference and comparison. BJCP Style Listing 2. o o 18 . APPENDIX C. A mapping of BJCP Style Categories to BeerAdvocate Style Numbers will be created by hand at design time. move the second row icon to the first row. and stored in a local database. o o Requirement: The application shall provide an opening navigation screen to allow the user to choose between Beer Search and Browse Styles. BeerAdvocate styles will be downloaded on the first launch of the application. See Twitter for Android for a good navigation screen example. This mapping will allow the application to find associated beers when given a BJCP style and. BJCP styles when given a specific beer. Parse BJCP Styles XML files on first run and move all data from the XML files into the database. showing two rows of activity icons in portrait and one row in landscape will require manual movement of activity icons when the view is created. Can be reused for Beer Search View and Style Top Beers View. Check the orientation and. which very seldom change. All other application graphics shall be custom designed by the application developer. Mapping BJCP Styles to example beers will still require an internet connection. SPECIFICATIONS Part 1 – Data Specifications Database BJCP Styles o BJCP styles will be downloaded on the first launch of the application. Define a generic list view with search box. BeerAdvocate Styles o BJCP to BeerAdvocate Style Mapping o o o Part 2 – Feature Specifications Features Navigation 1. Therefore. However. if in landscape mode.

Requirement: The application shall provide a View that allows the user to search for specific beers by beer or brewery name. o o o Flavor Details 8. Populate “off flavors” data to database on first run of the application. Using the BA Style Number. Top Beers of BJCP Style o o Beer Search 5. o Displaying Style Color:  At design time.  After populating the Details View.  Set the background of the beer color view (graphic) to the resulting hex color. a button or link shall provide the top rated beers for that particular style. In those cases. beer rating values.com/search?q=<SEARCHTERM>+site:beeradvocate. convert to Integer and retrieve the corresponding color value from the color table.num =100 Use RegEx to pull necessary information from results.  Average the Low and High values. 4.com&amp. Use specific Google URL used for searching a particular site’s results: http://www. pushing the link for a search result shall take the user to a view with details about that specific beer. beers from all associated BA style pages should be retrieved and the result set should be sorted based on beer rating points. and beer urls. Use Apache Commons implementation of Double Metaphone algorithm to encode all flavor characteristics on database population. Double Metaphone encode each search term and compare to the values in the database. Requirement: Selecting a specific style from the BJCP Style Listing shall provide the full set of that style’s details. The view will be handed the BJCP Style ID. Pull BeerAdvocate style number from page and map to associated BJCP Styles. Requirement: The application shall provide a View that allows the user to search for common “off flavors” by providing a flavor characteristic term. brewery names. certain BJCP styles will actually map to multiple BA styles.Pocket Beer Reference Application for Android Mobile BJCP Style Details 3. o Requirement: From a given style’s Details View. Requirement: From the Flavor Search. RegEx searches should be used to pull out beer names. Requirement: From the Beer Search View. a URL to that style’s top beers can be polled and scanned to generate the list of top beers. define a table of hex color values associated with SRM integer values. o o o Flavor Search 7. beers will be retrieved already in ranked order. pushing the link for a flavor result shall take the user to a View that provides the details of that specific “off flavor”. Return associated “off flavors” for the matches. retrieve the SRM Low and SRM High values. If only a single style page is polled from BeerAdvocate. The BJCP-to-BA style mapping table in the database can then be used to get the associated BA style number. o o Beer Details 6.google. o The following information should be shown for the “off flavor”:  Flavor / Compound Name  Flavor characteristics  Causes 19 . Pull image link and use secondary InputStream to download image of beer for displaying with details. However. Use RegEx to pull necessary data from the beer’s page on BeerAdvocate.

This is Android’s primary way of ensuring identical viewing experience on different devices. shall contain logos and/or text descriptions crediting the owner. o ALWAYS use device independent pixels (dip or dp) for sizing objects. square and landscape orientations. All Views should scale gracefully to any screen size that might be encountered on an Android device (anywhere from 2. 12. Orientation Logos Third-Party Branding Graphics 20 . o Application logo will be derived from mask used to show beer colors on Beer Details View. Requirement: All other application graphics shall be custom designed by the application developer. o ALWAYS use device independent pixels (dip or dp) for sizing objects. Use XML styles file to centralize and standardize styles. o Requirement: The application shall employ a common Android theme using a black background with white and grey content text. Requirement: The logo and branding for the application shall be custom designed by the application developer. Requirement: Views that contain data from third-party providers such as BeerAdvocate and the BJCP. o Avoid use of AbsoluteLayout. Requirement: All Views within the application shall be rendered correctly in portrait.Pocket Beer Reference Application for Android Mobile  Remedies User Experience Color Scheme 9. 13. o Credit logos will be included in the GenericSearchableListView for easy application to any View.8 to 10 inches diagonally). Device Compatibility 10. These layouts are deprecated as they make it too easy to create discrepancies in layouts between devices. This is Android’s primary way of ensuring identical viewing experience on different devices. 11. 14.

Sign up to vote on this title
UsefulNot useful