I am starting to rework the RedQuark website. If you are looking for something that used to be on RedQuark.com but cannot find it, drop me a line or leave a comment and I will try to accommodate you.
Switching Tracks
Clearly, my plans for posting within the week did not pan out. What is more, I have temporarily stepped away from learning Android development to get a nanodegree in iOS development. Toward that end, I am currently involved in the “Intro to iOS App Development with Swift” class.
I am generally pleased with the class so far, although I have a great deal of familiarity with iOS app development already. Swift is new to me — of course, because Swift is a new language to everyone — but not much of the course has been about Swift. We have been promised more Swift in a future class toward the iOS Developer nanodegree.
I can tell Udacity has been learning more and more about what makes a successful online course. We are being strongly encouraged to participate in the forums and to create a community. In that vein, we are supposed to make a blog post about some particular subject. I need to go back and find that request and make that post here, but I am once again out of time, so look for that in the next post.
Back On Track
I am somewhat mortified to discover that 1) it has been a month since my last post, and 2) I have not yet finished Lesson 2. That is partly because the lessons for Android Development appear to be very, very long, but it is mostly because I have been busy with other projects. I think I was penny-wise (by signing up for the discounted course) and pound-foolish (by signing up for the course before I was really ready to begin). Other projects are out of the way now (for the time being anyway) and I am therefore back on track!
I find that I am enjoying the course a great deal. The presenters are very good and quite entertaining, in a geeky sort of way. Being a computer geek myself, I can appreciate geeky humor.
I can tell that Udacity and Google have learned a lot about how to present an online course since my having taken the previous course in HTML5 Game Development. The principal improvements all have to do with keeping the content up-to-date. The course would be a disaster without this upkeep, because it is clear on almost every page (slight exaggeration) that Android Development is a moving target. Even the open source weather data API changed out from under them!
I am somewhat disappointed in the approach however. Building the Sunshine app is a great idea for the centerpiece of the class, but the lessons are all tending to fall into the same, mostly unhelpful pattern:
- Step A) We want you to go out into the Internet and find out how to do this thing
- Step B) Do the thing in the Sunshine app
- Step C) Run the app
- Step D) Click this button saying you have done Step B and Step C
- Step D2) Answer this question proving you have done Step B and Step C
- Step E) Watch as we explain how we did it
As a software developer, I know this is how a great deal of software is developed (with the exception of Step E — we seldom get to see someone explain how we should have done something). As an educator, I know this is a terrible way to teach people.
It is a much better plan to explain material first, and then have the student attempt to integrate and use that new-found knowledge. It would not be enough to just present the working Sunshine code first though. At first you need to present the new information outside of the context of the Sunshine app.
As an example from Lesson 2, consider the UriBuilder. After a very brief discussion of why we might want to use UriBuilder (which I believe is actually Uri.Builder), we are told to “Use UriBuilder to build up the URL” without any instruction even hinting as to how to do that.
A properly scaffolded lesson would introduce the UriBuilder first, with an expanded discussion of why and how to use UriBuilder. This discussion should not mention the Sunshine app or require doing anything with the Sunshine app’s code. This would be a standalone mini-lesson about what UriBuilder is, why you might want to use it, and how to use it when you do use it.
The mini-lesson would conclude with a few questions (in other words, a short quiz) about UriBuilder and how to use it to create particular URLs. It would not hurt to spend a few moments talking about the difference between a(n) URI and a(n) URL, or to at least present that information in a sidebar. (Does Udacity even have sidebars? I don’t think so in the sense I mean, but you could put the information or a link to it in the Instructor’s Notes.) That difference really has nothing to do with Android Development, but it is the kind of thing you would expect to see in a book or (especially) a text book.
Once the student has demonstrated some context-free mastery of UriBuilder, only then should you ask her to “Use UriBuilder to build up the URL” used in the Sunshine app. Learning how to use UriBuilder and using UriBuilder within our Sunshine app are two very different things. By combining the two, Udacity and Google have made learning more difficult than it needs to be. And this is only one example. Lesson 2 is full of these missed opportunities to teach better.
I hope to comment more on the class in the coming weeks. My next post will hopefully be within a week of this one. Until then!
Finally Done With Lesson One
I am finally done with lesson one. I can tell already that the lessons are too long for the brief periods of time I have available to work on them, at least this past week. It has been somewhat frustrating because of that. I need to set aside bigger chunks of time. I wish that I were only paying for when I am actively using Udacity, instead of the clock running all of the time whether I am online using the web site or offline doing something else.
The lesson was not too frustrating until the end where things got really confusing between when they were using TextViews and when they were using ListViews. It would also help matters a great deal if they would spell out what variable names to use instead of me having to go back to my code and say, “Oh, I called that a widget when they called that a whatsit.” Most of the time, our variable names are in sync because we are both using logical names, but sometimes the good-name space is just too large.
And I am fairly certain that “listview_forecast” was originally “list_item_forecast” in an earlier video. “listview_forecast” is the better name, but only if you actually assigned it to the ListView earlier instead of “list_item_forecast”! On the positive side, I can tell that developer.android.com is going to be my new best friend, along with the excellent book on Android development that I just purchased.
Hello, Sunshine!
I mean to keep track of my time in this course, just to compare to what Udacity has listed. Keep in mind that I usually go more slowly and more in-depth than average, just because I feel like I learn more and learn better that way. Anyway, I have spent about three hours so far on the course, mostly because of the time necessary to download and install Android Studio.
The title to this blog post refers to the “Sunshine” app that we are building in the course and the “Hello, World!” app from which we are starting. I have successfully downloaded and installed Android Studio and created the initial app as laid out in the course.
There were a few stumbling blocks however. First of all, be certain to work from the online Google Doc as your primary reference. It is much more up-to-date than the course videos.
My biggest speed-bump was getting to the SDK Manager. You can’t get there, or at least I could not get there, from the initial install of Android Studio 0.8.0. (The SDK Manager is listed, but it is grayed out and unselectable.) It is/was necessary to update to 0.8.2.
The twist is, I had launched the update to 0.8.2 prior to trying to get into the SDK Manager, but for whatever reason the SDK Manager was not immediately available. It only mysteriously made itself available after an unmeasured amount of time after I thought Android Studio had finished upgrading.
A minor issue is that Gingerbread does not appear to be an easily selected option for minimum supported version anymore. Following the directions in the Google Doc does eventually get you around this limitation however.
Bottom line: Use the Google Doc and be patient!
Developing Android Apps
I have decided to try Udacity’s “Developing Android Apps” and so I have also decided to return to this blog to write about it. Today is Day 0. I am downloading and installing Android Studio as I write this. I will write more about it tomorrow.
And as for the over 500 spam comments to my previous posts since the last time I checked in, I am sorry but all of your comments are caught and discarded without ever having seen the light of day. If you happen to be a real person reading this blog and you want to leave a real comment, I promise you that I will review it and release it as quickly as possible.
Certified!
I finally received my HTML5 Game Development Certificate. Along with the certificate, I received an evaluation of the project. I would have preferred a much higher score, but considering my complete lack of time to devote to the project, I think it is an almost fair evaluation.
My score seems to have suffered greatly for not putting the code into an online repository. I had already come to the same conclusions about online repositories myself, and since Maxwell’s Demon, and before receiving this evaluation, I have moved all of my code for my other projects into BitBucket. Oddly, my reasons for doing so have less to do with those given in the evaluation and more to do with issue tracking. Either way, the results are the same: more robust programming.
I am also disappointed that I got dinged for having files and classes in the project that are not used, because we were explicitly told to use the files and classes we were given in the online class. Had I been given free reign to start from scratch, I guarantee Maxwell’s Demon would be much, much cleaner and more elegant code.
I suppose now that the course, certificate, and evaluation are complete that I am free to do just that. And perhaps I will in the future. For now though, my focus is on Steampunk Road. Since that is my current project, that is where I am doing my current blogging too, should you wish to read more of my online ramblings.
The Tiled Map Is Working!
I really did not think it would get done, but thanks to the delay in the exam, I did! Maxwell’s Demon now has a “map” in the background. I don’t know which version of TILEDMapClass.js I was originally working with, but it was a bug-filled disaster. I went back and got a new copy from the very end of the Atlases unit and it only had one bug I needed to change: “data.requestText” should be “this.requestText”. There was some strangeness with my original image because of unwanted margin and spacing, but that was easily rectified.
The only thing I never got around to fixing was the loading of all of the sounds before launching the game.
‘hs’ != ‘js’
While waiting for the exam to come online (and waiting … and waiting …) I decided to put the time to good use and see what broken bits of Maxwell’s Demon could be fixed. The failure to load spritesheet.js was the most mysterious, so I pursued that first.
Turns out it was not much of a mystery. I simply mistyped ‘spritesheet.js’ as ‘spritesheet.hs’ (the ‘H’ key being right next to the ‘J’ key on my keyboard). Because ‘.hs’ was not a recognized file extension, the asset loader could not load it. I cannot tell you how many times I looked at that file name and did not notice that the file extension was not ‘.js’.
Unfortunately, because of the unknown file type and the way the asset loader was written, the asset loader was waiting for one more file than it was ever going to load — not the ideal behavior. A better behavior would be to notify the person trying to load the unknown file type in an alert and offer the option of aborting the program or ignoring the missing file and continuing on. Something else for when I have more time.
Now back to waiting ….
Reflection
While reviewing and studying for my exam, I can’t help but reflect back on the subject of “sanity checks” in game code. These are the “if-then” statements that look for null pointers, variables with values outside of their domain, etc. — in other words: bad code. For a small game such as “Maxwell’s Demon”, such checks really don’t make much sense because each of those possibilities is essentially going to be an unrecoverable error that needs to get fixed anyway, and the sanity checks only serve to slow down the code.
When the sanity checks become important is when the code gets re-used or repurposed. “Engines” and “libraries”, especially those meant to be used by teams of programmers or released to the public for inclusion in multiple projects, absolutely need this stuff. You always want the programmer using your code to know the problem is his code and not yours. Toward that end, it makes sense that your library code throws meaningful and helpful error messages whenever possible. Because these error messages are usually not meaningful to the end user though, it is a good idea to let the programmer who is using your code to toggle whether error messages are displayed or not. In fact, you might even want to provide two versions of the code: one with sanity checks and error messages (for ease of programming) and one version stripped of all such checks and compressed such that it takes up a minimum of space and time.
I regret that my code lies on neither extreme at this point. It has not been optimized for re-use, nor has it been optimized for speed. As such, I really don’t recommend trying to use it at this time (even though I have made it available). Typically i write much better code, but the time constraints and the desire to use the existing code from the course have resulted in the less-than-ideal code on this project.