Skip to content

Commit b1b8e72

Browse files
committed
Add analytics module
1 parent 53d1f7f commit b1b8e72

27 files changed

+746
-1
lines changed

analytics/.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
*.iml
2+
.gradle
3+
/local.properties
4+
/.idea/workspace.xml
5+
/.idea/libraries
6+
.DS_Store
7+
/build
8+
/captures
9+
.externalNativeBuild

analytics/app/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

analytics/app/build.gradle

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apply plugin: 'com.android.application'
2+
apply plugin: 'kotlin-android'
3+
apply plugin: 'kotlin-android-extensions'
4+
5+
android {
6+
compileSdkVersion 29
7+
8+
defaultConfig {
9+
applicationId "com.google.firebase.example.analytics"
10+
minSdkVersion 16
11+
targetSdkVersion 29
12+
versionCode 1
13+
versionName "1.0"
14+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
15+
}
16+
buildTypes {
17+
release {
18+
minifyEnabled false
19+
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
20+
}
21+
}
22+
}
23+
24+
dependencies {
25+
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
26+
implementation 'androidx.appcompat:appcompat:1.1.0'
27+
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.71"
28+
29+
implementation "com.google.firebase:firebase-analytics:17.3.0"
30+
implementation "com.google.firebase:firebase-analytics-ktx:17.3.0"
31+
}
32+
33+
apply plugin: 'com.google.gms.google-services'

analytics/app/google-services.json

