Not Ready for Prime Time Components

These components are experimental; the documentation is either missing or preliminary. Feel free to explore with them, but don't be surprised if they change in the near future.

Table of Contents

FusiontablesControl

Picture of Fusion Tables component

Google Fusion Tables lets you store, share, query and visualize data tables; this component lets you query, create, and modify these tables, using the Fusion Tables API V1.0.

To use the component, define a query, call SendQuery to execute the query, and GotResult will hand you the result when it is ready.

Note that you do not need to worry about UTF-encoding the query. But you do need to make sure the query follows the syntax described in the reference manual, which means that things like capitalization for names of columns matters, and that single quotes must be used around column names if there are spaces in them.

The results of the query will generally be returned in comma-separated values (CSV) format, and can be converted to list format using the "list from csv table" or "list from csv row" blocks.

Using the FusiontablesControl Component

Getting an API Key

In order to use the FusiontablesControl Component you need to acquire a Google a Google Applications Programming Interface (API) key, an API Key. To get an API key, follow these instructions:

  1. Go to your Google APIs Console and login if necessary.
  2. Select the Services item from the menu on the left.
  3. Choose the Fusion Tables service from the list provided and turn it on.
  4. Go back to the main menu and select the API Access item.

Your API Key will be at the bottom of that pane in the section called "Simple API Access". You will provide your key as the value to the ApiKey property in all your Fusiontables apps.

Creating Fusion Tables

You will probably want to create your own Fusion Tables to experiment with as you are developing your apps. This is as easy as creating a Google document, if you are familiar with that process. Here are the steps:

  1. On the web, login to your Gmail account or any other Google service (e.g., Drive, YouTube).
  2. Select the More > Even more menu and scroll to the bottom of the page of Google services where you will find the Fusion Tables service.
  3. You may want to view some of the examples and work through a tutorial to learn the basics.
  4. Click the See my tables button (top right of the page). This will bring you to your own page.
  5. You should see a list of your own tables or tables that have been shared with you (possibly none).
  6. Use the Create button to create a new table. Give it some column names. And save it.
  7. Click on the Share button (top right) to modify the table's permissions.

Creating a Fusiontables App

When you drag the FusiontablesControl component onto the Designer, don't forget to set its ApiKey property, which is initially blank. You should copy this from your Google APIs Console and paste it into the property field.

Properties

ApiKey : text (read-only)

Copy and paste your Google API key into this property.

In order to develop apps that use Fusiontables, you must obtain a Google API Key. To get a key follow these instructions.

  1. Go to your Google APIs Console and login if necessary.
  2. Select the Services item from the menu on the left.
  3. Choose the Fusiontables service from the list provided and turn it on.
  4. Go back to the main menu and select the API Access item.
Your API Key will be near the bottom of that pane in the section called "Simple API Access".

Query : text (read-only)
The query to send to the Fusion Tables API.

For legal query formats and examples, see the Fusion Tables API V1.0 reference manual.

Note that you do not need to worry about encoding the query, but you do have to make sure it follows the syntax described in the reference manual, which means that things like capitalization for names of columns matters, and that single quotes need to be used around column names that contain.

Events

GotResult(text result)
Indicates that the Fusion Tables query has finished processing, with a result. The result of the query will generally be returned in CSV format, and can be converted to list format using the "list from csv table" or "list from csv row" blocks.

Methods

SendQuery()
Send the query to the Fusion Tables server.
ForgetLogin()
Discards the user's account name, forcing them to re-authenticate when accessing a Fusion Table.

GameClient

Picture of Game Client component

GameClient communicates with online game servers to support the implementation of multiplayer games. For information on the clients and servers and examples of games, see the MIT Master's Thesis by Bill Magnuson, Building Blocks for Mobile Games available at http://dspace.mit.edu/handle/1721.1/61253 . There is an experimental game server running at appinvgameserver.appspot.com, but this may be up only intermittently. For serious work, you will probably want to deploy your own game server on Google Appengine. The implementation is described in the thesis, and the code is available at http://code.google.com/p/app-inventor-for-android/source/browse/#svn/trunk/app_inv_game_server

Properties

InstanceId : text (read-only)
The game instance id. Taken together,the game ID and the instance ID uniquely identify the game.
InvitedInstances : list (read-only)
The set of game instances to which this player has been invited but has not yet joined. To ensure current values are returned, first invoke GetInstanceLists.
JoinedInstances : list (read-only)
The set of game instances in which this player is participating. To ensure current values are returned, first invoke GetInstanceLists.
Leader : text (read-only)
The game's leader. At any time, each game instance has only one leader, but the leader may change with time. Initially, the leader is the game instance creator. Application writers determine special properties of the leader. The leader value is updated each time a successful communication is made with the server.
Players : list (read-only)
The current set of players for this game instance. Each player is designated by an email address, which is a string. The list of players is updated each time a successful communication is made with the game server.
PublicInstances : list (read-only)
The set of game instances that have been marked public. To ensure current values are returned, first invoke GetInstanceLists.
ServiceUrl : text (read-only)
The URL of the game server.
UserEmailAddress : text (read-write)
The email address that is being used as the player id for this game client. At present, users must set this manually in order to join a game. But this property will change in the future so that is set automatically, and users will not be able to change it.

Events

