|
|
| (28 intermediate revisions by 4 users not shown) |
| Line 1: |
Line 1: |
| | __TOC__ | | __TOC__ |
| − | == 加入 AdLocus JAR 檔 ==
| |
| − | * 下載 JAR 檔
| |
| − | * 在專案底下建立 libs 資料夾
| |
| − | * 將 AdLocus_<version>.jar 複製到 libs 資料夾底下
| |
| − | * 若您是升級 SDK, 請刪除舊版的JAR檔.
| |
| | | | |
| − | == 加入 AdLocus Library Project == | + | == Android Studio == |
| − | * 下載 Library Project.
| + | === Gradle 加入程式碼如下 === |
| − | * 加入 AdLocus Library Project 到您的 Eclipse Workspace 中
| + | <syntaxhighlight lang="java"> |
| − | [[File:LibProj_1.jpg]]
| + | dependencies { |
| − | [[File:LibProj_2.jpg]]
| + | compile 'com.adlocus:library:3.5.7@aar' |
| − | [[File:LibProj_3.jpg]]
| + | } |
| − | * 在您的專案內啟用 AdLocus Library Project
| + | </syntaxhighlight> |
| − | [[File:LibProj_p1.jpg]]
| + | |
| − | [[File:LibProj_p2.jpg]]
| + | |
| − | [[File:LibProj_p3.jpg]]
| + | |
| − | [[File:LibProj_p4.jpg]]
| + | |
| | | | |
| | == AndroidManifest.xml 中加入以下權限 == | | == AndroidManifest.xml 中加入以下權限 == |
| | <syntaxhighlight lang="java"> | | <syntaxhighlight lang="java"> |
| − | // InApp
| + | <manifest |
| − | <uses-permission android:name="android.permission.INTERNET" /> | + | ...> |
| − | <uses-permission android:name="android.permission.READ_PHONE_STATE" />
| + | <uses-sdk android:targetSdkVersion="24" android:minSdkVersion="9" |
| − | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
| + | tools:overrideLibrary="com.adlocus.AdLocusLib"/> |
| − | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | + | |
| − | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
| + | |
| − | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
| + | |
| | | | |
| − | //Interstitial
| + | <application |
| − | <activity | + | ...> |
| − | android:name="com.adlocus.VideoAdActivity"
| + | </application> |
| − | android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" | + | </manifest> |
| − | android:hardwareAccelerated="true"
| + | </syntaxhighlight> |
| − | >
| + | |
| − | </activity> | + | |
| | | | |
| − |
| |
| − |
| |
| − | // Promotion
| |
| − | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
| |
| − | <uses-permission android:name="android.permission.WAKE_LOCK" />
| |
| − | <uses-permission android:name="com.adlocus.permission.SEND" />
| |
| − | <permission android:name = "com.adlocus.permission.SEND" />
| |
| − |
| |
| − | <service android:name="com.adlocus.push.PushService"
| |
| − | android:process=":adlocus">
| |
| − | </service>
| |
| − |
| |
| − | <receiver
| |
| − | android:enabled="true"
| |
| − | android:process=":adlocus"
| |
| − | android:name="com.adlocus.push.PushReceive"
| |
| − | android:permission="com.adlocus.permission.SEND">
| |
| − | <intent-filter>
| |
| − | <action android:name="android.intent.action.BOOT_COMPLETED" />
| |
| − | <category android:name="android.intent.category.DEFAULT" />
| |
| − | </intent-filter>
| |
| − | <intent-filter>
| |
| − | <action android:name="com.adlocus.action.RECEIVE" />
| |
| − | </intent-filter>
| |
| − | </receiver>
| |
| − |
| |
| − | </syntaxhighlight>
| |
| | | | |
| | 就這麼簡單,您已完成SDK的前期作業。 | | 就這麼簡單,您已完成SDK的前期作業。 |
dependencies {
compile 'com.adlocus:library:3.5.7@aar'
}
<manifest
...>
<uses-sdk android:targetSdkVersion="24" android:minSdkVersion="9"
tools:overrideLibrary="com.adlocus.AdLocusLib"/>
<application
...>
</application>
</manifest>