com.leanengine
Class LeanEngine

java.lang.Object
  extended by com.leanengine.LeanEngine

public class LeanEngine
extends java.lang.Object

The main LeanEngine context class, containing application-wide data. The init(android.content.Context, String) must be called before using any other LeanEngine client functions.


Constructor Summary
LeanEngine()
           
 
Method Summary
static android.net.Uri getFacebookLoginUri()
          Returns the server authentication Uri which uses Facebook OAuth authentication service.
static android.net.Uri getGoogleLoginUri()
          Returns the server authentication Uri which uses Google OpenID authentication service.
static android.net.Uri getHostURI()
          Returns the Uri of the host, as initialized via init(Context, String)
static android.net.Uri getOpenIdLoginUri(java.lang.String provider)
          Returns the Uri of OpenID authentication service.
static android.net.Uri getYahooLoginUri()
          Returns the server authentication Uri which uses Yahoo OpenID authentication service.
static void init(android.content.Context context, java.lang.String host)
          Initializes the LeanEngine client.
protected static void saveAuthData(java.lang.String authToken)
          Saves authentication token to app preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeanEngine

public LeanEngine()
Method Detail

init

public static void init(android.content.Context context,
                        java.lang.String host)
Initializes the LeanEngine client. Must be called before using other LeanEngine functions.

Parameters:
context - Android Context.
host - The path to the host server, i.e. 'http://demo.lean-engine.com'

saveAuthData

protected static void saveAuthData(java.lang.String authToken)
                            throws java.lang.IllegalStateException
Saves authentication token to app preferences.

Parameters:
authToken - Authentication token acquired via authentication flow.
Throws:
java.lang.IllegalStateException - If LeanEngine was not initialized before first use, via init(android.content.Context, String) method.

getHostURI

public static android.net.Uri getHostURI()
                                  throws java.lang.IllegalStateException
Returns the Uri of the host, as initialized via init(Context, String)

Returns:
The Uri of the host server.
Throws:
java.lang.IllegalStateException - If LeanEngine was not initialized before first use, via init(android.content.Context, String) method.

getFacebookLoginUri

public static android.net.Uri getFacebookLoginUri()
Returns the server authentication Uri which uses Facebook OAuth authentication service.

Returns:
The server authentication Uri.

getGoogleLoginUri

public static android.net.Uri getGoogleLoginUri()
Returns the server authentication Uri which uses Google OpenID authentication service.

Returns:
The server authentication Uri.

getYahooLoginUri

public static android.net.Uri getYahooLoginUri()
Returns the server authentication Uri which uses Yahoo OpenID authentication service.

Returns:
The server authentication Uri.

getOpenIdLoginUri

public static android.net.Uri getOpenIdLoginUri(java.lang.String provider)
Returns the Uri of OpenID authentication service.

Parameters:
provider - The URL of the OpenID service.
Returns:
The server authentication Uri.