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
 apply plugin: 'com.android.application'
1
 apply plugin: 'com.android.application'
2
 apply plugin: 'android-apt'
2
 apply plugin: 'android-apt'
3
 
3
 
4
-
5
 android {
4
 android {
6
     compileSdkVersion 23
5
     compileSdkVersion 23
7
     buildToolsVersion "23.0.3"
6
     buildToolsVersion "23.0.3"
32
     compile project(path: ':luticateutils')
31
     compile project(path: ':luticateutils')
33
     compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
32
     compile 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
34
     compile 'net.danlew:android.joda:2.9.4.2'
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

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
 import android.support.v7.widget.Toolbar;
7
 import android.support.v7.widget.Toolbar;
8
 import android.view.View;
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
 import com.luticate.utils.business.LuRequest;
13
 import com.luticate.utils.business.LuRequest;
11
 import com.rthoni.stssaguenay.R;
14
 import com.rthoni.stssaguenay.R;
12
 import com.rthoni.stssaguenay.business.STSBusiness;
15
 import com.rthoni.stssaguenay.business.STSBusiness;
33
     @Override
36
     @Override
34
     protected void onCreate(Bundle savedInstanceState) {
37
     protected void onCreate(Bundle savedInstanceState) {
35
         super.onCreate(savedInstanceState);
38
         super.onCreate(savedInstanceState);
39
+
36
         LuRequest.init(this);
40
         LuRequest.init(this);
37
 
41
 
38
         setContentView(R.layout.activity_main);
42
         setContentView(R.layout.activity_main);
39
         ButterKnife.bind(this);
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
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
50
         Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
42
         setSupportActionBar(toolbar);
51
         setSupportActionBar(toolbar);
43
 
52
 

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

5
 import android.os.Bundle;
5
 import android.os.Bundle;
6
 import android.support.v7.app.AppCompatActivity;
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
 import com.luticate.utils.business.LuPromise;
11
 import com.luticate.utils.business.LuPromise;
9
 import com.rthoni.stssaguenay.R;
12
 import com.rthoni.stssaguenay.R;
10
 import com.rthoni.stssaguenay.dbo.FavouriteStopDbo;
13
 import com.rthoni.stssaguenay.dbo.FavouriteStopDbo;
25
     protected void onCreate(Bundle savedInstanceState) {
28
     protected void onCreate(Bundle savedInstanceState) {
26
         super.onCreate(savedInstanceState);
29
         super.onCreate(savedInstanceState);
27
         setContentView(R.layout.activity_stop_picker);
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
         if (getSupportActionBar() != null) {
37
         if (getSupportActionBar() != null) {
29
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
38
             getSupportActionBar().setDisplayHomeAsUpEnabled(true);
30
         }
39
         }

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

2
     xmlns:android="http://schemas.android.com/apk/res/android"
2
     xmlns:android="http://schemas.android.com/apk/res/android"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
3
     xmlns:app="http://schemas.android.com/apk/res-auto"
4
     xmlns:tools="http://schemas.android.com/tools"
4
     xmlns:tools="http://schemas.android.com/tools"
5
+    xmlns:ads="http://schemas.android.com/apk/res-auto"
5
     android:layout_width="match_parent"
6
     android:layout_width="match_parent"
6
     android:layout_height="match_parent"
7
     android:layout_height="match_parent"
7
     android:paddingBottom="@dimen/activity_vertical_margin"
8
     android:paddingBottom="@dimen/activity_vertical_margin"
14
     <FrameLayout
15
     <FrameLayout
15
         android:id="@+id/container"
16
         android:id="@+id/container"
16
         android:layout_width="match_parent"
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
     </FrameLayout>
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
 </RelativeLayout>
31
 </RelativeLayout>

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

3
     xmlns:android="http://schemas.android.com/apk/res/android"
3
     xmlns:android="http://schemas.android.com/apk/res/android"
4
     xmlns:app="http://schemas.android.com/apk/res-auto"
4
     xmlns:app="http://schemas.android.com/apk/res-auto"
5
     xmlns:tools="http://schemas.android.com/tools"
5
     xmlns:tools="http://schemas.android.com/tools"
6
+    xmlns:ads="http://schemas.android.com/apk/res-auto"
6
     android:layout_width="match_parent"
7
     android:layout_width="match_parent"
7
     android:layout_height="match_parent"
8
     android:layout_height="match_parent"
8
     android:paddingBottom="@dimen/activity_vertical_margin"
9
     android:paddingBottom="@dimen/activity_vertical_margin"
16
     <FrameLayout
17
     <FrameLayout
17
         android:id="@+id/container"
18
         android:id="@+id/container"
18
         android:layout_width="match_parent"
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
     </FrameLayout>
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
 </RelativeLayout>
33
 </RelativeLayout>

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

1
 <resources>
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
     <string name="app_name">STS Saguenay</string>
6
     <string name="app_name">STS Saguenay</string>
3
     <string name="title_activity_stop_picker">Pick a stop - STS Saguenay</string>
7
     <string name="title_activity_stop_picker">Pick a stop - STS Saguenay</string>
4
     <string name="favourites_stops">Favourites stops:</string>
8
     <string name="favourites_stops">Favourites stops:</string>

+ 1
- 0
build.gradle View File

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

Loading…
Cancel
Save