com.facebook.android
Class Util

java.lang.Object
  extended by com.facebook.android.Util

public final class Util
extends Object

Utility class supporting the Facebook Object.

THIS CLASS SHOULD BE CONSIDERED DEPRECATED.

All public members of this class are intentionally deprecated. New code should instead use Request

Adding @Deprecated to this class causes warnings in other deprecated classes that reference this one. That is the only reason this entire class is not deprecated.


Constructor Summary
Util()
           
 
Method Summary
static Bundle decodeUrl(String s)
          Deprecated. 
static String encodePostBody(Bundle parameters, String boundary)
          Deprecated. 
static String encodeUrl(Bundle parameters)
          Deprecated. 
static String openUrl(String url, String method, Bundle params)
          Deprecated. 
static JSONObject parseJson(String response)
          Deprecated. 
static Bundle parseUrl(String url)
          Deprecated. 
static void showAlert(Context context, String title, String text)
          Deprecated. 
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

encodePostBody

@Deprecated
public static String encodePostBody(Bundle parameters,
                                               String boundary)
Deprecated. 

Generate the multi-part post body providing the parameters and boundary string

Parameters:
parameters - the parameters need to be posted
boundary - the random string as boundary
Returns:
a string of the post body

encodeUrl

@Deprecated
public static String encodeUrl(Bundle parameters)
Deprecated. 


decodeUrl

@Deprecated
public static Bundle decodeUrl(String s)
Deprecated. 


parseUrl

@Deprecated
public static Bundle parseUrl(String url)
Deprecated. 

Parse a URL query and fragment parameters into a key-value bundle.

Parameters:
url - the URL to parse
Returns:
a dictionary bundle of keys and values

openUrl

@Deprecated
public static String openUrl(String url,
                                        String method,
                                        Bundle params)
                      throws MalformedURLException,
                             IOException
Deprecated. 

Connect to an HTTP URL and return the response as a string. Note that the HTTP method override is used on non-GET requests. (i.e. requests are made as "POST" with method specified in the body).

Parameters:
url - - the resource to open: must be a welformed URL
method - - the HTTP method to use ("GET", "POST", etc.)
params - - the query parameter for the URL (e.g. access_token=foo)
Returns:
the URL contents as a String
Throws:
MalformedURLException - - if the URL format is invalid
IOException - - if a network problem occurs

parseJson

@Deprecated
public static JSONObject parseJson(String response)
                            throws JSONException,
                                   FacebookError
Deprecated. 

Parse a server response into a JSON Object. This is a basic implementation using org.json.JSONObject representation. More sophisticated applications may wish to do their own parsing. The parsed JSON is checked for a variety of error fields and a FacebookException is thrown if an error condition is set, populated with the error message and error type or code if available.

Parameters:
response - - string representation of the response
Returns:
the response as a JSON Object
Throws:
JSONException - - if the response is not valid JSON
FacebookError - - if an error condition is set

showAlert

@Deprecated
public static void showAlert(Context context,
                                        String title,
                                        String text)
Deprecated. 

Display a simple alert dialog with the given text and title.

Parameters:
context - Android context in which the dialog should be displayed
title - Alert dialog title
text - Alert dialog message