Skip to content

Commit

Permalink
ADD: added real ads
Browse files Browse the repository at this point in the history
  • Loading branch information
bxute committed Apr 22, 2018
1 parent a689468 commit a15b609
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
Binary file added app/release/kiti-alpha.apk
Binary file not shown.
Binary file added app/release/kiti-release.apk
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.text.Html;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.ProgressBar;
Expand Down Expand Up @@ -58,7 +59,7 @@ protected void onCreate(Bundle savedInstanceState) {

private void init() {

MobileAds.initialize(this, getResources().getString(R.string.admob_test_app_id));
MobileAds.initialize(this, getResources().getString(R.string.admob_app_id));
// Use an activity context to get the rewarded video instance.
mRewardedVideoAd = MobileAds.getRewardedVideoAdInstance(this);
mRewardedVideoAd.setRewardedVideoAdListener(this);
Expand All @@ -79,15 +80,15 @@ protected void onResume() {
private void initBannerAd() {

MobileAds.initialize(this,
"ca-app-pub-3940256099942544~3347511713");
getResources().getString(R.string.admob_app_id));
AdRequest adRequest = new AdRequest.Builder().build();
adView.loadAd(adRequest);

}


private void loadRewardedVideoAd() {
mRewardedVideoAd.loadAd("ca-app-pub-3940256099942544/5224354917",
mRewardedVideoAd.loadAd(getResources().getString(R.string.real_video_ad_unit),
new AdRequest.Builder().build());
}

Expand Down Expand Up @@ -211,6 +212,7 @@ public void onRewardedVideoAdClosed() {
@Override
public void onRewardedVideoAdFailedToLoad(int errorCode) {
showVideoLoadError();
Log.d("VideoAdError","Error Code:"+errorCode);
//onUserNotSeenFullVideo();
}

Expand Down
3 changes: 2 additions & 1 deletion app/src/main/res/layout/activity_options.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/admob_test_app_id">
ads:adUnitId="@string/real_banner_ad_unit">

</com.google.android.gms.ads.AdView>

</RelativeLayout>
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_video_ad.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,6 @@
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
ads:adSize="SMART_BANNER"
ads:adUnitId="@string/admob_test_app_id"></com.google.android.gms.ads.AdView>
ads:adUnitId="@string/real_banner_ad_unit"></com.google.android.gms.ads.AdView>

</RelativeLayout>
6 changes: 5 additions & 1 deletion app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<resources>
<string name="app_name">KitiApp</string>

<string name="admob_app_id">ca-app-pub-8033884555637397/9481645411</string>
<string name="admob_app_id">ca-app-pub-8033884555637397~9481645411</string>
<string name="admob_test_app_id"> ca-app-pub-3940256099942544/6300978111</string>

<string name="real_video_ad_unit">ca-app-pub-8033884555637397/2462623104</string>
<string name="real_banner_ad_unit">ca-app-pub-8033884555637397/3977641487</string>

<string name="title_activity_main">MainActivity</string>

<string name="navigation_drawer_open">Open navigation drawer</string>
Expand Down

0 comments on commit a15b609

Please sign in to comment.