integrate ugly

This commit is contained in:
houxg
2016-12-16 19:25:55 +08:00
parent ea43d3bfa8
commit 1bba209bed
7 changed files with 14 additions and 6 deletions

View File

@@ -61,6 +61,7 @@ android {
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/production.properties"))) properties.load(new FileInputStream(new File(projectDir.absolutePath + "/production.properties")))
} }
buildType.buildConfigField "String", "FLURRY_KEY", properties['FLURRY_KEY'] buildType.buildConfigField "String", "FLURRY_KEY", properties['FLURRY_KEY']
buildType.buildConfigField "String", "BUGLY_KEY", properties['BUGLY_KEY']
} }
} }
@@ -100,7 +101,7 @@ dependencies {
compile project(':img-selector') compile project(':img-selector')
compile 'com.facebook.stetho:stetho:1.4.1' compile 'com.facebook.stetho:stetho:1.4.1'
compile 'com.github.houxg:FlexLayout:1.2' compile 'com.github.houxg:FlexLayout:1.2'
compile 'com.flurry.android:analytics:6.4.2'
compile 'net.danlew:android.joda:2.9.5' compile 'net.danlew:android.joda:2.9.5'
compile 'com.tencent.bugly:crashreport:2.4.0'
} }

View File

@@ -1 +1,2 @@
FLURRY_KEY="M6HD6WJPT9Y274MG2FSF" FLURRY_KEY="M6HD6WJPT9Y274MG2FSF"
BUGLY_KEY="cf1aa1ccff"

View File

@@ -15,3 +15,6 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *; # public *;
#} #}
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}

View File

@@ -9,6 +9,9 @@
<uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_INTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-feature android:name="android.hardware.camera" /> <uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" /> <uses-feature android:name="android.hardware.camera.autofocus" />

View File

@@ -5,9 +5,9 @@ import android.app.Application;
import android.content.Context; import android.content.Context;
import com.facebook.stetho.Stetho; import com.facebook.stetho.Stetho;
import com.flurry.android.FlurryAgent;
import com.raizlabs.android.dbflow.config.FlowConfig; import com.raizlabs.android.dbflow.config.FlowConfig;
import com.raizlabs.android.dbflow.config.FlowManager; import com.raizlabs.android.dbflow.config.FlowManager;
import com.tencent.bugly.crashreport.CrashReport;
import net.danlew.android.joda.JodaTimeAndroid; import net.danlew.android.joda.JodaTimeAndroid;
@@ -25,9 +25,7 @@ public class Leamonax extends Application {
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
mContext = this; mContext = this;
new FlurryAgent.Builder() CrashReport.initCrashReport(this, BuildConfig.BUGLY_KEY, BuildConfig.DEBUG);
.withLogEnabled(true)
.build(this, BuildConfig.FLURRY_KEY);
EventBus.builder() EventBus.builder()
.logNoSubscriberMessages(false) .logNoSubscriberMessages(false)
.sendNoSubscriberEvent(false) .sendNoSubscriberEvent(false)

View File

@@ -23,6 +23,7 @@ import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.bumptech.glide.Glide; import com.bumptech.glide.Glide;
import com.tencent.bugly.crashreport.CrashReport;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe; import org.greenrobot.eventbus.Subscribe;
@@ -90,7 +91,7 @@ public class MainActivity extends BaseActivity implements NotebookAdapter.Notebo
initToolBar((Toolbar) findViewById(R.id.toolbar)); initToolBar((Toolbar) findViewById(R.id.toolbar));
getSupportActionBar().setDisplayHomeAsUpEnabled(true); getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_white); getSupportActionBar().setHomeAsUpIndicator(R.drawable.ic_menu_white);
CrashReport.setUserId(AccountService.getCurrent().getUserId());
if (savedInstanceState == null) { if (savedInstanceState == null) {
mNoteFragment = NoteFragment.newInstance(getIntent().getBooleanExtra(EXT_SHOULD_RELOAD, false)); mNoteFragment = NoteFragment.newInstance(getIntent().getBooleanExtra(EXT_SHOULD_RELOAD, false));
getFragmentManager().beginTransaction().add(R.id.container, mNoteFragment, TAG_NOTE_FRAGMENT).commit(); getFragmentManager().beginTransaction().add(R.id.container, mNoteFragment, TAG_NOTE_FRAGMENT).commit();

View File

@@ -1 +1,2 @@
FLURRY_KEY="XQP2X5N9BCGB7Z5JHS28" FLURRY_KEY="XQP2X5N9BCGB7Z5JHS28"
BUGLY_KEY="747b676abf"