diff --git a/build.gradle b/build.gradle index 34e6830..d40fe08 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.0' + classpath 'com.android.tools.build:gradle:2.4.0-alpha3' } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 18481fd..31198d4 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Jan 22 21:19:51 CET 2017 +#Tue Mar 28 12:22:37 CEST 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-3.4.1-all.zip diff --git a/playmusicexporter/build.gradle b/playmusicexporter/build.gradle index dcac987..3423416 100644 --- a/playmusicexporter/build.gradle +++ b/playmusicexporter/build.gradle @@ -24,6 +24,16 @@ apply plugin: 'com.android.application' + +buildscript { + repositories { + maven { + url "http://dl.bintray.com/countly/maven" + } + } +} + + android { compileSdkVersion 25 buildToolsVersion "25.0.2" @@ -58,9 +68,10 @@ dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile project(':framework') compile project(':playmusiclib') - compile 'com.android.support:appcompat-v7:25.2.0' - compile 'com.android.support:support-v4:25.2.0' - compile 'com.android.support:design:25.2.0' - compile 'com.android.support:support-vector-drawable:25.2.0' + compile 'com.android.support:appcompat-v7:25.3.1' + compile 'com.android.support:support-v4:25.3.1' + compile 'com.android.support:design:25.3.1' + compile 'com.android.support:support-vector-drawable:25.3.1' compile 'com.github.paolorotolo:appintro:4.1.0' + compile 'ly.count.android:sdk:16.12.2' } diff --git a/playmusicexporter/src/main/AndroidManifest.xml b/playmusicexporter/src/main/AndroidManifest.xml index 8075054..09c1b32 100644 --- a/playmusicexporter/src/main/AndroidManifest.xml +++ b/playmusicexporter/src/main/AndroidManifest.xml @@ -24,8 +24,9 @@ + - + + android:label="Play Music Exporter Intro" /> diff --git a/playmusicexporter/src/main/java/re/jcg/playmusicexporter/activities/MusicContainerListActivity.java b/playmusicexporter/src/main/java/re/jcg/playmusicexporter/activities/MusicContainerListActivity.java index 2d433f1..bf49109 100644 --- a/playmusicexporter/src/main/java/re/jcg/playmusicexporter/activities/MusicContainerListActivity.java +++ b/playmusicexporter/src/main/java/re/jcg/playmusicexporter/activities/MusicContainerListActivity.java @@ -43,9 +43,10 @@ import android.widget.EditText; import android.widget.Toast; import de.arcus.framework.logger.Logger; -import de.arcus.framework.crashhandler.CrashHandler; import de.arcus.playmusiclib.exceptions.CouldNotOpenDatabaseException; import de.arcus.playmusiclib.exceptions.NoSuperUserException; +import ly.count.android.sdk.Countly; +import ly.count.android.sdk.DeviceId; import re.jcg.playmusicexporter.R; import re.jcg.playmusicexporter.fragments.MusicTrackListFragment; import re.jcg.playmusicexporter.fragments.MusicContainerListFragment; @@ -108,8 +109,9 @@ public class MusicContainerListActivity extends AppCompatActivity protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); - //Adds the crash handler to this class - CrashHandler.addCrashHandler(this); + Countly.sharedInstance().init(this, getString(R.string.countly_url), getString(R.string.countly_token), null, DeviceId.Type.OPEN_UDID); + Countly.sharedInstance().enableCrashReporting(); + PlayMusicExporterPreferences.init(this); if (!PlayMusicExporterPreferences.getSetupDone()) { @@ -195,11 +197,11 @@ public class MusicContainerListActivity extends AppCompatActivity } } } + /** * Loads the PlayMusicExporter lib and shows the list */ - private void loadPlayMusicExporter() - { + private void loadPlayMusicExporter() { // Gets the running instance mPlayMusicManager = PlayMusicManager.getInstance(); @@ -261,7 +263,7 @@ public class MusicContainerListActivity extends AppCompatActivity MusicContainerListFragment musicTrackListFragment = (MusicContainerListFragment) getSupportFragmentManager() .findFragmentById(R.id.fragment_main); - switch(mViewType) { + switch (mViewType) { case Album: // Load all albums to the list AlbumDataSource dataSourceAlbum = new AlbumDataSource(mPlayMusicManager); @@ -331,24 +333,21 @@ public class MusicContainerListActivity extends AppCompatActivity MenuItem itemRefreshLibrary = menu.findItem(R.id.action_refresh); itemRefreshLibrary.setOnMenuItemClickListener(item -> { - try - { + try { mPlayMusicManager.reloadDatabase(); mPlayMusicManager = null; loadPlayMusicExporter(); - Toast.makeText( this, R.string.database_reloaded, Toast.LENGTH_SHORT).show(); - } - catch (NoSuperUserException | CouldNotOpenDatabaseException e) - { - Toast.makeText( this, R.string.dialog_superuser_access_denied_title, Toast.LENGTH_SHORT).show(); + Toast.makeText(this, R.string.database_reloaded, Toast.LENGTH_SHORT).show(); + } catch (NoSuperUserException | CouldNotOpenDatabaseException e) { + Toast.makeText(this, R.string.dialog_superuser_access_denied_title, Toast.LENGTH_SHORT).show(); e.printStackTrace(); } return true; }); // Finds the search item and create the search view - MenuItem itemSearch = menu. findItem(R.id.action_search); - mSearchView = (SearchView)MenuItemCompat.getActionView(itemSearch); + MenuItem itemSearch = menu.findItem(R.id.action_search); + mSearchView = (SearchView) MenuItemCompat.getActionView(itemSearch); if (mSearchView != null) { // Sets the search listener @@ -376,4 +375,16 @@ public class MusicContainerListActivity extends AppCompatActivity return false; } + + @Override + public void onStart() { + super.onStart(); + Countly.sharedInstance().onStart(this); + } + + @Override + public void onStop() { + Countly.sharedInstance().onStop(); + super.onStop(); + } } diff --git a/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportAllService.java b/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportAllService.java index 37b1371..f78d177 100644 --- a/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportAllService.java +++ b/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportAllService.java @@ -9,6 +9,7 @@ import android.util.Log; import java.util.List; +import ly.count.android.sdk.Countly; import re.jcg.playmusicexporter.settings.PlayMusicExporterPreferences; import re.jcg.playmusicexporter.utils.MusicPathBuilder; import de.arcus.playmusiclib.PlayMusicManager; @@ -75,6 +76,7 @@ public class ExportAllService extends IntentService { try { if (lPlayMusicManager.exportMusicTrack(lTrack, lUri, lPath, PlayMusicExporterPreferences.getFileOverwritePreference())) { Log.i(TAG, "Exported Music Track: " + getStringForTrack(lTrack)); + Countly.sharedInstance().recordEvent("Exported Song", 1); } else { Log.i(TAG, "Failed to export Music Track: " + getStringForTrack(lTrack)); } diff --git a/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportService.java b/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportService.java index e68545f..acc5a12 100644 --- a/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportService.java +++ b/playmusicexporter/src/main/java/re/jcg/playmusicexporter/services/ExportService.java @@ -31,6 +31,7 @@ import android.os.Bundle; import android.support.v4.app.NotificationCompat; import de.arcus.framework.logger.Logger; +import ly.count.android.sdk.Countly; import re.jcg.playmusicexporter.R; import de.arcus.playmusiclib.PlayMusicManager; import de.arcus.playmusiclib.datasources.MusicTrackDataSource; @@ -200,7 +201,9 @@ public class ExportService extends IntentService { updateNotification(); // Exports the song - if(!playMusicManager.exportMusicTrack(mTrackCurrent, uri, path, PlayMusicExporterPreferences.getFileOverwritePreference())) { + if (playMusicManager.exportMusicTrack(mTrackCurrent, uri, path, PlayMusicExporterPreferences.getFileOverwritePreference())) { + Countly.sharedInstance().recordEvent("Exported Song", 1); + } else { // Export failed mTracksFailed ++; } diff --git a/playmusicexporter/src/main/res/values/constants.xml b/playmusicexporter/src/main/res/values/constants.xml new file mode 100644 index 0000000..b0f79cc --- /dev/null +++ b/playmusicexporter/src/main/res/values/constants.xml @@ -0,0 +1,5 @@ + + + https://countly.jcg.re/ + 82a1d9405388c4dd73dc9835f84c59cf4274086d + \ No newline at end of file