Skip to content

Commit

Permalink
Publish v1.30 (#9)
Browse files Browse the repository at this point in the history
* Update SDK instructions and SampleApp to v1.30
* Bump build tools to 25.0.2
  • Loading branch information
julo15 authored Jun 12, 2017
1 parent a5e2bd8 commit 2214d34
Show file tree
Hide file tree
Showing 16 changed files with 116 additions and 68 deletions.
78 changes: 39 additions & 39 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,60 @@
# Placed Affiliate SDK (Android) v1.21
# Placed Affiliate SDK (Android) v1.30

## Integrating your application with the Placed Monetization SDK

### Adding the dependency to your project

1. Add the following to your **root** `build.gradle` file:

```
allprojects {
repositories {
...
```
allprojects {
repositories {
...
maven { url "https://raw.githubusercontent.com/placed/android-placed-sdk/master/repository" }
maven { url "https://raw.githubusercontent.com/placed/android-placed-sdk/master/repository" }
}
}
}
```
```
2. Add the following to your **app** `build.gradle` file:
```
dependencies {
...
```
dependencies {
...
compile 'com.placed.client:android-persistent-sdk:1.21'
}
```
compile 'com.placed.client:android-persistent-sdk:1.30'
}
```
3. You may encounter Lint error: 'InvalidPackage: Package not included in Android' related to Okio and Retrofit. (This is a known issue with Okio that you can read about [here](https://github.com/square/okio/issues/58).)
If so, create a `lint.xml` with the following contents:
```
<lint>
<issue id="InvalidPackage">
<ignore regexp=".*okio.*" />
<ignore regexp=".*retrofit.*" />
</issue>
</lint>
```
And reference it from your **app** `build.gradle` file:
```
android {
...
lintOptions {
lintConfig file("lint.xml")
}
}
```
### Configuration
* Add the following in the application tag in your **AndroidManifest.xml**. Make sure to replace **YOUR\_APP\_KEY** with the application key provided to you by Placed. Please be sure to have `BOOT_COMPLETED` and `PACKAGE_REPLACED` in separate intent filters.

* Add the application key provided to you by Placed in the application tag of your **AndroidManifest.xml**.
<meta-data android:name="placed_app_key" android:value="YOUR_APP_KEY" />
<service android:name="com.placed.client.android.persistent.PlacedService"/>
<receiver android:name="com.placed.client.android.persistent.PlacedReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<data android:scheme="package" />
</intent-filter>
</receiver>

* Add required permissions

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

* Request runtime location permission (Android 6.0 Marshmallow)
If your app targets Android 6.0 Marshmallow (API level 23), your app will need prompt for `ACCESS_FINE_LOCATION` permission at runtime. You can read more information in Android's documentation for [Requesting Permissions at Run Time](http://developer.android.com/training/permissions/requesting.html).
If your app targets Android 6.0 Marshmallow (API level 23) or higher, your app will need prompt for `ACCESS_FINE_LOCATION` permission at runtime. You can read more information in Android's documentation for [Requesting Permissions at Run Time](http://developer.android.com/training/permissions/requesting.html).
You'll want to add this permission prompt to the Activity that calls `PlacedAgent.registerApp()` or `PlacedAgent.registerAppWithDialog`. For example:
Expand Down Expand Up @@ -158,4 +159,3 @@ This method is used for custom integrations with Placed. If you have questions p
`static void logDemographics(Context context, String jsonString, String source, String version)`
This method is used for custom integrations with Placed. If you have questions please inquire with your contact at Placed.

16 changes: 11 additions & 5 deletions SampleApp/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
compileSdkVersion 25
buildToolsVersion "25.0.2"

defaultConfig {
applicationId "com.placed.android.sampleapp"
minSdkVersion 9
targetSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -17,11 +17,17 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
lintOptions {
lintConfig file("lint.xml")
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'com.placed.client:android-persistent-sdk:1.21'
compile 'com.android.support:appcompat-v7:25.0.1'

// Use the latest version of the Placed SDK
// noinspection AndroidLintGradleDynamicVersion
compile 'com.placed.client:android-persistent-sdk:1.+'
}
6 changes: 6 additions & 0 deletions SampleApp/app/lint.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<lint>
<issue id="InvalidPackage">
<ignore regexp=".*okio.*" />
<ignore regexp=".*retrofit.*" />
</issue>
</lint>
2 changes: 1 addition & 1 deletion SampleApp/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
#}
19 changes: 1 addition & 18 deletions SampleApp/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,12 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.placed.android.sampleapp">

<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>

<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:networkSecurityConfig="@xml/network_security_config"
android:theme="@style/AppTheme">
<activity android:name=".MainActivity">
<intent-filter>
Expand All @@ -25,16 +18,6 @@
</activity>

<meta-data android:name="placed_app_key" android:value="@string/placed_api_key" />
<service android:name="com.placed.client.android.persistent.PlacedService"/>
<receiver android:name="com.placed.client.android.persistent.PlacedReceiver" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<data android:scheme="package" />
</intent-filter>
</receiver>
</application>

</manifest>
8 changes: 8 additions & 0 deletions SampleApp/app/src/main/res/xml/network_security_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<debug-overrides>
<trust-anchors>
<certificates src="user" />
</trust-anchors>
</debug-overrides>
</network-security-config>
2 changes: 1 addition & 1 deletion SampleApp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:2.2.2'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
df9c11041f62162c70149560d48dfbd0
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
574fadf8738ac43f5043da9d4d493b47ffa2c02b
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>com.placed.client</groupId>
<artifactId>android-persistent-sdk</artifactId>
<version>1.30</version>
<packaging>aar</packaging>
<dependencies>
<dependency>
<groupId>com.google.android.gms</groupId>
<artifactId>play-services-ads</artifactId>
<version>9.6.1</version>
</dependency>
<dependency>
<groupId>edu.emory.mathcs</groupId>
<artifactId>JTransforms</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>com.jakewharton</groupId>
<artifactId>disklrucache</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>retrofit</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.squareup.retrofit2</groupId>
<artifactId>converter-gson</artifactId>
<version>2.0.1</version>
</dependency>
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>logging-interceptor</artifactId>
<version>3.2.0</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
4e74008d20d1ebd4efd1611432e66f82
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
78a347a27fc27e40bafba65bcd4ceea54f1f0f7c
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<groupId>com.placed.client</groupId>
<artifactId>android-persistent-sdk</artifactId>
<versioning>
<release>1.21</release>
<release>1.30</release>
<versions>
<version>1.20</version>
<version>1.21</version>
<version>1.30</version>
</versions>
<lastUpdated>20161031234447</lastUpdated>
<lastUpdated>20170607000353</lastUpdated>
</versioning>
</metadata>
Original file line number Diff line number Diff line change
@@ -1 +1 @@
594f0d8293ab3458693f74051fea1202
0155210dd1db1f4ceea54d927f897c24
Original file line number Diff line number Diff line change
@@ -1 +1 @@
b44d0e32512c05caf8ff672be909a225f510aee5
82512170e2a1663169a12540d7145ead63db4e5c

0 comments on commit 2214d34

Please sign in to comment.