Fix plugins

This commit is contained in:
Alexey Kulish 2016-12-24 15:56:33 +03:00
parent b85edcbb63
commit 976594927d
9 changed files with 50 additions and 26 deletions

View file

@ -62,12 +62,18 @@ repositories {
} }
} }
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
dependencies { dependencies {
//compile 'com.google.firebase:firebase-core:9.8.0' if (analytics) {
//compile 'com.google.firebase:firebase-config:9.8.0' compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-config:9.8.0'
}
compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0' compile 'com.android.support:design:23.3.0'
} }
//println "Apply GMS plugin" if (analytics) {
//apply plugin: 'com.google.gms.google-services' println "Apply GMS plugin"
apply plugin: 'com.google.gms.google-services'
}

View file

@ -72,16 +72,16 @@ public class NauticalActivity extends Activity {
} }
public void logEvent(Activity ctx, String event) { public void logEvent(Activity ctx, String event) {
/*
try { try {
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
Method mm = cl.getMethod("getInstance", Context.class); Method mm = cl.getMethod("getInstance", Context.class);
Object inst = mm.invoke(null, ctx == null ? this : ctx); Object inst = mm.invoke(null, ctx == null ? this : ctx);
Method log = cl.getMethod("logEvent", String.class, Bundle.class); Method log = cl.getMethod("logEvent", String.class, Bundle.class);
log.invoke(inst, event, new Bundle()); log.invoke(inst, event, new Bundle());
} catch (ClassNotFoundException e) {
//ignore
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
*/
} }
} }

View file

@ -62,12 +62,18 @@ repositories {
} }
} }
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
dependencies { dependencies {
//compile 'com.google.firebase:firebase-core:9.8.0' if (analytics) {
//compile 'com.google.firebase:firebase-config:9.8.0' compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-config:9.8.0'
}
compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0' compile 'com.android.support:design:23.3.0'
} }
//println "Apply GMS plugin" if (analytics) {
//apply plugin: 'com.google.gms.google-services' println "Apply GMS plugin"
apply plugin: 'com.google.gms.google-services'
}

View file

@ -71,16 +71,16 @@ public class ParkingPluginActivity extends Activity {
} }
public void logEvent(Activity ctx, String event) { public void logEvent(Activity ctx, String event) {
/*
try { try {
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
Method mm = cl.getMethod("getInstance", Context.class); Method mm = cl.getMethod("getInstance", Context.class);
Object inst = mm.invoke(null, ctx == null ? this : ctx); Object inst = mm.invoke(null, ctx == null ? this : ctx);
Method log = cl.getMethod("logEvent", String.class, Bundle.class); Method log = cl.getMethod("logEvent", String.class, Bundle.class);
log.invoke(inst, event, new Bundle()); log.invoke(inst, event, new Bundle());
} catch (ClassNotFoundException e) {
//ignore
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
*/
} }
} }

View file

@ -62,12 +62,18 @@ repositories {
} }
} }
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
dependencies { dependencies {
//compile 'com.google.firebase:firebase-core:9.8.0' if (analytics) {
//compile 'com.google.firebase:firebase-config:9.8.0' compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-config:9.8.0'
}
compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0' compile 'com.android.support:design:23.3.0'
} }
//println "Apply GMS plugin" if (analytics) {
//apply plugin: 'com.google.gms.google-services' println "Apply GMS plugin"
apply plugin: 'com.google.gms.google-services'
}

View file

@ -73,16 +73,16 @@ public class SRTMPluginActivity extends Activity {
} }
public void logEvent(Activity ctx, String event) { public void logEvent(Activity ctx, String event) {
/*
try { try {
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
Method mm = cl.getMethod("getInstance", Context.class); Method mm = cl.getMethod("getInstance", Context.class);
Object inst = mm.invoke(null, ctx == null ? this : ctx); Object inst = mm.invoke(null, ctx == null ? this : ctx);
Method log = cl.getMethod("logEvent", String.class, Bundle.class); Method log = cl.getMethod("logEvent", String.class, Bundle.class);
log.invoke(inst, event, new Bundle()); log.invoke(inst, event, new Bundle());
} catch (ClassNotFoundException e) {
//ignore
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
*/
} }
} }

View file

@ -15,12 +15,12 @@
android:name="net.osmand.skimaps.SkiMapsActivity" android:name="net.osmand.skimaps.SkiMapsActivity"
android:theme="@style/AppTheme" android:theme="@style/AppTheme"
android:label="@string/app_name" > android:label="@string/app_name" >
<!--
<intent-filter> <intent-filter>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter> </intent-filter>
-->
</activity> </activity>
</application> </application>

View file

@ -63,12 +63,18 @@ repositories {
} }
} }
def analytics = System.getenv("USE_FIREBASE_FOR_PLUGINS")
dependencies { dependencies {
//compile 'com.google.firebase:firebase-core:9.8.0' if (analytics) {
//compile 'com.google.firebase:firebase-config:9.8.0' compile 'com.google.firebase:firebase-core:9.8.0'
compile 'com.google.firebase:firebase-config:9.8.0'
}
compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0' compile 'com.android.support:design:23.3.0'
} }
//println "Apply GMS plugin" if (analytics) {
//apply plugin: 'com.google.gms.google-services' println "Apply GMS plugin"
apply plugin: 'com.google.gms.google-services'
}

View file

@ -74,16 +74,16 @@ public class SkiMapsActivity extends Activity {
} }
public void logEvent(Activity ctx, String event) { public void logEvent(Activity ctx, String event) {
/*
try { try {
Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics"); Class<?> cl = Class.forName("com.google.firebase.analytics.FirebaseAnalytics");
Method mm = cl.getMethod("getInstance", Context.class); Method mm = cl.getMethod("getInstance", Context.class);
Object inst = mm.invoke(null, ctx == null ? this : ctx); Object inst = mm.invoke(null, ctx == null ? this : ctx);
Method log = cl.getMethod("logEvent", String.class, Bundle.class); Method log = cl.getMethod("logEvent", String.class, Bundle.class);
log.invoke(inst, event, new Bundle()); log.invoke(inst, event, new Bundle());
} catch (ClassNotFoundException e) {
//ignore
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
*/
} }
} }