「Android Getting Started 3.0」修訂間的差異
跳至導覽
跳至搜尋
imported>Wikiuser |
imported>Wikiuser |
||
行 21: | 行 21: | ||
implementation files('libs/adpmobile-lib-r6.0.0.jar') | implementation files('libs/adpmobile-lib-r6.0.0.jar') | ||
} | } | ||
<br><br> | |||
<big><u>Step 3: 在<b>AndroidManifest.xml</b>的manifest tag宣告權限</u></big><br> | <big><u>Step 3: 在<b>AndroidManifest.xml</b>的manifest tag宣告權限</u></big><br> | ||
:[[image:Import SDK6 Step3-1.PNG | 300px]] | :[[image:Import SDK6 Step3-1.PNG | 300px]]<br><br> | ||
:<ul><li>Required Permission</li></ul> | :<ul><li>Required Permission</li></ul> | ||
<!-- TAMedia Required Permission --> | <!-- TAMedia Required Permission --> | ||
行 40: | 行 40: | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<br><br><br> | <br><br> | ||
<big><u>Step 4: 在<b>AndroidManifest.xml</b>的manifest tag宣告Activity</u></big><br> | |||
<!-- TAMedia Activity --> | |||
<activity | |||
android:name="com.taiwanmobile.pt.adp.view.TWMAdActivity" | |||
android:configChanges="orientation|keyboardHidden|navigation|keyboard|screenLayout|uiMode|screenSize|smallestScreenSize" | |||
android:hardwareAccelerated="true" | |||
android:theme="@android:style/Theme.Translucent" > | |||
</activity> | |||
<br> | |||
[[Android SDK Developer Guide 2 | 回首頁]] |
於 2018年6月5日 (二) 09:57 的修訂
簡介
- TAMedia SDK提供Android Mobile App開發者簡易迅速的方式整合行動App廣告, 廣告的種類包含橫幅Banner, 全版Interstitial, Rich Media, 原生性廣告以及InRead廣告, 使用上跟Google Mobile Ads (Admob)類似, 能大量節省開發者學習時間
系統需求
- Android 4.0以上 (API Level 14+), InRead廣告則需Android 5.0以上 (API Level 21+)
以Android Studio整合SDK
請按照下列方式設置專案
Step 1: 將SDK放入app專案的libs資料夾
- 請至下載 Download SDK下載SDK,並將壓縮檔內的JAR檔 (adpmobile-lib-rx.x.x.jar) 放至專案的libs資料夾
Step 2: 在app的build.gradle的dependencies內加入下列程式 (請根據jar檔名字自行調整)
dependencies { /* Other dependencies... */ implementation 'com.google.android.gms:play-services-ads:15.0.1' implementation 'com.squareup.retrofit2:retrofit:2.3.0' /* SDK6以上請加入 */ implementation files('libs/adpmobile-lib-r6.0.0.jar') }
Step 3: 在AndroidManifest.xml的manifest tag宣告權限
<!-- TAMedia Required Permission --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <!-- SDK4.0以上版本請移除 -->
- Optional Permission
<!-- TAMedia Optional Permission --> <uses-permission android:name="android.permission.VIBRATE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.RECORD_AUDIO" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Step 4: 在AndroidManifest.xml的manifest tag宣告Activity
<activity android:name="com.taiwanmobile.pt.adp.view.TWMAdActivity" android:configChanges="orientation|keyboardHidden|navigation|keyboard|screenLayout|uiMode|screenSize|smallestScreenSize" android:hardwareAccelerated="true" android:theme="@android:style/Theme.Translucent" > </activity>