From a289083067065362a7197d11d9b50bca1047c30d Mon Sep 17 00:00:00 2001 From: Alexander Marchuk Date: Wed, 28 Sep 2016 02:24:08 +0300 Subject: [PATCH 1/7] [android] fix: MyTarget slot ID is passed as integer. --- android/jni/com/mapswithme/maps/PrivateVariables.cpp | 4 ++-- android/src/com/mapswithme/maps/PrivateVariables.java | 2 +- configure.sh | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/android/jni/com/mapswithme/maps/PrivateVariables.cpp b/android/jni/com/mapswithme/maps/PrivateVariables.cpp index 55fa8722e8..4eb2f58956 100644 --- a/android/jni/com/mapswithme/maps/PrivateVariables.cpp +++ b/android/jni/com/mapswithme/maps/PrivateVariables.cpp @@ -22,10 +22,10 @@ extern "C" return env->NewStringUTF(MY_TRACKER_KEY); } - JNIEXPORT jstring JNICALL + JNIEXPORT jint JNICALL Java_com_mapswithme_maps_PrivateVariables_myTargetSlot(JNIEnv * env, jclass clazz) { - return env->NewStringUTF(MY_TARGET_KEY); + return MY_TARGET_KEY; } JNIEXPORT jstring JNICALL diff --git a/android/src/com/mapswithme/maps/PrivateVariables.java b/android/src/com/mapswithme/maps/PrivateVariables.java index dd413627e2..ea2ebca2bc 100644 --- a/android/src/com/mapswithme/maps/PrivateVariables.java +++ b/android/src/com/mapswithme/maps/PrivateVariables.java @@ -8,7 +8,7 @@ public class PrivateVariables public static native String alohalyticsUrl(); public static native String flurryKey(); public static native String myTrackerKey(); - public static native String myTargetSlot(); + public static native int myTargetSlot(); public static native String myTargetCheckUrl(); /** * @return interval in seconds diff --git a/configure.sh b/configure.sh index 3c6129aa4f..6bc1d12062 100755 --- a/configure.sh +++ b/configure.sh @@ -33,7 +33,7 @@ else #define ALOHALYTICS_URL "" #define FLURRY_KEY "12345678901234567890" #define MY_TRACKER_KEY "" -#define MY_TARGET_KEY "" +#define MY_TARGET_KEY 0 #define PUSHWOOSH_APPLICATION_ID "" #define OSM_CONSUMER_KEY "" #define OSM_CONSUMER_SECRET "" From a6c109b3e2206a4cabe2e6a2f345aa80e4a064c1 Mon Sep 17 00:00:00 2001 From: Alexander Marchuk Date: Wed, 28 Sep 2016 02:40:51 +0300 Subject: [PATCH 2/7] [android] add: Ads in downloader. --- android/build.gradle | 2 +- android/res/layout/downloader_item_ad.xml | 57 +++ android/res/values/dimens.xml | 1 + .../src/com/mapswithme/maps/MwmActivity.java | 38 +- .../maps/downloader/CountryItem.java | 1 + .../maps/downloader/DownloaderAdapter.java | 324 ++++++++++++++++-- .../util/statistics/MytargetHelper.java | 113 ++++-- 7 files changed, 465 insertions(+), 71 deletions(-) create mode 100644 android/res/layout/downloader_item_ad.xml diff --git a/android/build.gradle b/android/build.gradle index 23d3f503c9..bdf098e8fe 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -49,7 +49,7 @@ dependencies { compile 'com.facebook.android:facebook-android-sdk:4.8.0' compile 'com.google.code.gson:gson:2.6.1' compile 'com.pushwoosh:pushwoosh:4.6.3' - compile 'com.my.tracker:mytracker-sdk:1.3.2' + compile 'com.my.tracker:mytracker-sdk:1.3.5' compile fileTree(dir: '3rd_party', include: '*.jar') // BottomSheet compile project(":3rd_party:BottomSheet") diff --git a/android/res/layout/downloader_item_ad.xml b/android/res/layout/downloader_item_ad.xml new file mode 100644 index 0000000000..b980532fb6 --- /dev/null +++ b/android/res/layout/downloader_item_ad.xml @@ -0,0 +1,57 @@ + + +