public class Contentstack
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static android.content.Context |
context |
protected static com.android.volley.RequestQueue |
requestQueue |
Constructor and Description |
---|
Contentstack(android.content.Context applicationContext) |
Modifier and Type | Method and Description |
---|---|
<T> void |
addToRequestQueue(com.android.volley.Request<T> req) |
protected static <T> void |
addToRequestQueue(java.lang.String protocol,
com.android.volley.Request<T> req,
java.lang.String tag) |
static Contentstack |
getInstance(android.content.Context context)
// Private Functionality
|
com.android.volley.RequestQueue |
getRequestQueue() |
protected static com.android.volley.RequestQueue |
getRequestQueue(java.lang.String protocol) |
protected static void |
isNetworkAvailable(android.content.Context context)
To check network availability.
|
static Stack |
stack(android.content.Context context,
java.lang.String stackApiKey,
java.lang.String accessToken,
java.lang.String environment)
Authenticates the stack api key of your stack.
|
static Stack |
stack(android.content.Context context,
java.lang.String stackApiKey,
java.lang.String accessToken,
java.lang.String environment,
Config config)
Authenticates the stack api key of your stack.
|
protected static com.android.volley.RequestQueue requestQueue
protected static android.content.Context context
public static Stack stack(android.content.Context context, java.lang.String stackApiKey, java.lang.String accessToken, java.lang.String environment) throws java.lang.Exception
context
- application context.stackApiKey
- application api Key of your application on Built.io Contentstack.accessToken
- access tokenenvironment
- environment nameStack
instance.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", "stag");
java.lang.Exception
public static Stack stack(android.content.Context context, java.lang.String stackApiKey, java.lang.String accessToken, java.lang.String environment, Config config) throws java.lang.Exception
context
- application context.stackApiKey
- application api Key of your application on Built.io Contentstack.accessToken
- access tokenconfig
- Config
instance to set environment and other configuration details.Stack
instance.
//'blt5d4sample2633b' is a dummy Stack API key //'blt6d0240b5sample254090d' is dummy access token. Config config = new Config(); config.setEnvironment("stag"); Stack stack = Contentstack.stack(context, "blt5d4sample2633b", "blt6d0240b5sample254090d", config);
java.lang.Exception
public static Contentstack getInstance(android.content.Context context)
public com.android.volley.RequestQueue getRequestQueue()
public <T> void addToRequestQueue(com.android.volley.Request<T> req)
protected static com.android.volley.RequestQueue getRequestQueue(java.lang.String protocol)
protected static <T> void addToRequestQueue(java.lang.String protocol, com.android.volley.Request<T> req, java.lang.String tag)
protected static void isNetworkAvailable(android.content.Context context)