+236
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,236 @@
1+
{
2+
"project_info": {
3+
"project_id": "mockproject-1234",
4+
"project_number": "123456789000",
5+
"name": "FirebaseQuickstarts",
6+
"firebase_url": "https://mockproject-1234.firebaseio.com"
7+
},
8+
"client": [
9+
{
10+
"client_info": {
11+
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04063",
12+
"client_id": "android:com.google.firebase.referencecode.database",
13+
"client_type": 1,
14+
"android_client_info": {
15+
"package_name": "com.google.firebase.referencecode.database",
16+
"certificate_hash": []
17+
}
18+
},
19+
"oauth_client": [
20+
{
21+
"client_id": "123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com",
22+
"client_type": 1,
23+
"android_info": {
24+
"package_name": "com.google.firebase.referencecode.database",
25+
"certificate_hash": "4C20644DE36B8F89D25650C7D1FF9FBAE650FDF7"
26+
}
27+
},
28+
{
29+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
30+
"client_type": 3
31+
}
32+
],
33+
"api_key": [
34+
{
35+
"current_key": "AIzbSzCn1N6LWIe6wthYyrgUUSAlUsdqMb-wvTo"
36+
}
37+
],
38+
"services": {
39+
"analytics_service": {
40+
"status": 1
41+
},
42+
"cloud_messaging_service": {
43+
"status": 2,
44+
"apns_config": []
45+
},
46+
"appinvite_service": {
47+
"status": 2,
48+
"other_platform_oauth_client": [
49+
{
50+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
51+
"client_type": 3
52+
}
53+
]
54+
},
55+
"google_signin_service": {
56+
"status": 2
57+
},
58+
"ads_service": {
59+
"status": 2,
60+
"test_banner_ad_unit_id": "ca-app-pub-3940256099942544/6300978111",
61+
"test_interstitial_ad_unit_id": "ca-app-pub-3940256099942544/1033173712"
62+
}
63+
}
64+
},
65+
{
66+
"client_info": {
67+
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04064",
68+
"client_id": "android:devrel.firebase.google.com.firebaseoptions",
69+
"client_type": 1,
70+
"android_client_info": {
71+
"package_name": "devrel.firebase.google.com.firebaseoptions",
72+
"certificate_hash": []
73+
}
74+
},
75+
"oauth_client": [
76+
{
77+
"client_id": "123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com",
78+
"client_type": 1,
79+
"android_info": {
80+
"package_name": "devrel.firebase.google.com.firebaseoptions",
81+
"certificate_hash": "4C20644DE36B8F89D25650C7D1FF9FBAE650FDF7"
82+
}
83+
},
84+
{
85+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
86+
"client_type": 3
87+
}
88+
],
89+
"api_key": [
90+
{
91+
"current_key": "AIzbSzCn1N6LWIe6wthYyrgUUSAlUsdqMb-wvTo"
92+
}
93+
],
94+
"services": {
95+
"analytics_service": {
96+
"status": 1
97+
},
98+
"cloud_messaging_service": {
99+
"status": 2,
100+
"apns_config": []
101+
},
102+
"appinvite_service": {
103+
"status": 2,
104+
"other_platform_oauth_client": [
105+
{
106+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
107+
"client_type": 3
108+
}
109+
]
110+
},
111+
"google_signin_service": {
112+
"status": 2
113+
},
114+
"ads_service": {
115+
"status": 2,
116+
"test_banner_ad_unit_id": "ca-app-pub-3940256099942544/6300978111",
117+
"test_interstitial_ad_unit_id": "ca-app-pub-3940256099942544/1033173712"
118+
}
119+
}
120+
},
121+
{
122+
"client_info": {
123+
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04064",
124+
"client_id": "android:com.google.firebase.example.analytics",
125+
"client_type": 1,
126+
"android_client_info": {
127+
"package_name": "com.google.firebase.example.analytics",
128+
"certificate_hash": []
129+
}
130+
},
131+
"oauth_client": [
132+
{
133+
"client_id": "123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com",
134+
"client_type": 1,
135+
"android_info": {
136+
"package_name": "com.google.firebase.example.analytics",
137+
"certificate_hash": "4C20644DE36B8F89D25650C7D1FF9FBAE650FDF7"
138+
}
139+
},
140+
{
141+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
142+
"client_type": 3
143+
}
144+
],
145+
"api_key": [
146+
{
147+
"current_key": "AIzbSzCn1N6LWIe6wthYyrgUUSAlUsdqMb-wvTo"
148+
}
149+
],
150+
"services": {
151+
"analytics_service": {
152+
"status": 1
153+
},
154+
"cloud_messaging_service": {
155+
"status": 2,
156+
"apns_config": []
157+
},
158+
"appinvite_service": {
159+
"status": 2,
160+
"other_platform_oauth_client": [
161+
{
162+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
163+
"client_type": 3
164+
}
165+
]
166+
},
167+
"google_signin_service": {
168+
"status": 2
169+
},
170+
"ads_service": {
171+
"status": 2,
172+
"test_banner_ad_unit_id": "ca-app-pub-3940256099942544/6300978111",
173+
"test_interstitial_ad_unit_id": "ca-app-pub-3940256099942544/1033173712"
174+
}
175+
}
176+
},
177+
{
178+
"client_info": {
179+
"mobilesdk_app_id": "1:123456789000:android:f1bf012572b04065",
180+
"client_id": "android:com.google.firebase.referencecode.storage",
181+
"client_type": 1,
182+
"android_client_info": {
183+
"package_name": "com.google.firebase.referencecode.storage",
184+
"certificate_hash": []
185+
}
186+
},
187+
"oauth_client": [
188+
{
189+
"client_id": "123456789000-hjugbg6ud799v4c49dim8ce2usclthar.apps.googleusercontent.com",
190+
"client_type": 1,
191+
"android_info": {
192+
"package_name": "com.google.firebase.referencecode.storage",
193+
"certificate_hash": "4C20644DE36B8F89D25650C7D1FF9FBAE650FDF7"
194+
}
195+
},
196+
{
197+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
198+
"client_type": 3
199+
}
200+
],
201+
"api_key": [
202+
{
203+
"current_key": "AIzbSzCn1N6LWIe6wthYyrgUUSAlUsdqMb-wvTo"
204+
}
205+
],
206+
"services": {
207+
"analytics_service": {
208+
"status": 1
209+
},
210+
"cloud_messaging_service": {
211+
"status": 2,
212+
"apns_config": []
213+
},
214+
"appinvite_service": {
215+
"status": 2,
216+
"other_platform_oauth_client": [
217+
{
218+
"client_id": "123456789000-e4uksm38sne0bqrj6uvkbo4oiu4hvigl.apps.googleusercontent.com",
219+
"client_type": 3
220+
}
221+
]
222+
},
223+
"google_signin_service": {
224+
"status": 2
225+
},
226+
"ads_service": {
227+
"status": 2,
228+
"test_banner_ad_unit_id": "ca-app-pub-3940256099942544/6300978111",
229+
"test_interstitial_ad_unit_id": "ca-app-pub-3940256099942544/1033173712"
230+
}
231+
}
232+
}
233+
],
234+
"client_info": [],
235+
"ARTIFACT_VERSION": "1"
236+
}

