teaching machines

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 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>”); […]

CS 145 Lab 3

Our variables aren’t just simple numbers anymore. We’ve got complex objects like String and Scanner at our disposal. Today we’ll give you some more practice at using objects that others have made available. Reminder Be sure to get your checkpoints from lab 2 checked off in the first 20 minutes of this lab. They should […]