Tuesday, June 26, 2012

Smartphone Development - Week 6 - Project WordLord

This week, I tested WordLord with my team from a different course. The feedback has been positive. We found several bugs for me to fix. I have also created a demo video for WordLord and posted it on YouTube. It is available here: http://www.youtube.com/watch?v=dnw-sPYOXEM

I am going to keep the application in its current state for the rest of the week. Remaining and additional features will be added in the second Smartphone Development course.

EDIT: I have tested the WordLord application on a tablet device running Android Honeycomb (v. 3.2). The game looked and worked just fine. I may need to work on a better layout for tablets in the future.

EDIT 2: I have enabled all of the options currently present in the game. I now have to add the ability to edit team scores, as well as add functionality for customizing word lists.

Thursday, June 21, 2012

Smartphone Development - Week 5 - Project WordLord

The basic part of WordLord is now complete. My next goal is to work on the options of the application, which will differentiate it from its competitors. A screenshot of the application in its current state appears below:


Sunday, June 17, 2012

Smartphone Development - Week 4 - Project WordLord

I have added a few features to WordLord, including one that pauses the game if the home button is pressed, or if a phone call is received. The game can be resumed from the same point. I have also found a review of a competitor's application, PhoneFraze. My long-run goal is to make my application have more/better features than PhoneFraze, as well as create a sleeker user interface. 

EDIT: I am now around 60% done with the user interface. I will spend the rest of the week working on it, as well as adding options and features to the game.

Thursday, June 7, 2012

Smartphone Development - Week 3 - Project WordLord

I have decided to go with the word game idea and came up with a name for the application - WordLord. I have come up with a basic UI layout, as well as a state machine. These items will be used as reference while coding the application. Speaking of coding, the development of the application is in full swing. The game is now "playable" - no words are generated, but a placeholder function serves a different word every time the button "Next" is pressed, or the device is shook. My next step is to work on the dictionary and the game options.

EDIT: I have now completed the first version of the dictionary. In order to randomize the words, I made two lists. When a word is served, it is moved to the second list. When the first list runs out of words, the words from the second list get moved back to the first. The index of the chosen word is randomly generated. Every time the list is traveled through, the order of the words will change. Thus, the same word should not pop up often. The dictionary currently contains over 900 words, which should satisfy a play session of over an hour.

Tuesday, May 29, 2012

Smartphone Development

I have recently enrolled in an introductory smartphone development course at my university. From this point on, the blog will focus on my progress within the course. The professor required me to come up with several ideas for android applications.  Below are my ideas.

