Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Rev. 2015 Android SDK DOWNLOAD AND INTEGRATION GUIDE Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 This is a step-by-step guide to walk you through how to download and integrate Adcash Android SDK into your application. Prerequisites • Developing for Android level 9 or higher. For Android studio • Running Android Studio 1.0 or higher For Eclipse • • • • Running Eclipse 3.7.2 (Indigo) or later Eclipse JDT plugin (included in most Eclipse IDE packages) The Android Plugin for Eclipse The Android SDK Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 2 Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 Installing for Eclipse 1. Download SDK files from here 2. Include the adcash® SDK files into your Eclipse workspace • • • • Create a folder called libs in your project folder. Copy to this folder the Adcash SDK jar file. Refresh your project in Eclipse. Right click on the jar file and select Build Path -> Add to Build Path. 3. Add Google Play Services to your project Instructions to add Google Play Services to your project can be found at: http://developer.android.com/google/play-services/setup.html Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 3 Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 Installing for Android Studio 1. Download SDK files (.aar format) from here 2. Import the adcash® SDK to your project • • Create a folder called libs in your project folder. Copy to this folder the Adcash SDK .aar or .jar file. 3. Configure gradle Locate your application-level build.gradle file. Add compile (name: ‘adcash-sdk-lib’, ext: ‘aar’) line to the dependencies. Specify which repository to use when resolving dependencies for building your project with the following code outside the dependency block: repositories{ flatDir{ dirs ‘libs’ } } You may see a warning message across the top of the Android Studio window indicating that gradle needs to perform a gradle sync. If that’s the case, click Sync Now to do so. Gradle will refresh your project’s libraries to include the dependency you just added Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 4 Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 4. Add Google Play Services to your projectConfigure gradle • Instructions to add Google Play Services to your project can be found at: http://developer.android.com/google/play-services/setup.html Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 5 Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 Modify AndroidManifest.xml file In order to make AndroidManifest.xml function correctly with the adcash® SDK, you must make the following changes: <?xml version=”1.0” encoding=”utf-8”?> <manifest xmlns:android=”http://schemas.android.com/apk/res/android” package=”com.example.exampleproject” android:versionCode=”1” android:versionName=”1.0” > <uses-sdk android:minSdkVersion=”9” android:targetSdkVersion=”21” /> <!-- Include required permissions for adcash® SDK to run--> <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” /> <application android:allowBackup=”true” android:icon=”@drawable/ic_launcher” android:label=”@string/app_name” android:theme=”@style/AppTheme” > <!--This meta-data tag is required to use Google Play Services.--> <meta-data android:name=”com.google.android.gms.version” android:value=”@integer/google_play_services_version” /> <activity android:name=”.MainActivity” android:label=”@string/app_name” > <intent-filter> <action android:name=”android.intent.action.MAIN” /> <category android:name=”android.intent.category.LAUNCHER” /> </intent-filter> </activity> </application> </manifest> There are two changes required: 1. Add 3 <uses-permission> tags: INTERNET , ACCESS_WIFI_STATE , ACCESS_NETWORK_STATE . INTERNET tag is required and is used to allow adcash® SDK to make ad requests. ACCESS_WIFI_STATE , ACCESS_NETWORK_STATE are used to determine if an internet connection is avialble 2. Add <meta-data> that references the Google Play Services version Adcash OÜ +372 634 6000 [email protected] Kentmanni 4, 10116, Tallinn, Estonia Reg # : 12141869 | Vat ID : EE101470034 6