Google App Inventor question


Last Updated:

  1. mattstud36

    mattstud36 Well-Known Member This Topic's Starter

    Joined:
    Jun 17, 2010
    Messages:
    118
    Likes Received:
    1
    I'm trying to enable a web voice search within an app I'm creating via Google App Inventor. I can't figure out how to make it work. Has anyone dealt with the App Inventor yet?

    I'm basically looking to be able to push a button in the app and say, "google.com", and have it open the web browser and launch google.com.

    Any ideas?
     

    Advertisement
  2. dmodert66

    dmodert66 Well-Known Member

    Joined:
    Oct 24, 2009
    Messages:
    1,553
    Likes Received:
    221
    Well, after doing 2 of the tutorials, I decided to give this a shot. If you havn't figured it out yet, the answer is below.

    In the Main App Inventor Window -
    1. drag a button to the workspace - type whatever text you want to be on the button (in this case I called it "Presstospeak" as the name of the button, and "Press to Speak Website" for the text on the button itself.)
    2. go to "other stuff" and drag both "Speechrecognizer" and "Activity Starter" to the workspace (once done, they will appear below the workspace)
    3. click on ActivityStarter1 (in the components area)
    4. In the text field to the far right that says "Action" type in "android.intent.action.VIEW"

    Now go to the Blocks Editor

    Your blocks should look like in the picture below. Note that the way I have done it assumes the user will NOT speak any of the starting URL information (ie, nothing from http://www.) If you would rather the user say the entire URL, you can skip the text and join blocks between ActivityStarter1.DataUri and Sppechrecognizer1.Result.

    [​IMG]

    **EDIT** This does NOT work until you package the app. In other words, it will not work live on the phone while you are creating it. It must be packaged and saved to the phone first.
     

Share This Page

Loading...