Catchphrase-like Game with a Custom Dictionary
  1. Purpose: create a game similar to Catchphrase. The game will have a settings mode that would allow users to add their own words and phrases to the dictionary that will be used by the game.
  2. Market analysis: PhoneFraze is an application that has a similar goal. However, there are several issues with it. For example, users complain that it repeats the same words within a round of play - something that should never happen in such a game. Should I make the application, I would allow the word list to be expanded, so that users do not have to keep playing with the same set of words.
  3. Initial development plan:
    1. Create a simple UI layout with all of the elements required for the game
    2. Determine which data structure would be best for storing the dictionary
    3. Determine how to randomly pick a word
    4. Determine how to keep score
    5. Implement a countdown timer
    6. Implement a buzzer mode (to be used on others' phones in the case that the player states one of the words that they are having their teammates guess)
    7. Improve the UI

Effort Log Editor for My University
  1. Purpose: allow a user to log into the university account and edit effort logs on a smartphone within a visually appealing interface.
  2. Market analysis: no such application exists - students currently must use a mobile browser in order to access the sluggish effort log interface. A mobile application would be useful to any student with an Android phone at the university.
  3. Initial development plan:
    1. Find out whether the application is viable (need to see whether can log into university accounts using Android account manager; need to see whether can get access to the university's website) 
    2. If the application is found to be viable, work on a visually appealing UI
    3. Implement functionality to add courses
    4. Implement functionality to select effort types
    5. Implement functionality to input effort for logging
    6. Implement functionality for viewing previously logged effort from past weeks
    7. Implement functionality for adding up the total effort for a particular course, effort type, semester, or school year and displaying the amount to the user

Spreadsheet Editor
  1. Purpose: create a simple spreadsheet application for quick data organization and calculations. If there is time, expand the application to allow visual representation of data via graphs.
  2. Market analysis: there are many spreadsheet applications available in the Google Play store. However, most of them are intended to work with Excel file formats. Many of the top rated applications cost money. There is a free spreadsheet application, Simple Spreadsheet (free/ads), but users have been reporting lack of functionality, such as the inability to compute 4 or more cells together.
  3. Initial development plan:
    1. Look for open source spreadsheet calculation code
    2. Determine how to use data structures appropriately for storing spreadsheet data
    3. Create a visual layout for a spreadsheet application
    4. Combine the calculation code with the visual layout
    5. Work on advanced functionality, such as adding all values in a given row or column
    6. If there is time, add graphing capabilities

Friend Scheduler
  1. Purpose: I have had experiences with many instances in which my friends and I agree to meet somewhere at a particular time. Unfortunately, someone always ends up being late because they underestimated how long it will take them to get to our meeting location. I would like to create an application that will tell the users when to head out from their current location to make sure that they arrive at the meeting place just on time.
  2. Market analysis: I was able to find a similar application in the Google Play store - saambaa. The application allows users to create events and share them with their friends, as well as get directions to their meeting location. However, it does not provide functionality for telling the users when they should be leaving for the meeting location.
  3. Initial development plan:
    1. Determine how to obtain the current GPS coordinates of a user's phone
    2. Determine how to query the Google Maps API on Android with a start and end address, as well as obtain the time for the quickest route to the address
    3. Consider other functionalities that may be included, such as allowing the user to specify additional stops and the time for such stops (e.g., in cases where a person may be offering a ride to a friend)
    4. Consider including group text messaging/communication functionality, such that a planned destination on one phone can be sent to the phone's user's chosen contacts

Multi-timer
  1. Purpose: allow users to keep track of multiple timers and/or stopwatches at the same time. The timers will be displayed on one page and will turn different colors when the time runs out, so that it is easy for the user to see which of the timers has expired. The timers will be allowed to have a short description label for easy tracking by the user.
  2. Market analysis: there are hundreds of applications available on the Play Store that offer the functionality of both stopwatches and timers. However, there does not seem to be an abundance of applications that allow running multiple timers or stopwatches at the same time. A multi-timer application would be very useful to many. It was requested of me by a graduate physics student who would like to use it in his physics lab.
  3. Initial development plan:
    1. Determine whether it is possible to run multiple timers at the same time in one application
    2. Learn how to make a simple timer application
    3. Learn how to make a simple stopwatch application
    4. Create an application that allows the user to create multiple timers, each of which can be started and stopped independently

I will choose one of the ideas above and work on the chosen project throughout my last semester.

Sunday, April 29, 2012

Bowling Game Kata


Today, I have completed the Bowling Game Kata. Below are my notes:

  • It took me three three hours to complete.
  • I wanted to do this kata because I was interested in learning how scoring of bowling games worked.
  • The kata ended up very frustrating, because I had to refactor code extremely often.
  • The problem seemed like a great exercise for TDD.
  • I was able to see where I was not following DRY principles. It was easy for me to convert non-DRY code to DRY code. I am feeling more confortable with constantly thinking about DRY as I am coding.

P.S. I would have to say that my level of self-awareness of copying code was IV during this kata. Please see what the levels mean in my learning plan.

Wednesday, April 25, 2012

Simplifying Time Conversion

Recently I refactored some old code with a friend. The functions we were writing allowed us to practice both TDD and DRY. We demonstrated the code to our class yesterday and immediately, many constructive comments were offered. It immediately made me feel that I was back to Level I. However, I would like to share what I learned about the Java String.format() function.

Here is the code my pair programming partner and I came up with for this self-explanatory function:

public static String monthDayYearToString(int month, int day, int year) {
  String monthString = Integer.toString(month);
  String dayString = Integer.toString(day);
  String yearString = Integer.toString(year);
  
  if (month < 10) {
    monthString = "0" + monthString;
  }
    
  if (day < 10) {
    dayString = "0" + dayString;
  }
    
  String formattedDate = monthString + "-" + dayString + "-" + yearString;
  return formattedDate;
}

Here's the refactored code:

public static String monthDayYearToString(int month, int day, int year) {
  return String.format("%02d-%02d-%d", month, day, year);
}

Neat! I wonder, what other tricks could save developers like me from writing unnecessary and potentially copied code?