mirror of
https://github.com/leanote/leanote-android.git
synced 2025-10-15 14:51:04 +00:00
integrate Flurry
This commit is contained in:
@@ -33,7 +33,18 @@ android {
|
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
||||
}
|
||||
}
|
||||
|
||||
buildTypes.each { buildType ->
|
||||
def properties = new Properties();
|
||||
if (buildType.isDebuggable()) {
|
||||
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/staging.properties")))
|
||||
} else {
|
||||
properties.load(new FileInputStream(new File(projectDir.absolutePath + "/production.properties")))
|
||||
}
|
||||
buildType.buildConfigField "String", "FLURRY_KEY", properties['FLURRY_KEY']
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
dependencies {
|
||||
compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||
@@ -70,4 +81,5 @@ dependencies {
|
||||
compile project(':img-selector')
|
||||
compile 'com.facebook.stetho:stetho:1.4.1'
|
||||
compile 'com.github.houxg:FlexLayout:1.2'
|
||||
compile 'com.flurry.android:analytics:6.4.2'
|
||||
}
|
||||
|
1
app/production.properties
Normal file
1
app/production.properties
Normal file
@@ -0,0 +1 @@
|
||||
FLURRY_KEY="M6HD6WJPT9Y274MG2FSF"
|
@@ -5,6 +5,7 @@ import android.app.Application;
|
||||
import android.content.Context;
|
||||
|
||||
import com.facebook.stetho.Stetho;
|
||||
import com.flurry.android.FlurryAgent;
|
||||
import com.raizlabs.android.dbflow.config.FlowConfig;
|
||||
import com.raizlabs.android.dbflow.config.FlowManager;
|
||||
|
||||
@@ -22,6 +23,9 @@ public class LeanoteLite extends Application {
|
||||
public void onCreate() {
|
||||
super.onCreate();
|
||||
mContext = this;
|
||||
new FlurryAgent.Builder()
|
||||
.withLogEnabled(true)
|
||||
.build(this, BuildConfig.FLURRY_KEY);
|
||||
EventBus.builder()
|
||||
.logNoSubscriberMessages(false)
|
||||
.sendNoSubscriberEvent(false)
|
||||
|
1
app/staging.properties
Normal file
1
app/staging.properties
Normal file
@@ -0,0 +1 @@
|
||||
FLURRY_KEY="XQP2X5N9BCGB7Z5JHS28"
|
Reference in New Issue
Block a user