Okay, so now you're well on your
way to use ads in your app.
And the time has come to implement,
an interstitial ad.
So to implement the interstitial,
here's what we'll do.
We will implement the interstitial
activity that will contain two buttons
for the initial text, Load Interstitial
and Interstitial Not Ready.
The Load Interstitial button
will have a call back method
called loadInterstitial.
When this method is called,
we will disable the button and
then change the takes to
Loading Interstitial.
The other button will have
a property in interstitial activity
called mShowButton.
It's callback method
will be showInterstitial.
And for the first part of this we
will leave that implementation empty.
As you can see, when the activity
is loaded, this button is disabled.
Therefore, we will set it
to disabled in onCreate.
And finally for this first step,
we will create a string
resource called interstitial_ad_unit_id.
This string resource we will
set to the following value.
And as you may have guessed, this is the
test ad unit ID for interstitial ads.
So let's look in more detail how
these things are implemented.
حسنًا، أنت جاهز جيدًا لاستخدام
إعلانات في تطبيقك.
وحان الوقت لتنفيذ إعلان بيني.
لتنفيذ الإعلان البيني، يوجد هنا
ما سنُنفذه.
سنُنفذ النشاط البيني الذي سيتضمن
زِرّين
للنص الأولي والتحميل البيني والبيني غير
الجاهز.
زر التحميل البيني سيكون له طريقة
استدعاء تُسمى
"استدعاء تحميل بيني".
عندما تتم تسمية هذه الطريقة، سنقوم
بتعطيل الزر
وبعد ذلك يحدث التغيير في
التحميل البيني.
الزر الآخر سيكون له خاصية في
نشاط بيني
يسمى زر العرض.
إنها طريقة استدعاء سوف تعرض
البيني.
ولتنفيذ الجزء الأول من هذا فسوف
نترك هذا التنفيذ فارغًا.
كما تشاهدون، عند انتهاء تحميل النشاط يتم
تعطيل هذا الزر.
ولذلك، سوف نضبط تعطيله
في الإنشاء.
وأخيرًا، بالنسبة للخطوة الأولى هذه، سنقوم
بإنشاء مصدر سلاسل
يسمى interstitial_ad_unit_id.
مصدر السلاسل هذا سوف يُعين للقيمة التالية.
وكما ظننت، هذا اختبار معرف وحدة إعلان
لإعلانات بينية.
لنلقي نظرة على تفاصيل أكثر
عن كيفية تنفيذ هذه الأشياء.
좋습니다. 이제 우리는 앱에서 광고를 사용하는 방식을 배우는 중입니다.
그리고 틈새 광고를 구현할 때가 되었습니다.
그러므로 틈새 광고를 구현하기 위해서 우리가 할 일이 이것입니다.
우리는 최초 문구를 위한 두 버튼을 포함할 틈새 활동을
구현할 것입니다. 바로 Load Interstitial과 Interstitial Not Ready가 그것입니다.
Load Interstitial 버튼은 loadinterstitial이라고 부르는
콜백 메소드를 가질 것입니다.
이 메소드를 부를 때 우리는 버튼을 이용 가능하지 않은 상태로 만들 것이고
그 뒤에 Loading Interstitial을 가지기 위해서 상태 설정을 바꿀 것입니다.
다르 버튼은 틈새 광고 활동에서 속성을 가질 것이며
mShowButton이라고 부릅니다.
이것이 콜백 메소드이고 showInterstitial이 될 것입니다.
이것의 첫 번째 부분을 위해서 우리는 프로그램을 구현하는 부분 중에서 빈칸을 남겨둘 것입니다.
보시다시피, 활동을 로드할 때 이 버튼이 사용하지 않기로 설정됩니다.
그러므로 우리는 onCreate에서 이것을 사용하지 않기로 설정할 것입니다.
그리고 마지막으로 이 첫 번째 단계를 위해서 우리는 스트링 리소스를
만들 것이고 interstitial_ad_unit_id라고 부릅니다.
이 스트링 리소스가 우리가 다음의 값에 설정할 것들입니다.
그리고 추측한 바와 같이 이것이 틈새 광고를 위한 시험 광고 단위 아이디입니다.
그러므로 더 자세한 사하을 봆다. 어떻게 이들을 구현하는지요.
OK, agora você está no caminho certo
para usar anúncios em seu aplicativo.
E chegou a hora de
implementar um anúncio intersticial.
Portanto, para implementar o intersticial,
eis aqui o vamos fazer.
Implementaremos a atividade intersticial,
que conterá dois botões
para o texto inicial, Load Interstitial
e Interstitial Not Ready.
O botão Load Interstitial
terá um método de callback
chamado loadInterstitial.
Quando esse método for chamado,
desabilitaremos o botão
e, em seguida, alteraremos o texto
para Loading Interstitial.
O outro botão terá
uma propriedade na atividade intersticial
chamada mShowButton.
Seu método de callback
será showInterstitial.
Na primeira parte,
deixaremos
essa implementação vazia.
Como você pode ver, quando a atividade
é carregada, esse botão é desabilitado.
Portanto, nós o definiremos
como desabilitado em onCreate.
Finalmente, na primeira etapa,
criaremos um recurso de string
chamado interstitial_ad_unit_id.
Definimos esse recurso de string
com o valor a seguir.
Como você já deve ter adivinhado,
essa é a ID da unidade de anúncios de teste
para anúncios intersticiais.
Vamos examinar mais detalhadamente
como essas coisas são implementadas.
现在 你将继续学习在应用中使用广告
接下来将实现插播式广告
这里列出实现插播式广告需要执行的操作
我们将要实现的插播式 activity 包含两个按钮
其初始文本分别是“加载插播式广告”与“插播式广告未准备就绪”
“加载插播式广告”按钮具有
名为 loadInterstitial 的回调方法
调用该方法时将禁用该按钮
然后将文本更改为“正在加载插播式广告”
另一个按钮在插播式 activity 中
具有名为 mShowButton 的属性
其回调方法是 showInterstitial
对于第一部分 我们对它的实现不添加任何内容
可以看到 加载 activity 时会禁用这个按钮
因此 在 onCreate 中将其设置为禁用
最后 对于第一步
我们将创建名为 interstitial_ad_unit_id 的字符串资源
我们会将此字符串资源设置为以下值
你可能已经猜到 这是插播式广告的测试广告单元 ID
接下来 我们更详细地了解如何实施这些操作