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
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 SQL API.
To use the component, define a query, call DoQuery to execute the query, and GotResult will hand you the result when it is ready.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 matter, 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 CSV format, and can be converted to list format using the "list from csv table" or "list from csv row" blocks.
Properties
-
Query
: text (read-only) -
The query to send to the Fusion Tables API.
For legal query formats and examples, see the Fusion Tables SQL API 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
-
DoQuery()
- Send the query to the Fusion Tables 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
- 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
noneEvents
-
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:
-
GotBallot
, indicating that the ballot question and options were retrieved and the propertiesBallotQuestion
andBallotOptions
have been set. -
NoOpenPoll
, indicating that no ballot question is available. -
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 ofBallotOptions
. -
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
andBallotOptions
have been set. This is always preceded by a call to the methodRequestBallot
. -
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
, orWebServiceError
. -
SendBallot()
-
Send a completed ballot to the Web service. This should not be called until the
properties
UserId
andUserChoice
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
-
HomeUrl
- URL of the page the WebViewer should initially open to. Setting this will load the page.
-
Visible
- Whether the component is visible
-
Width
Events
noneMethods
-
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.