CS 491 Lecture 7 – Persistence of Ketchup
Agenda reflecting preferences in summaries actually setting default preference values inspecting files with adb restoring a paused game incorporating word categories passing information to spawned Activitys Updating summaries You can set a preference’s summary with: EditTextPreference pref = (EditTextPreference) getPreferenceScreen().findPreference(getString(R.string.goal)); pref.setSummary(“The first team to ” + prefs.getString(getString(R.string.goal), “0”) + ” wins”); So, how can you […]
CS 145 Lab 4
Last lab we looked at methods. Grasping this idea of pushing out sequences of instructions to these standalone “subprograms” is of utmost importance to your proper understanding of computer science and programming. It’s so important that this week’s lab does not introduce any new topics. Please take the time to ask questions and resolve any […]
CS 145 Lecture 6
Topics Covered what does this do? facing off the computer in guess-a-number generating a random spelunking workout an acrostic editor calculating average cell phone payment What does this do? public static String ?(??) { return text + ” :)”; } public static ? ??(String text) { return text.length() == 0; } public static ? ??(String […]
CS 145 Homework 1 – due before Tuesday, 10/4
See the PDF. Download speccheck_hw1.jar. Internet Explorer has an annoying habit of renaming this file. Make sure it ends in *.jar and not *.zip.
CS 145 Lecture 5
Agenda revisiting method anatomy put yourself in the method’s shoes: what am I trying to do? what do I need to give back? what outside information do I need in order to perform my job? how arguments are passed method improv Code GeometryFun.java package lecture; import java.util.Scanner; public class GeometryFun { public static void main(String[] […]
CS 491 Lecture 6 – For all Intents and Preferences
Agenda Review cleaned up Ketchup Starting up other activities Adding a menu Incorporating user preferences Refactoring Ketchup I cleaned up our mess of Ketchup a bit. The biggest issue was properly sequencing the user interaction so that the timer doesn’t start until team names have been entered. Team names are displayed on the screen with […]
CS 491 Lecture 5 – More Ketchup
Agenda Generate and advance words Add a timer Talk about Android threading Add an award-point dialog Add a team name dialog Splitting layout evenly Last lecture, someone asked how to split the layout up independent of the widget’s content. The way to do this is to have the containing view group fill its parent, set […]
CS 491 Homework 1 – due before Friday, 9/30
See the PDF.
CS 145 Lecture 4
Agenda finish up KML example don’t repeat yourself method anatomy method’s beauty: minimize bug potential encapsulate small, testable units make calling code more readable some more examples Code Placemarker.java package lecture; import java.util.Scanner; public class Placemarker { public static void main(String[] args) { System.out.println(“<?xml version=\”1.0\” encoding=\”UTF-8\”?>”); System.out.println(“<kml xmlns=\”http://www.opengis.net/kml/2.2\”>”); System.out.println(“<Document>”); System.out.println(“<Style id=\”seethrough\”><PolyStyle><color>7fffffff</color></PolyStyle></Style>”); handlePlacemark(); handlePlacemark(); handlePlacemark(); System.out.println(“</Document>”); […]
Tiny Flashlight Review
The application I chose to review is a simple flashlight program, appropriately named Tiny Flashlight. There comes a time in every man’s (or woman’s) life in which they need a flashlight, but the only convenient source of portable light is in a cell phone, which is much more often carried. However, sometimes this cell phone […]