PageRenderTime 72ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/workspace/aMetro/src/org/ametro/app/Constants.java

http://ametro.googlecode.com/
Java | 133 lines | 76 code | 29 blank | 28 comment | 0 complexity | 94b246a89d1cbaba82a20dbccc94aeb7 MD5 | raw file
Possible License(s): GPL-3.0
  1. /*
  2. * http://code.google.com/p/ametro/
  3. * Transport map viewer for Android platform
  4. * Copyright (C) 2009-2010 contacts@ametro.org Roman Golovanov and other
  5. * respective project committers (see project home page)
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. package org.ametro.app;
  22. import java.io.File;
  23. import org.ametro.R;
  24. import org.ametro.util.DateUtil;
  25. import android.os.Environment;
  26. /**
  27. * @author Vlad Vinichenko (akerigan@gmail.com)
  28. * Date: 10.02.2010
  29. * Time: 22:50:44
  30. */
  31. public class Constants {
  32. public static final int HTTP_CONNECTION_TIMEOUT = 10000;
  33. public static final int HTTP_SOCKET_TIMEOUT = 10000;
  34. public static final long ONLINE_CATALOG_DEPRECATED_TIMEOUT = 60*60*1000; // 1 hour
  35. public final static String LOCALE_RU = "ru";
  36. public final static String LOCALE_EN = "en";
  37. public final static int MODEL_VERSION = 1;
  38. public final static String MODEL_COMPATIBILITY_VERSION = "0.4.0";
  39. public final static long MODEL_IMPORT_TIMESTAMP = DateUtil.createTimestamp(2010,7,23);
  40. public static final String LOG_TAG_MAIN = "aMetro";
  41. public static final int DEFAULT_BUFFER_SIZE = 8196;
  42. public static final String PREFERENCE_NAME = "aMetro";
  43. public final static String STATION_ID = "STATION_ID";
  44. public final static String STATION_FROM_ID = "STATION_FROM_ID";
  45. public final static String STATION_TO_ID = "STATION_TO_ID";
  46. public static final String PREFERENCE_PACKAGE_FILE_NAME = "PACKAGE_FILE_NAME";
  47. public static final String PREFERENCE_SCROLL_POSITION = "SCROLL_POSITION";
  48. public static final String PREFERENCE_ZOOM_LEVEL = "ZOOM_LEVEL";
  49. public static final String PREFERENCE_FAVORITE_ROUTES = "FAVORITE_ROUTES";
  50. public static final String PREFERENCE_ONLINE_CATALOG_URL = "ONLINE_CATALOG_URL";
  51. public static final String PREFERENCE_DEBUG = "DEBUG";
  52. public static final String PREFERENCE_AUTO_UPDATE_INDEX = "AUTO_UPDATE_INDEX";
  53. public static final String PREFERENCE_AUTO_UPDATE_ON_SHOW = "AUTO_UPDATE_INDEX_ON_SHOW";
  54. public static final String PREFERENCE_AUTO_UPDATE_MAPS = "AUTO_UPDATE_MAPS";
  55. public static final String PREFERENCE_LOCALE = "LOCALE";
  56. public static final String PREFERENCE_PMZ_IMPORT = "PMZ_IMPORT";
  57. public static final String PREFERENCE_ENABLE_COUNTRY_ICONS = "ENABLE_COUNTRY_ICONS";
  58. public static final String PREFERENCE_ONLINE_CATALOG_UPDATE_DATE = "ONLINE_CATALOG_UPDATE_DATE";
  59. public static final String PREFERENCE_IS_EULA_ACCEPTED = "EULA_ACCEPTED";
  60. public static final String PREFERENCE_ENABLE_LOCATION = "AUTO_LOCATION";
  61. public static final String PREFERENCE_CHANGE_LOW_SHOWED = "CHANGE_LOW_SHOWED";
  62. public static final String PREFERENCE_ENABLE_ZOOM_CONTROLS = "ZOOM_WITH_BUTTONS";
  63. public static final String PREFERENCE_ENABLE_ZOOM_VOLUME_CONTROLS = "ZOOM_WITH_VOLUME";
  64. public static final String PREFERENCE_TRACKBALL_SCROLL_SPEED = "TRACKBALL_SCROLL_SPEED";
  65. public static final String PREFERENCE_ENABLE_ANTI_ALIAS = "ANTI_ALIAS";
  66. public static final String PREFERENCE_DISABLE_ANTI_ALIAS_ON_SCROLL = "ANTI_ALIAS_DISABLE_ON_SCROLL";
  67. public static final String DEFAULT_MAP = "metro";
  68. public static final String NO_MEDIA_TAG = ".nomedia";
  69. public static final String MAP_FILE_TYPE = ".ametro";
  70. public static final String PMZ_FILE_TYPE = ".pmz";
  71. public static final String IMPORT_FILE_TYPE = ".import.ametro";
  72. public static final String DOWNLOAD_FILE_TYPE = ".download.ametro";
  73. public static final File ROOT_PATH = new File(Environment.getExternalStorageDirectory(), "ametro");
  74. public static final String[] ICONS_URLS = {
  75. "http://dl.dropbox.com/u/8171021/icons.zip",
  76. "http://ametro-project.narod.ru/icons.zip"
  77. };
  78. public static final int[] ONLINE_CATALOG_NAMES = {
  79. R.string.msg_online_catalog_dropbox,
  80. R.string.msg_online_catalog_narod,
  81. };
  82. public static final String[] ONLINE_CATALOG_BASE_URLS = {
  83. //"http://192.168.172.3/ametro/0.0.0/",
  84. //"http://192.168.172.3/ametro/0.0.0/",
  85. "http://dl.dropbox.com/u/8171021/0.4.0/",
  86. //"http://ametro-project.narod.ru/0.4.0/",
  87. "http://ametro-project.narod.ru/0.4.0/"
  88. };
  89. public static final String ONLINE_CATALOG_URL = "catalog.zip";
  90. public static final File LOCAL_CATALOG_PATH = new File(ROOT_PATH, "maps");
  91. public static final File IMPORT_CATALOG_PATH = new File(ROOT_PATH, "import");
  92. public static final File TEMP_CATALOG_PATH = new File(ROOT_PATH,"temp");
  93. public static final File ICONS_PATH = new File(ROOT_PATH,"icons");
  94. public static final File ICONS_CHECK= new File(ICONS_PATH,".checked");
  95. public static final File ONLINE_CATALOG_STORAGE = new File(ROOT_PATH,"catalog.online.xml");
  96. public static final File LOCAL_CATALOG_STORAGE = new File(ROOT_PATH,"catalog.local.xml");
  97. public static final File IMPORT_CATALOG_STORAGE = new File(ROOT_PATH,"catalog.import.xml");
  98. public static final File NO_MEDIA_FILE = new File(ROOT_PATH, NO_MEDIA_TAG);
  99. public static final File EULA_FILE = new File(ROOT_PATH, "gpl.html");
  100. public static final String PMETRO_EXTENSION = ".pmz";
  101. public static final String AMETRO_EXTENSION = ".ametro";
  102. public static final String EXTRA_TIMESTAMP = "EXTRA_TIMESTAMP";
  103. public static final String EXTRA_SYSTEM_MAP_NAME = "EXTRA_SYSTEM_MAP_NAME";
  104. }