public class Parse extends Object
Parse class contains static functions that handle global configuration for the Parse
library.| Modifier and Type | Field and Description |
|---|---|
static int |
LOG_LEVEL_DEBUG |
static int |
LOG_LEVEL_ERROR |
static int |
LOG_LEVEL_INFO |
static int |
LOG_LEVEL_NONE |
static int |
LOG_LEVEL_VERBOSE |
static int |
LOG_LEVEL_WARNING |
| Modifier and Type | Method and Description |
|---|---|
static void |
addParseNetworkInterceptor(ParseNetworkInterceptor interceptor)
Add a
ParseNetworkInterceptor. |
static void |
enableLocalDatastore(Context context)
Enable pinning in your application.
|
static int |
getLogLevel()
Returns the level of logging that will be displayed.
|
static void |
initialize(Context context)
Authenticates this client as belonging to your application.
|
static void |
initialize(Context context,
String applicationId,
String clientKey)
Authenticates this client as belonging to your application.
|
static void |
removeParseNetworkInterceptor(ParseNetworkInterceptor interceptor)
Remove a given
ParseNetworkInterceptor. |
static void |
setLogLevel(int logLevel)
Sets the level of logging to display, where each level includes all those below it.
|
public static final int LOG_LEVEL_VERBOSE
public static final int LOG_LEVEL_DEBUG
public static final int LOG_LEVEL_INFO
public static final int LOG_LEVEL_WARNING
public static final int LOG_LEVEL_ERROR
public static final int LOG_LEVEL_NONE
public static void enableLocalDatastore(Context context)
enableLocalDatastore(Context) before
Parse.initialize(Context) :
public class MyApplication extends Application {
public void onCreate() {
Parse.enableLocalDatastore(this);
Parse.initialize(this);
}
}
context - The active Context for your application.public static void initialize(Context context)
com.parse.APPLICATION_ID and com.parse.CLIENT_KEY
meta-data in your AndroidManifest.xml:
<manifest ...>
...
<application ...>
<meta-data
android:name="com.parse.APPLICATION_ID"
android:value="@string/parse_app_id" />
<meta-data
android:name="com.parse.CLIENT_KEY"
android:value="@string/parse_client_key" />
...
</application>
</manifest>
This must be called before your application can use the Parse library.
The recommended way is to put a call to Parse.initialize
in your Application's onCreate method:
public class MyApplication extends Application {
public void onCreate() {
Parse.initialize(this);
}
}
context - The active Context for your application.public static void initialize(Context context, String applicationId, String clientKey)
applicationId or
clientKey than is defined by com.parse.APPLICATION_ID or
com.parse.CLIENT_KEY in your AndroidManifest.xml.
This must be called before your
application can use the Parse library. The recommended way is to put a call to
Parse.initialize in your Application's onCreate method:
public class MyApplication extends Application {
public void onCreate() {
Parse.initialize(this, "your application id", "your client key");
}
}
context - The active Context for your application.applicationId - The application id provided in the Parse dashboard.clientKey - The client key provided in the Parse dashboard.public static void setLogLevel(int logLevel)
Parse.LOG_LEVEL_NONE. Please ensure this is set to Parse.LOG_LEVEL_ERROR
or Parse.LOG_LEVEL_NONE before deploying your app to ensure no sensitive information is
logged. The levels are:
logLevel - The level of logcat logging that Parse should do.public static int getLogLevel()
public static void addParseNetworkInterceptor(ParseNetworkInterceptor interceptor)
ParseNetworkInterceptor. You must invoke
addParseNetworkInterceptor(ParseNetworkInterceptor) before
Parse.initialize(Context). You can add multiple ParseNetworkInterceptor.interceptor - ParseNetworkInterceptor to be added.public static void removeParseNetworkInterceptor(ParseNetworkInterceptor interceptor)
ParseNetworkInterceptor. You must invoke
removeParseNetworkInterceptor(ParseNetworkInterceptor) before
Parse.initialize(Context).interceptor - ParseNetworkInterceptor to be removed.