From 03aebe733170958a8436754042e7b6b395f39564 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Fri, 30 Jan 2015 15:18:41 +0300 Subject: [PATCH] [android] Log version together with flavor. --- android/build.gradle | 10 ++++++++++ .../mapswithme/maps/ads/RateStoreDialogFragment.java | 2 +- android/src/com/mapswithme/util/Utils.java | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 17354ea019..9241302a15 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -53,6 +53,7 @@ android { productFlavors { google { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Google' buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"' buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -60,6 +61,7 @@ android { samsung { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Samsung' buildConfigField 'String', 'REVIEW_URL', '"samsungapps://ProductDetail/com.mapswithme.maps.pro"' buildConfigField 'String', 'SUPPORT_MAIL', '"samsung@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -68,6 +70,7 @@ android { amazon { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Amazon' buildConfigField 'String', 'REVIEW_URL', '"amzn://apps/android?p=com.mapswithme.maps.pro"' buildConfigField 'String', 'SUPPORT_MAIL', '"amazon@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -76,6 +79,7 @@ android { androidpit { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-AndroidPit' buildConfigField 'String', 'REVIEW_URL', '"appcenter://package/com.mapswithme.maps.pro"' buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -84,6 +88,7 @@ android { slideme { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-SlideMe' buildConfigField 'String', 'REVIEW_URL', '"sam://details?bundleId=5eed1b74-8c8b-11e2-8af8-1670ef61174f"' buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -92,6 +97,7 @@ android { yandex { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Yandex' buildConfigField 'String', 'REVIEW_URL', '"yastore://details?id=com.mapswithme.maps.pro"' buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -100,6 +106,7 @@ android { prestigio { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Prestigio' buildConfigField 'String', 'REVIEW_URL', '"market://details?id=com.mapswithme.maps.pro"' buildConfigField 'String', 'SUPPORT_MAIL', '"googleplay@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'true' @@ -108,6 +115,7 @@ android { cipherlab { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-CipherLab' buildConfigField 'String', 'REVIEW_URL', '"http://maps.me/"' buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'true' @@ -116,6 +124,7 @@ android { xiaomi { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Xiaomi' buildConfigField 'String', 'REVIEW_URL', '"http://maps.me/"' buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' @@ -124,6 +133,7 @@ android { opera { applicationId 'com.mapswithme.maps.pro' + versionName = android.defaultConfig.versionName + '-Opera' buildConfigField 'String', 'REVIEW_URL', '"http://maps.me/"' buildConfigField 'String', 'SUPPORT_MAIL', '"android@maps.me"' buildConfigField 'boolean', 'IS_PREINSTALLED', 'false' diff --git a/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java b/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java index 5714b0f569..a557ce2c05 100644 --- a/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java +++ b/android/src/com/mapswithme/maps/ads/RateStoreDialogFragment.java @@ -102,7 +102,7 @@ public class RateStoreDialogFragment extends DialogFragment implements View.OnCl dismiss(); final Intent intent = new Intent(Intent.ACTION_SENDTO); intent.setData(Utils.buildMailUri(Constants.Url.MAIL_MAPSME_RATING, "Rating : " + mRating, - "Android version:" + Build.VERSION.SDK_INT + "\n" + "App version: " + BuildConfig.APPLICATION_ID + " " + BuildConfig.VERSION_CODE + "\n")); + "Android version:" + Build.VERSION.SDK_INT + "\n" + "App version: " + BuildConfig.APPLICATION_ID + " " + BuildConfig.VERSION_NAME + "\n")); try { startActivity(intent); diff --git a/android/src/com/mapswithme/util/Utils.java b/android/src/com/mapswithme/util/Utils.java index 0c7234007b..a0d281e005 100644 --- a/android/src/com/mapswithme/util/Utils.java +++ b/android/src/com/mapswithme/util/Utils.java @@ -249,7 +249,7 @@ public class Utils writer = new FileWriter(file); writer.write("Android version: " + Build.VERSION.SDK_INT + "\n"); writer.write("Device: " + getDeviceModel() + "\n"); - writer.write("App version: " + BuildConfig.APPLICATION_ID + " " + BuildConfig.VERSION_CODE + "\n"); + writer.write("App version: " + BuildConfig.APPLICATION_ID + " " + BuildConfig.VERSION_NAME + "\n"); writer.write("Locale : " + Locale.getDefault() + "\n\n"); String cmd = "logcat -d -v time";