ChannelSurfing.jpg

Goal: To create an app that starts and stops music when you press a button.


Check out this video to see a preview of the app.



Design



1.Start a new project. Create a **title for this app and call it: Your first initial and last name followed by "Surfing" Example: MMouse_Surfing


2. Create a button with an image instead of a text.

a. Add an **image to your button.
b. Rename your button component
Note: App Inventor can be a bit rude. If your file name is complicated (special characters), it may just ignore you.

3. Add a Player component to the viewer, this will allow music to be attached to our button.

a. Rename the player to something meaningful. Don't be tricked into thinking names like "hello" or "meow" are funny.
b. Add a sound file to the player. Here is a clip of funny sound effects you can use. Right click and select "download linked file as". Save it as mp3 to your computer. You can also create your own sound file!
c.We want to keep playing the sound file over and over. Add Loop option.
d. Adjust the **volume.


4. Compare your screen to the screen below.

***Keep in mind that my title and picture will be different. But check that you have a button as picture, a title, and that your button is aligned properly.
ScreenCheck.png


Blocks - Remember that you need to supply the instructions to add functionality.



5. Add a when.Click block for your button.


6. When you click the button it will either START playing or PAUSE playing. Each time you press the button it will do the opposite of what it was doing before.

A) Drag in a call.Start and call.Pause argument to your window.

B) You will need an **if.then.else block to complete this code. Add this if.then.else control to your when.Click block to tell your player to start and pause.


7. Adjust the volume of your music.


8. Test out your App!


Challenges

1. (**) Download two songs. When the first finishes playing, play the second.