|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.ac.cam.acr31.android.geomessaging.servertools.ServerHelper
public class ServerHelper
A helper class of static methods for interacting with the GeoMessagingServer
Nested Class Summary | |
---|---|
private static class |
ServerHelper.MyXMLHandler
Helper class to parse the XML response from the server |
Field Summary | |
---|---|
private static java.lang.String |
URL_MESSAGE_LIST
URL to use to query for the list of nearby messages |
private static java.lang.String |
URL_PICTURE_FOLDER
The URL to prefix onto image names to download them from the web |
private static java.lang.String |
URL_UPLOAD
URL to use for uploading new messages |
Constructor Summary | |
---|---|
ServerHelper()
|
Method Summary | |
---|---|
static java.util.ArrayList<Message> |
getMessages(double lat,
double lng,
double proxMiles)
Return a list of all the messages which have been posted at the given latitude and longitude within the chosen proximity |
private static java.lang.String |
getResponseString(java.lang.String urlAddress,
org.apache.http.entity.mime.MultipartEntity form)
Make a POST request to the URL using the form given and return a String for the response body |
private static java.io.InputStream |
obtainInputStream(java.lang.String urlAddress,
org.apache.http.entity.mime.MultipartEntity form)
Make a POST request to the URL using the form given and return an InputStream for the response body |
static boolean |
sendMessage(java.lang.String message,
java.lang.String pictureFilename,
double lat,
double lng)
Submit this message to the server. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String URL_UPLOAD
private static final java.lang.String URL_MESSAGE_LIST
private static final java.lang.String URL_PICTURE_FOLDER
Constructor Detail |
---|
public ServerHelper()
Method Detail |
---|
private static java.io.InputStream obtainInputStream(java.lang.String urlAddress, org.apache.http.entity.mime.MultipartEntity form) throws org.apache.http.client.ClientProtocolException, java.io.IOException
org.apache.http.client.ClientProtocolException
java.io.IOException
private static java.lang.String getResponseString(java.lang.String urlAddress, org.apache.http.entity.mime.MultipartEntity form) throws org.apache.http.client.ClientProtocolException, java.io.IOException
org.apache.http.client.ClientProtocolException
java.io.IOException
public static java.util.ArrayList<Message> getMessages(double lat, double lng, double proxMiles)
public static boolean sendMessage(java.lang.String message, java.lang.String pictureFilename, double lat, double lng)
message
- is the text of the message to submitpictureFileName
- is the filename of a file on the phone's storage containing the image to includelat
- is the latitude of the current locationlng
- is the longitude of the current location
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |