Android Language Translator

Using MIT’s free AppInventor package you can create your own custom language translation app.

AppInventor

To get started with AppInventor, you will need a Google user account and a PC, Mac or Linux computer. Next log into the Web site, http://appinventor.mit.edu. AppInventor is Web based Android app creation tool, that uses a graphical programming structure so no coding is required.

AppInventor has 2 main screens. The Design screen is used to layout the presentation or look-and-feel of the Android app and the Blocks screen is used to build the app logic.

appinv_menu1

On the Design screen, an app is created by dragging a component from the Palette window onto the Viewer window.

For visuals on this application we are using 2 buttons, a text box and a label.

talk_setup1

This application also requires some non-visual components. In the Media section of the Palette window, the SpeechRecognizer, TextToSpeech and YandexTranslate components are added by dragging and dropping them on to the Viewer window.

The Components window is used to rename or delete components. When a component is selected the Properties window is used to change visual features such as its sizing, color,  font size etc.

app_inv_prop

After the layout design is complete, click on the Blocks menu button to start building logic.

Translation Logic

The logic is built by selecting an object in the Blocks window, and then select the specific block that you would like to use.

talk_logic_drop

For the translation app we use a  when Screen1.Initialize block to define the language to translate to. For this example “ESP” and “es” are used for Spanish. Other language such as French (“FRA”, “fr”), Germany (“DEU”,”de”), or Italian (“ITA”,”it”)  could also be used.

On our app we will use the top button to start the speech recognition. This is done by inserting a when BT_Speak.click block and put a call SpeechRecognizer1.GetText block inside.

A when SpeechRecognizer1.AfterGettingText block will return our spoken text. This result is shown in a textbox and passed to the YendexTranslation1.RequestTranslation block.

Next a when YandexTranslate1.GotTranslation block is used to show and speak the translated text.

A second button click is included so that you can repeat the translation.

The full logic is shown below.

talk_logic

Compiling and Transferring the App

After the screen layout and logic is complete, the menu item Build will compile the app. The app can be made available as an APK downloadable file or a QR link can be used.

app_build

Final Thoughts

This translator app is pretty basic but it has a lot of potential for enhancements. Some useful features could include adding multiple languages and 2 way translations.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s