Google Voice for Texting over Wifi

App Inventor Classic • App Inventor Classic • FOR APP INVENTOR 2 CLICK HERE• App Inventor Classic • App Inventor Classic

This information pertains to App Inventor 1 (Classic). For tutorials about App Inventor 2, go to the App Inventor 2 Tutorials.

Texting Over Wifi: Using Google Voice


This tutorial shows how to use the Texting component to send and receive text messages (SMS) over Wifi. This lets instructors use App Inventor texting examples and exercises with phones that do not have mobile or data plans.

In order to use the Texting component over Wifi, the app user will need a Google Voice account and will also need to download and install the Google Voice app from the Play Store.

Once you get Google Voice set up on your phone, try the AlertMe tutorial.

Under the Hood: How Things Work

Texting over Wifi uses Google Voice to send and receive messages. The mobile Google Voice app is used for receiving messages and the user's Google Voice account is used for sending messages.

Receiving a Message:

Here are some of the internal details for how things work when a message is received.

  1. The phone receives an incoming text message, say, "Hi", from some phone, say, "555-111-2222".
  2. The Android system forwards the message to the Google Voice mobile app, which has been set up to receive messages.
  3. The Google Voice app forwards the message to the Texting component's Broadcast Receiver.
  4. If the Texting component is enabled to receive messages, the Broadcast Receiver forwards the message to the Texting component.
  5. If the Texting component is running (meaning it is visible in the foreground), its MessageReceived (with the arguments 555-111-2222 and Hi for this example) event handler will be invoked.
  6. The MessageReceived method will process the message according to the algorithm specified in its do slot.

Of course most of these details are not visible to the App Inventor programmer, who just needs to worry about the procedure in the Do slot.

Sending a Message:

Here are some of the details for how things work when a message is sent.

  1. Sending a message requires that the Texting component's Message and PhoneNumber properties have been set and that its SendMessage method has been called.
  2. If this is the first message being sent by the app, the user will be prompted to authenticate with their online Google Voice account.
  3. Once authenticated, the SendMessage method will forward the message and phone number to Google Voice.
  4. Google Voice will forward the message to the destination phone number.

Note: if the user sends a message to her own Google Voice number, it will be forwarded back to the phone., which could be very confusing. This may have implications for how you design your app.

Preliminaries: Logging onto Wifi

A reliable Wifi hotspot is a prerequisite to using the Texting component without a SIM card or mobile account. Use the phone's Settings > Wireless & networks > Wi-Fi to connect to a Wifi hotspot. This may require you to login to the Wifi with a password and may also require you to login to the school's network with a username and password.

Setting Up Your Google Voice Account

The revised Texting component uses Google Voice to send outgoing messages over Wifi. In order to build and test an app that sends text messages over Wifi, the app developer will have to have a Google Voice account. Once the app is developed, users of the app will also have to have Google Voice accounts.

To create a Google Voice account,

  1. Login to your Gmail account.
  2. Click on the More tab on the Google menu bar.
  3. Select the Even More option.
  4. Scroll down to the Google Voice link under Home and Office/.
  5. Follow the instructions there to create a Google Voice number and activate your account.

Installing the Google Voice App

The revised Texting component receives incoming messages over Wifi through the Google Voice mobile app. To download and install Google voice on your phone:

  1. Start the phone's Market or Play Store app.
  2. Search for "Google Voice".
  3. Download and install the app.
  4. Read and approve the app's permission requests.
  5. Start the app and follow the setup instructions.
  6. Set the following Google Voice settings under Voice > Sync and notifications:
  7. Receive text messages > Via the Google Voice app
  8. Text notifications > Off (unless you want your app and Google Voice to notify you)

Authenticating Outgoing Messages

Because outgoing messages are sent through the user's (online) Google Voice account, users of Texting-over-wifi apps will be asked to give the app permission to access the user's account now and in the future. If there are more than one user account on the phone, the user will first be prompted to choose an account.

This description assumes that the user already has an active Google account on the phone. If not, the user will be asked to setup an account or login to an existing Google account.

This authentication process will happen the first time the app sends an outgoing message after it is installed. Depending on how the app and phone are used, the user may never again be asked for permission

In Summary

Congratulations! You have successfully installed Google Voice and are ready to text over Wifi! This will be useful for a variety of Apps that use texting. Now try to build AlertMe, an app that allows you to try this new capability.

Done with Google Voice? Return to the other tutorials here.