Not Ready for Prime Time

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

A non-visible component that communicates with Google Fusion Tables. Fusion Tables let you store, share, query and visualize data tables; this component lets you query, create, and modify these tables.

This component uses the Fusion Tables API V1.0.

In order to develop apps that use Fusiontables, you must obtain 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 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".You will have to provide that key as the value for the ApiKey property in your Fusiontables app.

Once you have an API key, set the value of the Query property to a valid Fusiontables SQL query and call SendQuery to execute the query. App Inventor will send the query to the Fusion Tables server and the GotResult block will fire when a result is returned from the server.Query results will be returned in CSV format, and can be converted to list format using the "list from csv table" or "list from csv row" blocks.

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.

Properties

ApiKey
Your Google API Key. For help, click on the questionmark (?) next to the FusiontablesControl component in the Palette.
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 UTF-encoding the query. But you do need 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 if there are spaces in them.

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

DoQuery()
DEPRECATED. This block will be deprecated by the end of 2012. Use SendQuery.
ForgetLogin()
Method for ForgetLogin
SendQuery()
Send the query to the Fusiontables server.

GameClient

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

GameId
The game name for this application. The same game ID can have one or more game instances.
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

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

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

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
Height
HomeUrl
URL of the page the WebViewer should initially open to. Setting this will load the page.
Visible
Whether the component is visible
Width
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.