diff --git a/OsmAnd/res/values-ca/phrases.xml b/OsmAnd/res/values-ca/phrases.xml index ad8e350a70..1c7e0b00c3 100644 --- a/OsmAnd/res/values-ca/phrases.xml +++ b/OsmAnd/res/values-ca/phrases.xml @@ -956,10 +956,10 @@ Fax Facebook Mòbil - Refugi per a gossos - Refugi per a gats - Refugi per a gossos i gats - Refugi per a ocells + Tipus de refugi: per gossos + Tipus de refugi: per gats + Tipus de refugi: per gossos i gats + Tipus de refugi: per ocells Tipus: deixalleria Tipus: contenidor @@ -1392,4 +1392,21 @@ Condició dels graons: desigual Condició dels graons: ruda - +Tipus: columbari + Tipus: mausoleu + Tipus: sarcòfag + Tipus: cripta + Tipus: piràmide + +Pila de pedres + + Memorial per decoració de façana + Desfibril·lador + Desfibril·lador: sí + + Tipus: fosa de guerra + Tipus: túmul + Tipus: excavació a la roca + Tipus: subterrani + Tipus: volta + diff --git a/OsmAnd/res/values-zh-rTW/phrases.xml b/OsmAnd/res/values-zh-rTW/phrases.xml index 901f5a73f7..aaab016988 100644 --- a/OsmAnd/res/values-zh-rTW/phrases.xml +++ b/OsmAnd/res/values-zh-rTW/phrases.xml @@ -2004,4 +2004,14 @@ 寄宿類型:狗、貓 寄宿類型:馬 + 退役飛機 + + 蜂蜜專賣店 + + 有電梯 + 無電梯 + + 工藝不朽的遺迹 + + 露營服務處 diff --git a/OsmAnd/src/net/osmand/plus/AppInitializer.java b/OsmAnd/src/net/osmand/plus/AppInitializer.java index c14d4fe171..7f78785a65 100644 --- a/OsmAnd/src/net/osmand/plus/AppInitializer.java +++ b/OsmAnd/src/net/osmand/plus/AppInitializer.java @@ -56,6 +56,7 @@ import btools.routingapp.BRouterServiceConnection; public class AppInitializer implements IProgress { public static final boolean TIPS_AND_TRICKS = false; + private static final String VECTOR_INDEXES_CHECK = "VECTOR_INDEXES_CHECK"; //$NON-NLS-1$ private static final String EXCEPTION_FILE_SIZE = "EXCEPTION_FS"; //$NON-NLS-1$ @@ -118,6 +119,10 @@ public class AppInitializer implements IProgress { settings.VERSION_INSTALLED.set(Version.getFullVersion(app)); appVersionChanged = true; } + settings.NUMBER_OF_APPLICATION_STARTS.set(settings.NUMBER_OF_APPLICATION_STARTS.get() + 1); + if (settings.FIRST_INSTALLED_DATE.get() == -1) { + settings.FIRST_INSTALLED_DATE.set(System.currentTimeMillis()); + } initSettings = true; } diff --git a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java index 60822958f1..3141cf028a 100644 --- a/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java +++ b/OsmAnd/src/net/osmand/plus/ContextMenuAdapter.java @@ -30,7 +30,6 @@ import gnu.trove.list.array.TIntArrayList; public class ContextMenuAdapter { private static final Log LOG = PlatformUtil.getLog(ContextMenuAdapter.class); -// Log log = public interface OnContextMenuClick { //boolean return type needed to desribe if drawer needed to be close or not @@ -296,7 +295,6 @@ public class ContextMenuAdapter { public ArrayAdapter createListAdapter(final Activity activity, final boolean holoLight) { - // XXX layoutId does not effect layout inflated. final int layoutId = defaultLayoutId; final OsmandApplication app = ((OsmandApplication) activity.getApplication()); ArrayAdapter listAdapter = new ContextMenuArrayAdapter(activity, layoutId, R.id.title, diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 1a505fe83b..332aa851a5 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -137,10 +137,6 @@ public class OsmandApplication extends Application { timeToStart = System.currentTimeMillis(); OsmandPlugin.initPlugins(this); System.out.println("Time to init plugins " + (System.currentTimeMillis() - timeToStart) + " ms. Should be less < 800 ms"); - - osmandSettings.NUMBER_OF_APPLICATION_STARTS.set( - osmandSettings.NUMBER_OF_APPLICATION_STARTS.get() + 1); - } public AppInitializer getAppInitializer() { diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 5b3e884233..832696cc4f 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -1,15 +1,21 @@ package net.osmand.plus; -import android.annotation.TargetApi; -import android.content.Context; -import android.content.res.Configuration; -import android.hardware.Sensor; -import android.hardware.SensorManager; -import android.net.ConnectivityManager; -import android.net.NetworkInfo; -import android.os.Build; -import android.os.Environment; +import java.io.File; +import java.io.IOException; +import java.lang.ref.WeakReference; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import java.util.StringTokenizer; import net.osmand.IndexConstants; import net.osmand.StateChangedListener; @@ -28,22 +34,15 @@ import net.osmand.plus.helpers.SearchHistoryHelper; import net.osmand.plus.render.RendererRegistry; import net.osmand.plus.routing.RouteProvider.RouteService; import net.osmand.render.RenderingRulesStorage; - -import java.io.File; -import java.io.IOException; -import java.lang.ref.WeakReference; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Comparator; -import java.util.Iterator; -import java.util.LinkedHashMap; -import java.util.LinkedHashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; -import java.util.StringTokenizer; +import android.annotation.TargetApi; +import android.content.Context; +import android.content.res.Configuration; +import android.hardware.Sensor; +import android.hardware.SensorManager; +import android.net.ConnectivityManager; +import android.net.NetworkInfo; +import android.os.Build; +import android.os.Environment; public class OsmandSettings { @@ -1874,8 +1873,8 @@ public class OsmandSettings { public final CommonPreference SHOW_RULER = new BooleanPreference("show_ruler", true).makeProfile().cache(); - - + + public final OsmandPreference FIRST_INSTALLED_DATE = new LongPreference("first_installed_date", -1).makeGlobal(); // public final OsmandPreference NUMBER_OF_FREE_DOWNLOADS_V2 = new IntPreference("free_downloads_v2", 0).makeGlobal(); @@ -1890,13 +1889,13 @@ public class OsmandSettings { new EnumIntPreference<>("rate_us_state", DashRateUsFragment.RateUsState.INITIAL_STATE, DashRateUsFragment.RateUsState.values()) .makeGlobal() - .cache(); + .cache(); public final OsmandPreference FIRST_TIME_APP_RUN = new BooleanPreference("first_time_app_run", true).makeGlobal().cache(); public final OsmandPreference VERSION_INSTALLED = new StringPreference("version_installed", null).makeGlobal().cache(); - + public enum DayNightMode { AUTO(R.string.daynight_mode_auto), DAY(R.string.daynight_mode_day), diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java index 5f061d2283..04aadf6abb 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadOsmandIndexesHelper.java @@ -12,22 +12,26 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.zip.GZIPInputStream; + import net.osmand.AndroidUtils; import net.osmand.IndexConstants; import net.osmand.PlatformUtil; import net.osmand.osm.io.NetworkUtils; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandSettings; + import org.apache.commons.logging.Log; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; import org.xmlpull.v1.XmlPullParserFactory; + import android.annotation.SuppressLint; import android.content.Context; import android.content.pm.ApplicationInfo; import android.content.pm.PackageManager; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.AssetManager; +import android.provider.Settings.Secure; public class DownloadOsmandIndexesHelper { private final static Log log = PlatformUtil.getLog(DownloadOsmandIndexesHelper.class); @@ -178,7 +182,17 @@ public class DownloadOsmandIndexesHelper { log.debug("Start loading list of index files"); //$NON-NLS-1$ try { String strUrl = ctx.getAppCustomization().getIndexesUrl(); - + OsmandSettings settings = ctx.getSettings(); + Long nd = settings.FIRST_INSTALLED_DATE.get(); + if(nd > 0) { + strUrl += "&nd=" + ((System.currentTimeMillis() - nd) / (1000l * 24l * 60l * 60l)); + } + strUrl += "&ns=" + settings.NUMBER_OF_APPLICATION_STARTS.get(); + try { + strUrl += "&aid=" + Secure.getString(ctx.getContentResolver(), Secure.ANDROID_ID); + } catch (Exception e) { + e.printStackTrace(); + } log.info(strUrl); XmlPullParser parser = XmlPullParserFactory.newInstance().newPullParser(); URLConnection connection = NetworkUtils.getHttpURLConnection(strUrl);