In the last episode we edited the app called HelloPurr. Now we will do the programming work of our designed HelloPurr app with block editor. But you don't have to have any programming knowledge to do programming here.
Is your block editor open? If not, open it. To open, click on 'Open the Blocks Editor' on the right side of the Designer Window (image). Then all you have to do is start using App Inventor in the post. I assume your block editor is on.
If you want to use the phone for testing, you already know how to set up the phone . And if you want to use Virtual Emulator instead of the phone, then you don't need to set up the phone. But to use Virtual Emulator for the first time, follow the extra part below-
Emulator set upkarah
If you are using the emulator for the first time, follow the steps below-
1. If Block Editor is not open, open it and click on the 'New emulator' button at the top of the Block Editor window.
2. You will see a notice saying that the emulator is opening. Be patient, the emulator will take a few minutes to fully open.
3. The first emulator will show a black blank screen (1). Wait until the emulator has a color full background (2). Even after the background is colorful, wait until it has prepared its SD card. When the SD card is created, you will notice at the very top of the emulator screen. Now to unlock the emulator phone, drag its green lock to the far right (3).
4. The emulator will work like a phone. However, it has some limitations. You cannot shake the emulator like your phone.
Your phone or emulator is ready. This time-
1. Click on 'Connect to Device' in the block editor window.
2. Select the model number of the device (emulator will have the number and the word 'emulator').
3. You will see a yellow animated arrow sign (Figure).
It will take 1/2 minute to connect to your phone or emulator. The arrow will move until fully connected but as soon as it is connected it will turn green and stop moving. And as soon as you connect, you will see the picture of the cat on the screen of the phone or emulator.
Sound play:
Come to the block editor and follow the steps below-
* Step 1: Open the drawer named Button1 from the My Blocks Palette on the left and drag the Block named Button1.Click to the open place / work area as shown in the picture.
These green blocks are called Event Handler Blocks. Event handler blocks determine what the phone will do at an event (for example, clicking a button will play a song). All Event Handlers are green in color and are followed by a short when.
* Step 2: Now open the drawer named Sound1 of the same Palette and drag the Sound1.Play block and place it in the do section of Button1.Click. If your placement is correct then the two blocks will match and you will hear a nice click sound.
Purple and Blue blocks are called Command Blocks. Which are attached to the Body of the Event Handler. Whenever an Event Handler arrives, it will hold one or more Commands in its Body. Command Block is a block that tells the phone what to do in a special event. For example, the button is being clicked Event and the sound is being played Command.
At the moment your blocks must be as follows-
See the Command block is located in the middle of the Event Handler. Now try to understand what your blocks mean. Your block set means that when someone clicks on the Button1 button, Sound1 i.e. meow.mp3 sound will sound. You can win here to know more details about how blocks work . Now eat sweets. Create your first app. If you click on the cat's picture on the screen of the phone or emulator, you will now hear Miao sound.
Note: There is a problem with some devices regarding the sound component. If you see a message like "OS Error" and if you see that the sound is not playing or it is too late to play, then go to the designer window and use a component named Player instead of Sound Component. You can find it inside the Media palette.In the next episode we will package the app we created. Stay well until then. God bless you.
Note: There is a problem with some devices regarding the sound component. If you see a message like "OS Error" and if you see that the sound is not playing or it is too late to play, then go to the designer window and use a component named Player instead of Sound Component. You can find it inside the Media palette.In the next episode we will package the app we created. Stay well until then. God bless you.
Post a Comment