Difference between revisions of "Android SDK Getting Start"

From AdLocus
Jump to: navigation, search
(Created page with "http://wiki.adlocus.com/index.php?title=Android_SDK_Getting_Start")
 
(→‎取得您的 App Key)
 
(30 intermediate revisions by 3 users not shown)
Line 1: Line 1:
−
http://wiki.adlocus.com/index.php?title=Android_SDK_Getting_Start
+
 
 +
== Getting Start with AdLocus ==
 +
以下將說明您怎麼整入 AdLocus SDK.
 +
 
 +
自我檢查
 +
=== Android Studio ===
 +
* Gradle 中加入AdLocus  (Y/N)
 +
* Tool > Android > Sync Project With Gradle Files  (Y/N)
 +
 
 +
若您已完成上述檢查卻無法正確啟用相關服務, 請來信 support@adlocus.com , 我們將有專人與您聯繫.
 +
 
 +
== 取得您的 App Key ==
 +
* 至 https://adlocus.com/ 點 <開發商> 申請帳號並登入。
 +
* 在「應用程式」中「新增」您的應用程式並取得app key。
 +
 
 +
== 準備將 SDK 加入到您的專案 ==
 +
* [[Android_AddSDK|加入SDK]]
 +
 
 +
== InApp ==
 +
* [[Android_InApp|詳細說明]]
 +
 
 +
== Promotion ==
 +
* [[Android_Promotion|詳細說明]]
 +
 
 +
== Interstitial ==
 +
* [[Android_Interstitial|詳細說明]]
 +
 
 +
== Video ==
 +
* [[Android_Video|詳細說明]]
 +
 
 +
== AdMob Mediation ==
 +
* [[Android_AdMM|詳細說明]]
 +
 
 +
== 測試模式與觀眾定向(Optional) ==
 +
當您完成 SDK 整合後,您可透過設定下列參數開啟測試模式(測試模式下的互動在平台上將不記錄).
 +
* 年齡
 +
* 生日
 +
* 性別
 +
* 測試模式
 +
 
 +
<syntaxhighlight lang="java">
 +
// 設定使用者年齡 (也可使用 setBirthday())
 +
void setAge(int age)
 +
void setBirthDate(GregorianCalendar birthday))
 +
void setGender(AdLocusTargeting$Gender gender)
 +
void setTestMode(boolean isTesting)
 +
 
 +
// 設置範例:
 +
AdLocusTargeting targeting = new AdLocusTargeting();
 +
targeting.setAge(23);
 +
targeting.setBirthDate(new GregorianCalendar(1990, 12, 29));
 +
targeting.setGender(AdLocusTargeting$Gender.MALE);
 +
targeting.setTestMode(true);  //使用測試模式
 +
</syntaxhighlight>
 +
 
 +
=== 開啟測試/定向 ===
 +
 
 +
==== InApp ====
 +
<syntaxhighlight lang="java">
 +
AdLocusLayout adlocusLayout1 =  new AdLocusLayout(this,
 +
AdLocusLayout.AD_SIZE_IAB_MRECT,
 +
appKey,
 +
15,
 +
targeting);
 +
</syntaxhighlight>
 +
 
 +
==== Promotion ====
 +
<syntaxhighlight lang="java">
 +
PushAd.enablePush(this, "your app key", promotionIntent, targeting);
 +
</syntaxhighlight>

Latest revision as of 10:24, 3 December 2019

Getting Start with AdLocus

以下將說明您怎麼整入 AdLocus SDK.

自我檢查

Android Studio

  • Gradle 中加入AdLocus (Y/N)
  • Tool > Android > Sync Project With Gradle Files (Y/N)

若您已完成上述檢查卻無法正確啟用相關服務, 請來信 support@adlocus.com , 我們將有專人與您聯繫.

取得您的 App Key

  • 至 https://adlocus.com/ 點 <開發商> 申請帳號並登入。
  • 在「應用程式」中「新增」您的應用程式並取得app key。

準備將 SDK 加入到您的專案

InApp

Promotion

Interstitial

Video

AdMob Mediation

測試模式與觀眾定向(Optional)

當您完成 SDK 整合後,您可透過設定下列參數開啟測試模式(測試模式下的互動在平台上將不記錄).

  • 年齡
  • 生日
  • 性別
  • 測試模式
// 設定使用者年齡 (也可使用 setBirthday())
void setAge(int age) 
void setBirthDate(GregorianCalendar birthday))
void setGender(AdLocusTargeting$Gender gender)
void setTestMode(boolean isTesting)
 
// 設置範例:
AdLocusTargeting targeting = new AdLocusTargeting();
targeting.setAge(23); 
targeting.setBirthDate(new GregorianCalendar(1990, 12, 29));
targeting.setGender(AdLocusTargeting$Gender.MALE); 
targeting.setTestMode(true);  //使用測試模式

開啟測試/定向

InApp

AdLocusLayout adlocusLayout1 =  new AdLocusLayout(this,
				AdLocusLayout.AD_SIZE_IAB_MRECT,
				appKey, 
				15,
				targeting);

Promotion

PushAd.enablePush(this, "your app key", promotionIntent, targeting);