ANDROID APP using MIT APPINVENTOR

Adding Behaviour to Components of Application

Now we will head over to a little tricky part or which is actually the story behind the screen. Now we will tell our application what should happen when the Speak button is pressed. All these behaviors are defined using the block editor. It shows all the blocks related to particular component. To enter into blocks editor click on the "Blocks" button on the top right corner just next to the "Designer" button.

Adding Behaviour to Components

Block editor will show the components that you have already added to your application. Same like designer it also has viewer which will show you all the behaviors you have set for various components.

Adding Behaviour to Components

Here also drag and drop works and the developers have already defined what are various possible functions related to any component. Here we need to add behavior to our button. So select "Button1" from the left and it will show you what are the different behaviors related to button.

Adding Behaviour to Components

We want to add the behavior on click so select "when Button1.click" and drag it to the viewer.

Adding Behaviour to Components

Now we want when button is clicked the text to speech should be processed. For that we are having "Texttospeech" component". Click on it to see various options and drag "call texttospeech.speak" which have empty socket named message. Here what message we want to speak? It is the text of the text box which user has entered so in the empty socket we will attach "textbox1.text".

Adding Behaviour to Components

So our behavior is successfully generated which says when our button is clicked the text of the text box should be processed to convert into speech.

Congratulations!!! You have done what all it requires to make an android app. Now requires is the testing of the app which we will do by installing it on to our phone. You need to download this project to your computer which will generate a file with .apk extension which you can successfully install on your phone.