Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/initial firebase and crash setup #10

Merged
merged 2 commits into from
Sep 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'

// https://firebase.google.com/docs/android/setup
classpath 'com.google.gms:google-services:3.0.0'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
Expand Down Expand Up @@ -34,8 +37,9 @@ ext {
// Android SDK Build Tools - Versions: https://developer.android.com/studio/releases/build-tools.html
buildToolsVersion = '24.0.2'

// Support library dependencies
// Google Products & Support library dependencies
supportLibraryVersion = '24.2.1'
firebaseVersion = '9.4.0'

// Unit test dependencies
junitVersion = '4.12'
Expand Down
19 changes: 17 additions & 2 deletions mobile/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "info.hossainkhan.dailynewsheadlines"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0-moboile"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
Expand All @@ -26,8 +26,23 @@ dependencies {

compile project(':core-lib')

// Firebase CORE
// https://firebase.google.com/docs/android/setup
compile "com.google.firebase:firebase-core:$rootProject.firebaseVersion"

// Firebase - Crash Reporting
// https://firebase.google.com/docs/crash/android
compile "com.google.firebase:firebase-crash:$rootProject.firebaseVersion"


// ----------------------------------------------------------------
// Android Unit and Instrumentation test
// ----------------------------------------------------------------
androidTestCompile("com.android.support.test.espresso:espresso-core:$rootProject.espressoVersion", {
exclude group: 'com.android.support', module: 'support-annotations'
})
testCompile "junit:junit:$rootProject.junitVersion"
}

// **IMPORTANT** Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
42 changes: 42 additions & 0 deletions mobile/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"project_info": {
"project_number": "738300055459",
"firebase_url": "https://daily-headlines-e7091.firebaseio.com",
"project_id": "daily-headlines-e7091",
"storage_bucket": "daily-headlines-e7091.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:738300055459:android:733b1b4c8f216cc7",
"android_client_info": {
"package_name": "info.hossainkhan.dailynewsheadlines"
}
},
"oauth_client": [
{
"client_id": "738300055459-f1he2moe6nohed9uk2lee703snqheo5d.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC2HAlZyYo0qc-ZJ6TYyFz2AskypYxPLYQ"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
1 change: 1 addition & 0 deletions mobile/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package="info.hossainkhan.dailynewsheadlines">

<application
android:name=".CoreApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* MIT License
*
* Copyright (c) 2016 Hossain Khan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package info.hossainkhan.dailynewsheadlines;

import android.app.Application;

public class CoreApplication extends Application {
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import android.util.Log;

import com.example.ApiCore;
import com.google.firebase.crash.FirebaseCrash;

import info.hossainkhan.android.core.CoreConfig;

Expand All @@ -18,4 +19,12 @@ protected void onCreate(Bundle savedInstanceState) {

Log.d(TAG, "onCreate: " + ApiCore.TEST + CoreConfig.NAME);
}

@Override
protected void onStart() {
super.onStart();

// Test firebase crash
//FirebaseCrash.report(new Exception("My first Android non-fatal error"));
}
}
16 changes: 14 additions & 2 deletions tv/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId "info.hossainkhan.dailynewsheadlines"
minSdkVersion 21
targetSdkVersion 24
versionCode 1
versionName "1.0"
versionCode 2
versionName "1.0-tv"
}
buildTypes {
release {
Expand All @@ -22,4 +22,16 @@ dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile "com.android.support:leanback-v17:$rootProject.supportLibraryVersion"
compile "com.android.support:appcompat-v7:$rootProject.supportLibraryVersion"

// Firebase CORE
// https://firebase.google.com/docs/android/setup
compile "com.google.firebase:firebase-core:$rootProject.firebaseVersion"

// Firebase - Crash Reporting
// https://firebase.google.com/docs/crash/android
compile "com.google.firebase:firebase-crash:$rootProject.firebaseVersion"
}


// **IMPORTANT** Add to the bottom of the file
apply plugin: 'com.google.gms.google-services'
42 changes: 42 additions & 0 deletions tv/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"project_info": {
"project_number": "738300055459",
"firebase_url": "https://daily-headlines-e7091.firebaseio.com",
"project_id": "daily-headlines-e7091",
"storage_bucket": "daily-headlines-e7091.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:738300055459:android:733b1b4c8f216cc7",
"android_client_info": {
"package_name": "info.hossainkhan.dailynewsheadlines"
}
},
"oauth_client": [
{
"client_id": "738300055459-f1he2moe6nohed9uk2lee703snqheo5d.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyC2HAlZyYo0qc-ZJ6TYyFz2AskypYxPLYQ"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
1 change: 1 addition & 0 deletions tv/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


<application
android:name=".CoreApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* MIT License
*
* Copyright (c) 2016 Hossain Khan
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

package info.hossainkhan.dailynewsheadlines;

import android.app.Application;

public class CoreApplication extends Application {
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
import android.app.Activity;
import android.os.Bundle;

import com.google.firebase.crash.FirebaseCrash;

/*
* MainActivity class that loads MainFragment
*/
Expand All @@ -40,4 +42,13 @@ public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}

@Override
protected void onStart() {
super.onStart();


// Test firebase crash reporting
//FirebaseCrash.report(new Exception("My first Android non-fatal error for Android TV App"));
}
}