Back to project page appboy-android-sdk.
The source code is released under:
Copyright (c) 2014 Appboy, Inc. All rights reserved. * Use of source code or binaries contained within Appboy's Android SDK is permitted only to enable use of the Appboy platform by customers of Appb...
If you think the Android project appboy-android-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.appboy.sample; //ww w . j a v a 2s . c o m import android.annotation.TargetApi; import android.app.Application; import android.os.Build; import android.os.StrictMode; import android.util.Log; import com.appboy.Appboy; import com.appboy.Constants; import java.util.Locale; public class DroidboyApplication extends Application { private static final String TAG = String.format("%s.%s", Constants.APPBOY_LOG_TAG_PREFIX, DroidboyApplication.class.getName()); @Override public void onCreate() { super.onCreate(); activateStrictMode(); if (Locale.getDefault().toString().equals("zh_CN")) { Log.i(TAG, "Matched zh_CN locale, configuring Appboy with override key"); Appboy.configure(this, "f9622241-8e26-4366-8183-1c9e310af6b0"); } else { Log.i(TAG, "Did not match zh_CN locale, configuring Appboy to clear any existing override key"); Appboy.configure(this, null); } } @TargetApi(9) private void activateStrictMode() { // Set the activity to Strict mode so that we get LogCat warnings when code misbehaves on the main thread. if (BuildConfig.DEBUG && Build.VERSION.SDK_INT >= Build.VERSION_CODES.GINGERBREAD) { StrictMode.setThreadPolicy(new StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build()); } } }