\r
public class NavitMapDownloader extends Thread\r
{\r
- public static class osm_map_values\r
+ private static class osm_map_values\r
{\r
String lon1;\r
String lat1;\r
new osm_map_values("Venezuela", "-73.6","0.4", "-59.7","12.8", 64838882L, 1)\r
};\r
\r
- public static String[] OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE = null;\r
+ private static String[] OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE = null;\r
\r
- public static int[] OSM_MAP_NAME_ORIG_ID_LIST = null;\r
+ public static int[] OSM_MAP_NAME_ORIG_ID_LIST = null;\r
\r
- public Boolean stop_me = false;\r
- static final int SOCKET_CONNECT_TIMEOUT = 25000; // 25 secs.\r
- static final int SOCKET_READ_TIMEOUT = 15000; // 15 secs.\r
- static final int MAP_WRITE_FILE_BUFFER = 1024 * 64;\r
- static final int MAP_WRITE_MEM_BUFFER = 1024 * 64;\r
- static final int MAP_READ_FILE_BUFFER = 1024 * 64;\r
- static final int UPDATE_PROGRESS_EVERY_CYCLE = 20;\r
- static final int MAX_RETRIES = 5;\r
- static final String MAP_FILENAME_PRI = "navitmap.bin";\r
- static final String MAP_FILENAME_NUM = "navitmap_%03d.bin";\r
- static final String MAP_FILENAME_PATH = Navit.MAP_FILENAME_PATH;\r
+ private Boolean stop_me = false;\r
+ private static final int SOCKET_CONNECT_TIMEOUT = 25000; // 25 secs.\r
+ private static final int SOCKET_READ_TIMEOUT = 15000; // 15 secs.\r
+ private static final int MAP_WRITE_FILE_BUFFER = 1024 * 64;\r
+ private static final int MAP_WRITE_MEM_BUFFER = 1024 * 64;\r
+ private static final int MAP_READ_FILE_BUFFER = 1024 * 64;\r
+ private static final int UPDATE_PROGRESS_EVERY_CYCLE = 20;\r
+ private static final int MAX_RETRIES = 5;\r
+ private static final String MAP_FILENAME_PRI = "navitmap.bin";\r
+ private static final String MAP_FILENAME_NUM = "navitmap_%03d.bin";\r
+ private static final String MAP_FILENAME_PATH = Navit.MAP_FILENAME_PATH;\r
\r
- Handler mHandler;\r
- osm_map_values map_values;\r
- private int map_slot;\r
- private int dialog_num;\r
+ private Handler mHandler;\r
+ private osm_map_values map_values;\r
+ private int map_slot;\r
+ private int dialog_num;\r
\r
public void run()\r
{\r
Log.d("NavitMapDownloader", "stop_me -> true");\r
}\r
\r
- public Navit navit_jmain = null;\r
-\r
public NavitMapDownloader(Navit main, Handler h, int map_id, int dialog_num, int map_slot)\r
{\r
this.mHandler = h;\r
this.map_values = osm_maps[map_id];\r
this.map_slot = map_slot;\r
- this.navit_jmain = main;\r
-\r
}\r
\r
- public static void init()\r
+ public static String[] getMenu()\r
{\r
\r
// need only init once\r
- if (OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE != null) { return; }\r
+ if (OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE != null) \r
+ { \r
+ return OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE;\r
+ }\r
\r
String menu_temp[] = new String[osm_maps.length*2];\r
OSM_MAP_NAME_ORIG_ID_LIST = new int[osm_maps.length*2];\r
{\r
OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE[i] = menu_temp[i];\r
}\r
+ return OSM_MAP_NAME_LIST_inkl_SIZE_ESTIMATE;\r
}\r
\r
public int download_osm_map(Handler handler, osm_map_values map_values, int map_number)\r
\r
return exit_code;\r
}\r
+\r
}\r