AI2 Component
(Version nb184)
|
Public Member Functions | |
void | postCommandReturningArray (String serviceURL, String commandName, List< NameValuePair > params, final AsyncCallbackPair< JSONArray > callback) |
void | postCommandReturningObject (final String serviceURL, final String commandName, List< NameValuePair > params, final AsyncCallbackPair< JSONObject > callback) |
void | postCommand (final String serviceURL, final String commandName, List< NameValuePair > params, AsyncCallbackPair< String > callback) |
Static Public Member Functions | |
static WebServiceUtil | getInstance () |
These commands post to the Web and get responses that are assumed to be JSON structures: a string, a JSON array, or a JSON object. It's up to the caller of these routines to decide which version to use, and to decode the response.
Definition at line 45 of file WebServiceUtil.java.
|
static |
Returns the one WebServiceUtil
instance
WebServiceUtil
instance Definition at line 59 of file WebServiceUtil.java.
void com.google.appinventor.components.runtime.util.WebServiceUtil.postCommand | ( | final String | serviceURL, |
final String | commandName, | ||
List< NameValuePair > | params, | ||
AsyncCallbackPair< String > | callback | ||
) |
Make a post command to serviceURL with params and return the response String.
serviceURL | The URL of the server to post to. |
commandName | The path to the command. |
params | A List of NameValuePairs to send as parameters with the post. |
callback | A callback function that accepts a String on success. |
Definition at line 147 of file WebServiceUtil.java.
void com.google.appinventor.components.runtime.util.WebServiceUtil.postCommandReturningArray | ( | String | serviceURL, |
String | commandName, | ||
List< NameValuePair > | params, | ||
final AsyncCallbackPair< JSONArray > | callback | ||
) |
Make a post command to serviceURL with params and return the response String as a JSON array.
serviceURL | The URL of the server to post to. |
commandName | The path to the command. |
params | A List of NameValuePairs to send as parameters with the post. |
callback | A callback function that accepts a JSON array on success. |
Definition at line 91 of file WebServiceUtil.java.
void com.google.appinventor.components.runtime.util.WebServiceUtil.postCommandReturningObject | ( | final String | serviceURL, |
final String | commandName, | ||
List< NameValuePair > | params, | ||
final AsyncCallbackPair< JSONObject > | callback | ||
) |
Make a post command to serviceURL with paramaterss and return the response String as a JSON object.
serviceURL | The URL of the server to post to. |
commandName | The path to the command. |
params | A List of NameValuePairs to send as parameters with the post. |
callback | A callback function that accepts a JSON object on success. |
Definition at line 119 of file WebServiceUtil.java.