Skip to content

Commit

Permalink
Merge pull request #182 from piwik/dev
Browse files Browse the repository at this point in the history
3.0.0 Release
  • Loading branch information
d4rken committed Dec 13, 2017
2 parents c081b54 + 5424c0b commit ae3007a
Show file tree
Hide file tree
Showing 72 changed files with 1,386 additions and 835 deletions.
38 changes: 16 additions & 22 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,22 @@
.gradle
gradle.properties
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build

# Gradle files
.gradle/
build/

#built application files
*.ap_
# Local configuration file (sdk path, etc)
local.properties

# files for the dex VM
*.dex
# Android Studio generated folders
.navigation/
captures/
.externalNativeBuild

# Java class files
*.class
# IntelliJ project files
*.iml
.idea/

# generated files
bin/
gen/

# Windows thumbnail db
# Misc
.DS_Store
Thumbs.db

# Android Studio
.idea
*.iml
# Keystore files
*.jks
10 changes: 8 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
notifications:
email: false

language: android
jdk: oraclejdk8

android:
components:
- tools
- build-tools-25.0.2
- android-25
- build-tools-27.0.1
- android-27
- extra-android-support
- extra-android-m2repository
licenses:
- 'android-sdk-preview-license-.+'
- 'android-sdk-license-.+'
- 'google-gdk-license-.+'

before_install:
- yes | sdkmanager "platforms;android-27"

script: ./gradlew :piwik-sdk:assemble :piwik-sdk:testDebugUnitTest

after_success: ./gradlew :piwik-sdk:jacocoTestReport :piwik-sdk:coveralls
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Piwik SDK for Android

[![Build Status](https://travis-ci.org/piwik/piwik-sdk-android.svg?branch=master)](https://travis-ci.org/piwik/piwik-sdk-android) [ ![Download](https://api.bintray.com/packages/darken/maven/piwik-sdk-android/images/download.svg) ](https://bintray.com/darken/maven/piwik-sdk-android/_latestVersion) [![Coverage Status](https://coveralls.io/repos/piwik/piwik-sdk-android/badge.svg?branch=master&service=github)](https://coveralls.io/github/piwik/piwik-sdk-android?branch=master)

Welcome to the Piwik Tracking SDK for Android. [Piwik](http://piwik.org) is the leading open source web analytics platform
Welcome to the Piwik Tracking SDK for Android. [Piwik](http://piwik.org) is the leading open source web analytics platform
that gives you valuable insights into your website's visitors, your marketing campaigns and much more, so you can optimize your strategy and experience of your visitors.

## Quickstart
Expand All @@ -12,10 +12,10 @@ For the not so quick start, [see here](https://github.com/piwik/piwik-sdk-androi
* [Setup Piwik](https://piwik.org/docs/installation/) on your server.
* Include the library in your app modules `build.gradle` file
```groovy
compile 'org.piwik.sdk:piwik-sdk:2.0.0'
compile 'org.piwik.sdk:piwik-sdk:3.0.0'
```

* Ready your `Tracker` by extending our `PiwikApplication` class or do it yourself:
* Initialize your `Tracker` either by extending our `PiwikApplication` class or storing an instance yourself:
```java
public class YourApplication extends Application {
private Tracker tracker;
Expand All @@ -26,14 +26,13 @@ public class YourApplication extends Application {
}
```

* Done, your app is ready to use Piwik. Maybe start by tracking a screen view
* The `TrackHelper` class is the easiest way to submit events to your tracker:
```java
// Get the `Tracker` you want to use
Tracker tracker = ((PiwikApplication) getApplication()).getTracker();
// Track a screen view
TrackHelper.track().screen("/activity_main/activity_settings").title("Settings").with(tracker);
```

* or by monitoring your app installs
```java
// Monitor your app installs
TrackHelper.track().download().with(tracker);
```

Expand Down
26 changes: 16 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,30 +1,36 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.4.0x'
}
}

allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
ext {
globalMinSdkVersion = 10
globalTargetSdkVersion = 25
globalCompileSdkVersion = 25
globalBuildToolsVersion = '25.0.2'
supportLibVersion = '25.3.1'
timberVersion = '4.5.1'
globalMinSdkVersion = 14
globalTargetSdkVersion = 27
globalCompileSdkVersion = 27
globalBuildToolsVersion = '27.0.1'
supportLibVersion = '27.0.1'
timberVersion = '4.6.0'
}
}
2 changes: 0 additions & 2 deletions exampleapp/.gitignore

This file was deleted.

10 changes: 5 additions & 5 deletions exampleapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
Example of using the Piwik Tracking SDK for Android

## Requirements

In order to compile demo app by yourself proceed following steps:

* Install and configure [Android Studio 0.8.6+](http://developer.android.com/sdk/installing/studio.html) and [Android SDK Packages](http://developer.android.com/sdk/installing/adding-packages.html)
* Install and configure [Android Studio 0.8.6+](http://developer.android.com/sdk/installing/studio.html) and [Android SDK Packages](http://developer.android.com/sdk/installing/adding-packages.html)
* Clone Piwik Android SDK repo `git clone git@github.com:piwik/piwik-sdk-android.git`
* Open cloned folder in Android Studio as new project and configure Gradle
* In terminal run `./gradlew :exampleapp:assembleDebug`
* Copy .apk from `exampleapp/build/outputs/apk/exampleapp-debug.apk` to Your device and open it

If You want to run application:

* configure Android Emulator in AVD Manager (Ensure You've downloaded ARM System image and Builds Tools in SDK Manager)
Expand All @@ -25,8 +25,8 @@ If You want to run application:
![Main screen](http://i.imgur.com/O8RjRNil.png)

![Settings page](http://i.imgur.com/HQWSyfEl.png)
## Piwik dashboard

## Piwik dashboard

Statistic of demo application usage could be found [here](http://beacons.testing.piwik.pro/).

Expand Down
20 changes: 11 additions & 9 deletions exampleapp/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

compileSdkVersion project.ext.globalCompileSdkVersion
buildToolsVersion project.ext.globalBuildToolsVersion

Expand All @@ -19,12 +23,10 @@ android {
}

dependencies {
repositories {
jcenter()
}
compile project(":piwik-sdk")
compile "com.android.support:appcompat-v7:${supportLibVersion}"
compile "com.android.support:support-v4:${supportLibVersion}"
compile 'com.jakewharton:butterknife:8.4.0'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
implementation project(":piwik-sdk")
implementation "com.android.support:appcompat-v7:${supportLibVersion}"
implementation "com.android.support:support-v4:${supportLibVersion}"
implementation "com.jakewharton.timber:timber:${timberVersion}"
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
}
4 changes: 2 additions & 2 deletions exampleapp/src/main/java/com/piwik/demo/DemoActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.support.v7.app.AppCompatActivity;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
Expand All @@ -27,7 +27,7 @@
import butterknife.OnClick;


public class DemoActivity extends ActionBarActivity {
public class DemoActivity extends AppCompatActivity {
int cartItems = 0;
private EcommerceItems items;

Expand Down
17 changes: 17 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Wed Mar 08 17:26:55 CET 2017
#Sun Aug 20 08:55:35 PDT 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Loading

0 comments on commit ae3007a

Please sign in to comment.