diff --git a/app/app.iml b/app/app.iml index 729919f..056f481 100644 --- a/app/app.iml +++ b/app/app.iml @@ -1,5 +1,5 @@ - + @@ -87,6 +87,7 @@ + diff --git a/app/build.gradle b/app/build.gradle index 988221c..43ed0a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -8,8 +8,8 @@ android { applicationId "com.ebaschiera.triplecamel" minSdkVersion 10 targetSdkVersion 21 - versionCode 2 - versionName "1.0.1" + versionCode 4 + versionName "1.0.3" } buildTypes { release { @@ -20,7 +20,8 @@ android { } dependencies { - compile fileTree(dir: 'libs', include: ['*.jar']) + compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.android.support:support-v4:21.0.3' + compile files('libs/PiwikAndroidSdk.jar') } diff --git a/app/libs/PiwikAndroidSdk.jar b/app/libs/PiwikAndroidSdk.jar new file mode 100644 index 0000000..a7514cc Binary files /dev/null and b/app/libs/PiwikAndroidSdk.jar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 14e2d74..397a943 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -1,10 +1,13 @@ + android:versionCode="4" + android:versionName="1.0.3"> + + activities = packageManager.queryIntentActivities(webIntent, 0); boolean isIntentSafe = activities.size() > 0; -// Start an activity if it's safe + // Start an activity if it's safe if (isIntentSafe) { + ((TripleCamelApp) getApplication()).getTracker().trackEvent("share", "successful", "label", 1); startActivity(webIntent); finish(); } else { + ((TripleCamelApp) getApplication()).getTracker().trackEvent("share", "failed", "label", 1); Context context = getApplicationContext(); String text = getResources().getString(R.string.no_web_browser); int duration = Toast.LENGTH_LONG; @@ -69,6 +74,7 @@ protected void onCreate(Bundle savedInstanceState) { } } else { //return a warning and stop the intent + ((TripleCamelApp) getApplication()).getTracker().trackEvent("share", "failed", "label", 1); Context context = getApplicationContext(); String text = getResources().getString(R.string.amazon_link_not_matching); int duration = Toast.LENGTH_LONG; diff --git a/app/src/main/java/com/ebaschiera/triplecamel/TripleCamelApp.java b/app/src/main/java/com/ebaschiera/triplecamel/TripleCamelApp.java new file mode 100644 index 0000000..aa3fb0d --- /dev/null +++ b/app/src/main/java/com/ebaschiera/triplecamel/TripleCamelApp.java @@ -0,0 +1,20 @@ +package com.ebaschiera.triplecamel; + +import org.piwik.sdk.PiwikApplication; + +/** + * Created by ebaschiera on 19/07/15. + */ +public class TripleCamelApp extends PiwikApplication { + + @Override + public String getTrackerUrl() { + return "http://ebaschiera.com/piwik/piwik.php"; + } + + @Override + public Integer getSiteId() { + return 1; + } + +} \ No newline at end of file