Return to Video

Student Implements Layout

  • 0:00 - 0:04
    So here is a demonstration of
    the skeleton app that was just created.
  • 0:04 - 0:08
    So here is our main window, and if I
    click on the Interstitial Ad button,
  • 0:08 - 0:11
    I will launch
    the Interstitial Ad activity.
  • 0:11 - 0:15
    You can now see that we have the two
    buttons here, Load Interstitial and
  • 0:15 - 0:17
    Interstitial Not Ready.
  • 0:17 - 0:21
    The Interstitial Not Ready button
    is our mShowButton member of
  • 0:21 - 0:23
    the Interstitial activity.
  • 0:23 - 0:28
    And as you can see, this is disabled
    since we disabled it in our code.
  • 0:28 - 0:30
    Now, when I click on Load Interstitial,
  • 0:30 - 0:33
    you'll see that the text of this button
    changes to Loading Interstitial.
  • 0:35 - 0:37
    Now it's your turn to implement this.
  • 0:37 - 0:38
    Let's see what we did.
  • 0:38 - 0:42
    We created two buttons in the layout
    file of InterstitialActivity,
  • 0:42 - 0:45
    Load Interstitial and
    Interstitial Not Ready.
  • 0:45 - 0:50
    We defined a callback for Load
    Interstitial to be loadInterstitial.
  • 0:50 - 0:55
    And in this callback we disable
    the button Interstitial Not Ready, and
  • 0:55 - 1:00
    we change the text of Interstitial
    Not Ready to Loading Interstitial.
  • 1:00 - 1:04
    To be able to disable and change the
    text of this button programmatically,
  • 1:04 - 1:06
    we need to define it as a Property or
  • 1:06 - 1:09
    a member of our
    InterstitialActivity class.
  • 1:09 - 1:12
    This member had the name mShowButton.
  • 1:12 - 1:16
    We define the callback for
    this button to be showInterstitial.
  • 1:16 - 1:20
    And for now, we left the implementation
    of this callback empty.
  • 1:20 - 1:23
    We also disable this button in onCreate.
  • 1:23 - 1:28
    And finally, we defined the
    interstitial_ad_unit_id to be this value
  • 1:28 - 1:30
    in our string resource file.
  • 1:30 - 1:35
    And remember, this value is to test
    ad unit ID for interstitial ads.
  • 1:35 - 1:38
    Now it's your turn to
    do all of these things.
  • 1:38 - 1:40
    And check here when you're finished.
Cím:
Student Implements Layout
Leírás:

more » « less
Video Language:
English
Team:
Udacity
Projekt:
ud876-3 - Google Play Services - AdMob
Duration:
01:41

English subtitles

Felülvizsgálatok Compare revisions