Skip to content
This repository has been archived by the owner on Jun 20, 2018. It is now read-only.

Commit

Permalink
Added Crashlytics support
Browse files Browse the repository at this point in the history
Moved default prefs to App
Added Internet permission for Crashlytics
  • Loading branch information
mudar committed May 22, 2017
1 parent b8167a1 commit b14c7ab
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -55,3 +55,4 @@ freeline/
freeline_project_description.json
/.idea/markdown-navigator.xml
/.idea/markdown-navigator/profiles_settings.xml
/app/fabric.properties
20 changes: 20 additions & 0 deletions app/build.gradle
@@ -1,4 +1,19 @@
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
Expand All @@ -17,6 +32,7 @@ android {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

buildConfigField "boolean", "USE_CRASHLYTICS", "true"
ext.enableCrashlytics = true
}

Expand All @@ -25,6 +41,7 @@ android {
versionNameSuffix "-build-" + getDate()
minifyEnabled false

buildConfigField "boolean", "USE_CRASHLYTICS", "false"
ext.enableCrashlytics = false
}

Expand All @@ -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;
}
}
4 changes: 3 additions & 1 deletion app/src/main/AndroidManifest.xml
Expand Up @@ -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"
Expand Down Expand Up @@ -39,4 +41,4 @@
</service>
</application>

</manifest>
</manifest>
27 changes: 27 additions & 0 deletions app/src/main/java/ca/mudar/rotationquicksetting/RotationQSApp.java
@@ -0,0 +1,27 @@
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);

}

}
Expand Up @@ -21,9 +21,6 @@ protected void onCreate(Bundle savedInstanceState) {

showOnboardingIfNecessary();

// Set default preferences
UserPrefs.setDefaults(getApplicationContext());

if (savedInstanceState == null) {
final Fragment fragment = SettingsFragment.newInstance();
getFragmentManager().beginTransaction()
Expand Down

0 comments on commit b14c7ab

Please sign in to comment.