Commit b14c7abe authored by Mudar Noufal's avatar Mudar Noufal

Added Crashlytics support

Moved default prefs to App
Added Internet permission for Crashlytics
parent b8167a1a
......@@ -55,3 +55,4 @@ freeline/
freeline_project_description.json
/.idea/markdown-navigator.xml
/.idea/markdown-navigator/profiles_settings.xml
/app/fabric.properties
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 25
......@@ -17,6 +32,7 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
buildConfigField "boolean", "USE_CRASHLYTICS", "true"
ext.enableCrashlytics = true
}
......@@ -25,6 +41,7 @@ android {
versionNameSuffix "-build-" + getDate()
minifyEnabled false
buildConfigField "boolean", "USE_CRASHLYTICS", "false"
ext.enableCrashlytics = false
}
......@@ -48,4 +65,7 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:design:$supportLibVersion"
compile('com.crashlytics.sdk.android:crashlytics:2.6.8@aar') {
transitive = true;
}
}
......@@ -2,9 +2,11 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ca.mudar.rotationquicksetting">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
<application
android:name=".RotationQSApp"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
......@@ -39,4 +41,4 @@
</service>
</application>
</manifest>
\ No newline at end of file
</manifest>
package ca.mudar.rotationquicksetting;
import android.app.Application;
import com.crashlytics.android.Crashlytics;
import ca.mudar.rotationquicksetting.data.UserPrefs;
import io.fabric.sdk.android.Fabric;
/**
* Created by mudar on 22/05/17.
*/
public class RotationQSApp extends Application {
@Override
public void onCreate() {
super.onCreate();
if (BuildConfig.USE_CRASHLYTICS) {
Fabric.with(this, new Crashlytics());
}
UserPrefs.setDefaults(this);
}
}
......@@ -21,9 +21,6 @@ public class MainActivity extends AppCompatActivity implements
showOnboardingIfNecessary();
// Set default preferences
UserPrefs.setDefaults(getApplicationContext());
if (savedInstanceState == null) {
final Fragment fragment = SettingsFragment.newInstance();
getFragmentManager().beginTransaction()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment