Browse Source

Pixou, The first jewish

tags/v1.0.0
Robin Thoni 7 years ago
parent
commit
09d222ebe1

+ 3
- 1
app/build.gradle View File

@@ -1,7 +1,6 @@
1 1
 apply plugin: 'com.android.application'
2 2
 apply plugin: 'android-apt'
3 3
 
4
-
5 4
 android {
6 5
     compileSdkVersion 23
7 6
     buildToolsVersion "23.0.3"
@@ -32,4 +31,7 @@ dependencies {
32 31
     compile project(path: ':luticateutils')
33 32
     compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
34 33
     compile 'net.danlew:android.joda:2.9.4.2'
34
+    compile 'com.google.firebase:firebase-ads:9.6.1'
35 35
 }
36
+
37
+apply plugin: 'com.google.gms.google-services'

+ 42
- 0
app/google-services.json View File

@@ -0,0 +1,42 @@
1
+{
2
+  "project_info": {
3
+    "project_number": "171393394108",
4
+    "firebase_url": "https://admob-app-id-3084832113.firebaseio.com",
5
+    "project_id": "admob-app-id-3084832113",
6
+    "storage_bucket": "admob-app-id-3084832113.appspot.com"
7
+  },
8
+  "client": [
9
+    {
10
+      "client_info": {
11
+        "mobilesdk_app_id": "1:171393394108:android:6fd8956541c81e90",
12
+        "android_client_info": {
13
+          "package_name": "com.rthoni.stssaguenay"
14
+        }
15
+      },
16
+      "oauth_client": [
17
+        {
18
+          "client_id": "171393394108-eovbvhuab49spjk18c382f1ueqij1lvv.apps.googleusercontent.com",
19
+          "client_type": 3
20
+        }
21
+      ],
22
+      "api_key": [
23
+        {
24
+          "current_key": "AIzaSyDfBkaeX5670C6Y-AYZgl5wRNV-pr8mldw"
25
+        }
26
+      ],
27
+      "services": {
28
+        "analytics_service": {
29
+          "status": 1
30
+        },
31
+        "appinvite_service": {
32
+          "status": 1,
33
+          "other_platform_oauth_client": []
34
+        },
35
+        "ads_service": {
36
+          "status": 2
37
+        }
38
+      }
39
+    }
40
+  ],
41
+  "configuration_version": "1"
42
+}

+ 9
- 0
app/src/main/java/com/rthoni/stssaguenay/ui/activities/MainActivity.java View File

@@ -7,6 +7,9 @@ import android.support.v7.app.AppCompatActivity;
7 7
 import android.support.v7.widget.Toolbar;
8 8
 import android.view.View;
9 9
 
10
+import com.google.android.gms.ads.AdRequest;
11
+import com.google.android.gms.ads.AdView;
12
+import com.google.android.gms.ads.MobileAds;
10 13
 import com.luticate.utils.business.LuRequest;
11 14
 import com.rthoni.stssaguenay.R;
12 15
 import com.rthoni.stssaguenay.business.STSBusiness;
@@ -33,11 +36,17 @@ public class MainActivity extends AppCompatActivity {
33 36
     @Override
34 37
     protected void onCreate(Bundle savedInstanceState) {
35 38
         super.onCreate(savedInstanceState);
39
+
36 40
         LuRequest.init(this);
37 41
 
38 42
         setContentView(R.layout.activity_main);
39 43
         ButterKnife.bind(this);
40 44
 
45
+        MobileAds.initialize(getApplicationContext(), getString(R.string.ad_init));
46
+        AdView mAdView = (AdView) findViewById(R.id.adView);
47
+        AdRequest adRequest = new AdRequest.Builder().build();
48
+        mAdView.loadAd(adRequest);
49
+
41 50
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
42 51
         setSupportActionBar(toolbar);
43 52
 

+ 9
- 0
app/src/main/java/com/rthoni/stssaguenay/ui/activities/StopPickerActivity.java View File

@@ -5,6 +5,9 @@ import android.content.Intent;
5 5
 import android.os.Bundle;
6 6
 import android.support.v7.app.AppCompatActivity;
7 7
 
8
+import com.google.android.gms.ads.AdRequest;
9
+import com.google.android.gms.ads.AdView;
10
+import com.google.android.gms.ads.MobileAds;
8 11
 import com.luticate.utils.business.LuPromise;
9 12
 import com.rthoni.stssaguenay.R;
10 13
 import com.rthoni.stssaguenay.dbo.FavouriteStopDbo;
@@ -25,6 +28,12 @@ public class StopPickerActivity extends AppCompatActivity {
25 28
     protected void onCreate(Bundle savedInstanceState) {
26 29
         super.onCreate(savedInstanceState);
27 30
         setContentView(R.layout.activity_stop_picker);
31
+
32
+        MobileAds.initialize(getApplicationContext(), getString(R.string.ad_init));
33
+        AdView mAdView = (AdView) findViewById(R.id.adView);
34
+        AdRequest adRequest = new AdRequest.Builder().build();
35
+        mAdView.loadAd(adRequest);
36
+
28 37
         if (getSupportActionBar() != null) {
29 38
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
30 39
         }

+ 13
- 1
app/src/main/res/layout/activity_stop_picker.xml View File

@@ -2,6 +2,7 @@
2 2
     xmlns:android="http://schemas.android.com/apk/res/android"
3 3
     xmlns:app="http://schemas.android.com/apk/res-auto"
4 4
     xmlns:tools="http://schemas.android.com/tools"
5
+    xmlns:ads="http://schemas.android.com/apk/res-auto"
5 6
     android:layout_width="match_parent"
6 7
     android:layout_height="match_parent"
7 8
     android:paddingBottom="@dimen/activity_vertical_margin"
@@ -14,6 +15,17 @@
14 15
     <FrameLayout
15 16
         android:id="@+id/container"
16 17
         android:layout_width="match_parent"
17
-        android:layout_height="match_parent">
18
+        android:layout_height="match_parent"
19
+        android:layout_above="@+id/adView">
18 20
     </FrameLayout>
21
+
22
+    <com.google.android.gms.ads.AdView
23
+        android:id="@+id/adView"
24
+        android:layout_width="wrap_content"
25
+        android:layout_height="wrap_content"
26
+        android:layout_centerHorizontal="true"
27
+        android:layout_alignParentBottom="true"
28
+        ads:adSize="BANNER"
29
+        ads:adUnitId="@string/banner_ad_unit_id">
30
+    </com.google.android.gms.ads.AdView>
19 31
 </RelativeLayout>

+ 13
- 1
app/src/main/res/layout/content_main.xml View File

@@ -3,6 +3,7 @@
3 3
     xmlns:android="http://schemas.android.com/apk/res/android"
4 4
     xmlns:app="http://schemas.android.com/apk/res-auto"
5 5
     xmlns:tools="http://schemas.android.com/tools"
6
+    xmlns:ads="http://schemas.android.com/apk/res-auto"
6 7
     android:layout_width="match_parent"
7 8
     android:layout_height="match_parent"
8 9
     android:paddingBottom="@dimen/activity_vertical_margin"
@@ -16,6 +17,17 @@
16 17
     <FrameLayout
17 18
         android:id="@+id/container"
18 19
         android:layout_width="match_parent"
19
-        android:layout_height="match_parent">
20
+        android:layout_height="match_parent"
21
+        android:layout_above="@+id/adView">
20 22
     </FrameLayout>
23
+
24
+    <com.google.android.gms.ads.AdView
25
+        android:id="@+id/adView"
26
+        android:layout_width="wrap_content"
27
+        android:layout_height="wrap_content"
28
+        android:layout_centerHorizontal="true"
29
+        android:layout_alignParentBottom="true"
30
+        ads:adSize="BANNER"
31
+        ads:adUnitId="@string/banner_ad_unit_id">
32
+    </com.google.android.gms.ads.AdView>
21 33
 </RelativeLayout>

+ 4
- 0
app/src/main/res/values/strings.xml View File

@@ -1,4 +1,8 @@
1 1
 <resources>
2
+    <!--<string name="banner_ad_unit_id">ca-app-pub-2016581167110949/4561565315</string>-->
3
+    <string name="banner_ad_unit_id">ca-app-pub-3940256099942544/6300978111</string>
4
+    <string name="ad_init">ca-app-pub-2016581167110949~3084832113</string>
5
+
2 6
     <string name="app_name">STS Saguenay</string>
3 7
     <string name="title_activity_stop_picker">Pick a stop - STS Saguenay</string>
4 8
     <string name="favourites_stops">Favourites stops:</string>

+ 1
- 0
build.gradle View File

@@ -11,6 +11,7 @@ buildscript {
11 11
     dependencies {
12 12
         classpath 'com.android.tools.build:gradle:2.2.0'
13 13
         classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
14
+        classpath 'com.google.gms:google-services:3.0.0'
14 15
 
15 16
         // NOTE: Do not place your application dependencies here; they belong
16 17
         // in the individual module build.gradle files

Loading…
Cancel
Save