Social Icons

Ryan's picture

Making the Hilltop Sunset App Part 1: Wheel-O-Songs, a List Randomizer

Today I built my very own original app on MIT App Inventor.

I’m not a computer scientist, I’m not an expert programmer, and I’ve never taken any classes on the subject; I’m just a singer/songwriter with a degree in English and Creative Writing--and a dream. But even with literally zero knowledge of coding, MIT App Inventor’s simple building-block style (with the help of a handful of tutorials scattered about YouTube) allowed me to take a basic concept and turn it into a functional program within a little over an hour.

I didn’t start with any particularly revolutionary ideas; I just thought it would be fun to have a program that would randomly select one of my original songs at the push of a button. That way, if anyone ever wanted me to play something and inevitably couldn’t decide what, I could open this app, hit the button, and voila! An answer!

Taking care of the app’s design was quick and simple: the display was shown immediately and a list of items--buttons, lists, images, etc.--was available for me to drag and drop, adding them instantly to my app and providing me with a list of options to customize how each item appeared on-screen. All I needed for my app was a single button that read “Wheel-O-Songs” and I was good to go. I changed the font color, background color, centered it, enlarged it, and was ready to work on making it a functional button.

Though the language and functions of App Inventor did take some getting used to, fluency comes with practice. The majority of blocks are fairly easy to understand, provided you read them with the right mindset. In most instances the blocks read as normal English, but stripped down to only its essential, basic components. For example, there is a block that reads “When Button1 .Click, do _______,” and you can fill in the blank with any number of command blocks. Basically all that block means is, “When Button1 is clicked, it will perform the command ________.” I used this block in my app in conjunction with a “randomize list” command block so that when my Wheel-O-Songs button is clicked, it randomly selects an item from a specified list and changes the text of the button to the new selected item.

I quickly discovered the blocks are not always self-explanatory to newcomers. For instance, the “initialize global” block confused me at first, since I wasn’t familiar with the concept of global variables or what exactly that meant, or how it could be useful for my app. As it turned out, the “initialize global” block allowed me to host a long list that I could then access through the much simpler “get” block. I could then continue to use the “get” block within other functions, rather than deal with a 16 item list over and over again. This is especially useful when utilizing a list over multiple other functions, because it saves time and space.

My app was not complicated by any means. It only required a total of two different “buildings” of blocks: the first specified what the single button on my app would do (select a random item from a specified list), and the other held the information for the list that was being randomized (a 16 item list of original songs). I’d like at some point to also figure out a way for items on the list that have already been displayed to be removed from the list so that songs won’t show up more than once, but so far I have had no success. I’m entirely confident it’s possible to do, I just have to figure it out!