analytics/app/proguard-rules.pro

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /Users/ianbarber/Library/Android/sdk/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# Add any project specific keep options here:
11+
12+
# If your project uses WebView with JS, uncomment the following
13+
# and specify the fully qualified class name to the JavaScript interface
14+
# class:
15+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16+
# public *;
17+
#}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
package="com.google.firebase.example.analytics">
4+
5+
<application
6+
android:allowBackup="true"
7+
android:icon="@mipmap/ic_launcher"
8+
android:label="@string/app_name"
9+
android:supportsRtl="true"
10+
android:theme="@style/AppTheme">
11+
<activity android:name=".MainActivity">
12+
<intent-filter>
13+
<action android:name="android.intent.action.MAIN"/>
14+
15+
<category android:name="android.intent.category.LAUNCHER"/>
16+
</intent-filter>
17+
</activity>
18+
<activity android:name=".kotlin.MainActivity"/>
19+
</application>
20+
21+
</manifest>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright 2017 Google Inc. All Rights Reserved.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
package com.google.firebase.example.analytics;
17+
18+
import android.os.Bundle;
19+
20+
import androidx.appcompat.app.AppCompatActivity;
21+
22+
public class MainActivity extends AppCompatActivity {
23+
24+
@Override
25+
protected void onCreate(Bundle savedInstanceState) {
26+
super.onCreate(savedInstanceState);
27+
setContentView(R.layout.activity_main);
28+
}
29+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.google.firebase.example.analytics.kotlin
2+
3+
import android.os.Bundle
4+
import androidx.appcompat.app.AppCompatActivity
5+
import com.google.firebase.example.analytics.R
6+
7+
class MainActivity : AppCompatActivity() {
8+
9+
override fun onCreate(savedInstanceState: Bundle?) {
10+
super.onCreate(savedInstanceState)
11+
setContentView(R.layout.activity_main)
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<RelativeLayout
3+
xmlns:android="http://schemas.android.com/apk/res/android"
4+
xmlns:tools="http://schemas.android.com/tools"
5+
android:id="@+id/activity_main"
6+
android:layout_width="match_parent"
7+
android:layout_height="match_parent"
8+
android:paddingLeft="@dimen/activity_horizontal_margin"
9+
android:paddingRight="@dimen/activity_horizontal_margin"
10+
android:paddingTop="@dimen/activity_vertical_margin"
11+
android:paddingBottom="@dimen/activity_vertical_margin"
12+
tools:context="com.google.firebase.example.analytics.kotlin.MainActivity">
13+
14+
<TextView
15+
android:layout_width="wrap_content"
16+
android:layout_height="wrap_content"
17+
android:text="Hello World!"/>
18+
</RelativeLayout>
Loading
Loading
Loading
Loading
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<resources>
2+
<!-- Example customization of dimensions originally defined in res/values/dimens.xml
3+
(such as screen margins) for screens with more than 820dp of available width. This
4+
would include 7" and 10" devices in landscape (~960dp and ~1280dp respectively). -->
5+
<dimen name="activity_horizontal_margin">64dp</dimen>
6+
</resources>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<resources>
3+
<color name="colorPrimary">#3F51B5</color>
4+
<color name="colorPrimaryDark">#303F9F</color>
5+
<color name="colorAccent">#FF4081</color>
6+
</resources>

0 commit comments

Comments
 (0)