FunctionCompleted(text functionName)
Indicates that a function call completed.
GotMessage(text type, text sender, list contents)
Indicates that a new message has been received.
Info(text message)
Indicates that something has occurred which the player should know about.
InstanceIdChanged(text instanceId)
Indicates that the InstanceId property has changed as a result of calling MakeNewInstance or SetInstance.
Invited(text instanceId)
Indicates that a user has been invited to this game instance.
NewInstanceMade(text instanceId)
Indicates that a new instance was successfully created after calling MakeNewInstance.
NewLeader(text playerId)
Indicates that this game has a new leader as specified through SetLeader
PlayerJoined(text playerId)
Indicates that a new player has joined this game instance.
PlayerLeft(text playerId)
Indicates that a player has left this game instance.
ServerCommandFailure(text command, list arguments)
Indicates that a server command failed.
ServerCommandSuccess(text command, list response)
Indicates that a server command returned successfully.
UserEmailAddressSet(text emailAddress)
Indicates that the user email address has been set.
WebServiceError(text functionName, text message)
Indicates that an error occurred while communicating with the web server.

Methods

GetInstanceLists ()
Updates the InstancesJoined and InstancesInvited lists. This procedure can be called before setting the InstanceId.
GetMessages (text type, number count)
Retrieves messages of the specified type.
Invite (text playerEmail)
Invites a player to this game instance.
LeaveInstance ()
Leaves the current instance.
MakeNewInstance (text instanceId, boolean makePublic)
Asks the server to create a new instance of this game.
SendMessage (text type, list recipients, list contents)
Sends a keyed message to all recipients in the recipients list. The message will consist of the contents list.
ServerCommand (text command, list arguments)
Sends the specified command to the game server.
SetInstance (text instanceId)
Sets InstanceId and joins the specified instance.
SetLeader (text playerEmail)
Tells the server to set the leader to playerId. Only the current leader may successfully set a new leader.

SoundRecorder

Picture of Sound Recorder component

Multimedia component that records audio.

Properties

none

Events

AfterSoundRecorded(text sound)
Provides the location of the newly created sound.
StartedRecording()
Indicates that the recorder has started, and can be stopped.
StoppedRecording()
Indicates that the recorder has stopped, and can be started again.

Methods

Start ()
Starts recording.
Stop ()
Stops recording.

Voting

Picture of Voting component

The Voting component communicates with a Web service to retrieve a ballot and send back users' votes.

The application should call the method RequestBallot , usually in the Initialize event handler, in order to get the ballot question and options from the Web service (specified by the ServiceURL property). Depending on the response from the Web service, the system will raise one of the following three events:

  1. GotBallot , indicating that the ballot question and options were retrieved and the properties BallotQuestion and BallotOptions have been set.
  2. NoOpenPoll , indicating that no ballot question is available.
  3. WebServiceError , indicating that the service did not provide a legal response and providing an error messages.

After getting the ballot, the application should allow the user to make a choice from among BallotOptions and set the property UserChoice to that choice. The application should also set UserId to specify which user is voting. Often, this will be set to the property UserEmailAddress , which specifies the email address associated with the phone.

Once the application has set UserChoice and UserId , the application can call SendBallot to send this information to the Web service. If the service successfully receives the vote, the event GotBallotConfirmation will be raised. Otherwise, the event WebServiceError will be raised with the appropriate error message.

Properties

BallotOptions
The list of ballot options.
BallotQuestion
The question to be voted on.
ServiceURL
The URL of the Voting service
UserChoice
The ballot choice to send to the server, which must be set before SendBallot is called. This must be one of BallotOptions .
UserEmailAddress
The email address associated with this device.
UserId
A text identifying the voter that is sent to the Voting server along with the vote. This must be set before SendBallot is called.

Events

GotBallot()
Event indicating that a ballot was retrieved from the Web service and that the properties BallotQuestion and BallotOptions have been set. This is always preceded by a call to the method RequestBallot .
GotBallotConfirmation()
Event confirming that the Voting service received the ballot.
NoOpenPoll()
Event indicating that the service has no open poll.
WebServiceError(text message)
Event indicating that the communication with the Web service resulted in an error.

Methods

RequestBallot()
Send a request for a ballot to the Web service specified by the property ServiceURL . When the completes, one of the following events will be raised: GotBallot , NoOpenPoll , or WebServiceError .
SendBallot()
Send a completed ballot to the Web service. This should not be called until the properties UserId and UserChoice have been set by the application.

WebViewer

Picture of WebViewer component

Component for viewing Web pages. The Home URL can be specified in the Designer or in the Blocks Editor. The view can be set to follow links when they are tapped, and users can fill in Web forms. Warning: This is not a full browser. For example, pressing the phone's hardware Back key will exit the app, rather than move back in the browser history.

Properties

CurrentPageTitle
Title of the page currently viewed
CurrentUrl
URL of the page currently viewed. This could be different from the Home URL if new pages were visited by following links.
FollowLinks
Determines whether to follow links when they are tapped in the WebViewer. If you follow links, you can use GoBack and GoForward to navigate the browser history.
Height
HomeUrl
URL of the page the WebViewer should initially open to. Setting this will load the page.
PromptforPermission
If True, then prompt the user of the WebView to give permission to access the geolocation API. If False, then assume permission is granted.
UsesLocation
Whether or not to give the application permission to use the Javascript geolocation API.
Visible
Whether the component is visible
Width

Events

none

Methods

boolean CanGoBack()
Returns true if the WebViewer can go back in the history list.
boolean CanGoForward()
Returns true if the WebViewer can go forward in the history list.
GoBack()
Go back to the previous page in the history list. Does nothing if there is no previous page.
GoForward()
Go forward to the next page in the history list. Does nothing if there is no next page.
GoHome()
Loads the home URL page. This happens automatically when the home URL is changed.
GoToUrl(text url)
Load the page at the given URL.