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

Sep 21, 2015 ryan's Blog

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

Im not a computer scientist, Im not an expert programmer, and Ive never taken any classes on the subject; Im 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 Inventors 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 didnt 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 couldnt decide what, I could open this app, hit the button, and voila! An answer!

Taking care of the apps 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 wasnt 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). Id 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 wont show up more than once, but so far I have had no success. Im entirely confident its possible to do, I just have to figure it out!