|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.netmera.facebook.Util
public final class Util
Utility class supporting the Facebook Object.
| Constructor Summary | |
|---|---|
Util()
|
|
| Method Summary | |
|---|---|
static void |
clearCookies(android.content.Context context)
|
static android.os.Bundle |
decodeUrl(java.lang.String s)
|
static java.lang.String |
encodePostBody(android.os.Bundle parameters,
java.lang.String boundary)
Generate the multi-part post body providing the parameters and boundary string |
static java.lang.String |
encodeUrl(android.os.Bundle parameters)
|
static void |
logd(java.lang.String tag,
java.lang.String msg)
A proxy for Log.d api that kills log messages in release build. |
static java.lang.String |
openUrl(java.lang.String url,
java.lang.String method,
android.os.Bundle params)
Connect to an HTTP URL and return the response as a string. |
static org.json.JSONObject |
parseJson(java.lang.String response)
Parse a server response into a JSON Object. |
static android.os.Bundle |
parseUrl(java.lang.String url)
Parse a URL query and fragment parameters into a key-value bundle. |
static void |
showAlert(android.content.Context context,
java.lang.String title,
java.lang.String text)
Display a simple alert dialog with the given text and title. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Util()
| Method Detail |
|---|
public static java.lang.String encodePostBody(android.os.Bundle parameters,
java.lang.String boundary)
parameters - the parameters need to be postedboundary - the random string as boundary
public static java.lang.String encodeUrl(android.os.Bundle parameters)
public static android.os.Bundle decodeUrl(java.lang.String s)
public static android.os.Bundle parseUrl(java.lang.String url)
url - the URL to parse
public static java.lang.String openUrl(java.lang.String url,
java.lang.String method,
android.os.Bundle params)
throws java.net.MalformedURLException,
java.io.IOException
url - - the resource to open: must be a welformed URLmethod - - the HTTP method to use ("GET", "POST", etc.)params - - the query parameter for the URL (e.g. access_token=foo)
java.net.MalformedURLException - - if the URL format is invalid
java.io.IOException - - if a network problem occurspublic static void clearCookies(android.content.Context context)
public static org.json.JSONObject parseJson(java.lang.String response)
throws org.json.JSONException,
FacebookError
response - - string representation of the response
org.json.JSONException - - if the response is not valid JSON
FacebookError - - if an error condition is set
public static void showAlert(android.content.Context context,
java.lang.String title,
java.lang.String text)
context - Android context in which the dialog should be displayedtitle - Alert dialog titletext - Alert dialog message
public static void logd(java.lang.String tag,
java.lang.String msg)
tag - msg -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||