|
|
| (18 intermediate revisions by 3 users not shown) |
| Line 1: |
Line 1: |
| | __TOC__ | | __TOC__ |
| − | == Android Studio(Beta) == | + | |
| | + | == Android Studio == |
| | === Gradle 加入程式碼如下 === | | === Gradle 加入程式碼如下 === |
| | <syntaxhighlight lang="java"> | | <syntaxhighlight lang="java"> |
| | dependencies { | | dependencies { |
| − | compile 'com.adlocus:library:3.3.16@aar'
| + | compile 'com.adlocus:library:3.5.7@aar' |
| | } | | } |
| | </syntaxhighlight> | | </syntaxhighlight> |
| − |
| |
| − | == Eclipse ==
| |
| − | === 加入 AdLocus JAR 檔 ===
| |
| − | * 下載 JAR 檔
| |
| − | * 在專案底下建立 libs 資料夾
| |
| − | * 將 AdLocus_<version>.jar 複製到 libs 資料夾底下
| |
| − | * 若您是升級 SDK, 請刪除舊版的JAR檔.
| |
| − |
| |
| − | === 加入 AdLocus Library Project ===
| |
| − | * 下載 Library Project.
| |
| − | * 加入 AdLocus Library Project 到您的 Eclipse Workspace 中
| |
| − | [[File:LibProj_1.jpg]]
| |
| − | [[File:LibProj_2.jpg]]
| |
| − | [[File:LibProj_3.jpg]]
| |
| − | * 在您的專案內啟用 AdLocus Library Project
| |
| − | [[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"> |
| − | <uses-permission android:name="android.permission.INTERNET" /> | + | <manifest |
| − | <uses-permission android:name="android.permission.READ_PHONE_STATE" />
| + | ...> |
| − | <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
| + | <uses-sdk android:targetSdkVersion="24" android:minSdkVersion="9" |
| − | <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | + | tools:overrideLibrary="com.adlocus.AdLocusLib"/> |
| − | <uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
| + | |
| − | <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
| + | |
| | | | |
| − | // Promotion
| + | <application |
| − | <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | + | ...> |
| − | <uses-permission android:name="android.permission.WAKE_LOCK" /> | + | </application> |
| | + | </manifest> |
| | + | </syntaxhighlight> |
| | | | |
| − | <service android:name="com.adlocus.push.PushService"
| |
| − | android:process=":adlocus">
| |
| − | </service>
| |
| − |
| |
| − | <receiver
| |
| − | android:enabled="true"
| |
| − | android:process=":adlocus"
| |
| − | android:name="com.adlocus.push.PushReceive">
| |
| − | <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>
| |
| − |
| |
| − | //Interstitial
| |
| − | <activity
| |
| − | android:name="com.adlocus.VideoAdActivity"
| |
| − | android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"
| |
| − | android:hardwareAccelerated="true"
| |
| − | >
| |
| − | </activity>
| |
| − |
| |
| − | </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>