/[zanavi_public1]/navit/navit/android/src/com/zoffcc/applications/zanavi/Navit.java
ZANavi

Diff of /navit/navit/android/src/com/zoffcc/applications/zanavi/Navit.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 50 Revision 51
187 187
188import de.oberoner.gpx2navit_txt.MainFrame; 188import de.oberoner.gpx2navit_txt.MainFrame;
189 189
190public class Navit extends ActionBarActivity implements Handler.Callback, SensorEventListener 190public class Navit extends ActionBarActivity implements Handler.Callback, SensorEventListener
191{ 191{
192 public static final String VERSION_TEXT_LONG_INC_REV = "3891"; 192 public static final String VERSION_TEXT_LONG_INC_REV = "3981";
193 public static String NavitAppVersion = "0"; 193 public static String NavitAppVersion = "0";
194 public static String NavitAppVersion_prev = "-1"; 194 public static String NavitAppVersion_prev = "-1";
195 public static String NavitAppVersion_string = "0"; 195 public static String NavitAppVersion_string = "0";
196 public final Boolean NAVIT_IS_EMULATOR = false; // when running on emulator set to true!! 196 public final Boolean NAVIT_IS_EMULATOR = false; // when running on emulator set to true!!
197 public static boolean has_hw_menu_button = false; 197 public static boolean has_hw_menu_button = false;
226 // ----------------- DEBUG ---------------- 226 // ----------------- DEBUG ----------------
227 static final boolean METHOD_DEBUG = false; // for debugging only, set this to "false" on release builds!! 227 static final boolean METHOD_DEBUG = false; // for debugging only, set this to "false" on release builds!!
228 static final boolean DEBUG_DRAW_VEHICLE = true; // if "false" then dont draw green vehicle, set this to "true" on release builds!! 228 static final boolean DEBUG_DRAW_VEHICLE = true; // if "false" then dont draw green vehicle, set this to "true" on release builds!!
229 static final boolean NAVIT_ALWAYS_UNPACK_XMLFILE = false; // always unpacks the navit.xml file, set this to "false" on release builds!! 229 static final boolean NAVIT_ALWAYS_UNPACK_XMLFILE = false; // always unpacks the navit.xml file, set this to "false" on release builds!!
230 static final boolean NAVIT_DEBUG_TEXT_VIEW = false; // show overlay with debug messages, set this to "false" on release builds!! 230 static final boolean NAVIT_DEBUG_TEXT_VIEW = false; // show overlay with debug messages, set this to "false" on release builds!!
231 static final boolean GFX_OVERSPILL = true; // make gfx canvas bigger for rotation and zoom smoothness 231 static final boolean GFX_OVERSPILL = true; // make gfx canvas bigger for rotation and zoom smoothness, set this to "true" on release builds!!
232 static final boolean DEBUG_LUX_VALUE = false; // show lux values, set to "false" on release builds!!
232 // ----------------- DEBUG ---------------- 233 // ----------------- DEBUG ----------------
233 // ----------------- DEBUG ---------------- 234 // ----------------- DEBUG ----------------
234 // ----------------- DEBUG ---------------- 235 // ----------------- DEBUG ----------------
235 236
236 // ---------------------------------------- 237 // ----------------------------------------
237 // ---------------------------------------- 238 // ----------------------------------------
238 static final boolean FDBL = false; 239 static final boolean FDBL = false;
239 static final int CIDEBUG = 0; 240 static final int CIDEBUG = 0;
240 static boolean CIRUN = false; 241 static boolean CIRUN = false;
242 static int CI_TEST_CASE_NUM = -1;
243 static String CI_TEST_CASE_TEXT = "";
241 // ---------------------------------------- 244 // ----------------------------------------
242 // ---------------------------------------- 245 // ----------------------------------------
243 246
244 static final float OVERSPILL_FACTOR = 1.4f; // 20% percent on each side 247 static final float OVERSPILL_FACTOR = 1.4f; // 20% percent on each side
245 248
605 public static Boolean DemoVehicle = false; 608 public static Boolean DemoVehicle = false;
606 609
607 static Typeface NavitStreetnameFont = null; 610 static Typeface NavitStreetnameFont = null;
608 611
609 public SensorManager sensorManager = null; 612 public SensorManager sensorManager = null;
613 public static float lightsensor_max_value = -1;
614 // static final float lux_darkness_value = 4;
615 Sensor lightSensor = null;
616 SensorEventListener lightSensorEventListener = null;
617 public static boolean night_mode = false;
618 public static float debug_cur_lux_value = -1;
610 //private static SensorManager sensorManager_ = null; 619 //private static SensorManager sensorManager_ = null;
611 620
612 public static Context getBaseContext_ = null; 621 public static Context getBaseContext_ = null;
613 public static GpsStatus gps_st = null; 622 public static GpsStatus gps_st = null;
614 623
1553 e.printStackTrace(); 1562 e.printStackTrace();
1554 } 1563 }
1555 } 1564 }
1556 1565
1557 // ---------- downloader threads ---------------- 1566 // ---------- downloader threads ----------------
1558 NavitMapDownloader.MULTI_NUM_THREADS = 1;
1559 PackageInfo pkgInfo; 1567 PackageInfo pkgInfo;
1560 Navit_DonateVersion_Installed = false; 1568 Navit_DonateVersion_Installed = false;
1561 try 1569 try
1562 { 1570 {
1563 // is the donate version installed? 1571 // is the donate version installed?
1955 // { 1963 // {
1956 // e.printStackTrace(); 1964 // e.printStackTrace();
1957 // } 1965 // }
1958 //sensorManager_ = sensorManager; 1966 //sensorManager_ = sensorManager;
1959 1967
1968 // light sensor -------------------
1969 try
1970 {
1971 lightSensor = sensorManager.getDefaultSensor(Sensor.TYPE_LIGHT);
1972 lightsensor_max_value = lightSensor.getMaximumRange();
1973 lightSensorEventListener = new SensorEventListener()
1974 {
1975 @Override
1976 public void onAccuracyChanged(Sensor sensor, int accuracy)
1977 {
1978 }
1979
1980 @Override
1981 public void onSensorChanged(SensorEvent event)
1982 {
1983 try
1984 {
1985 if (p.PREF_auto_night_mode)
1986 {
1987 if (event.sensor.getType() == Sensor.TYPE_LIGHT)
1988 {
1989
1990 if (Navit.DEBUG_LUX_VALUE)
1991 {
1992 debug_cur_lux_value = event.values[0];
1993 NavitGraphics.NavitAOverlay_s.postInvalidate();
1994 }
1995
1996 // System.out.println("Current Reading(Lux): cur=" + event.values[0] + " max=" + lightsensor_max_value);
1997
1998 if (night_mode == false)
1999 {
2000 if (event.values[0] < p.PREF_night_mode_lux)
2001 {
2002 night_mode = true;
2003 set_night_mode(1);
2004 draw_map();
2005 }
2006 }
2007 else if (night_mode == true)
2008 {
2009 if (event.values[0] > (p.PREF_night_mode_lux + p.PREF_night_mode_buffer))
2010 {
2011 night_mode = false;
2012 set_night_mode(0);
2013 draw_map();
2014 }
2015 }
2016 }
2017 }
2018 else
2019 {
2020 try
2021 {
2022 sensorManager.unregisterListener(lightSensorEventListener);
2023 System.out.println("stop lightsensor");
2024 }
2025 catch (Exception e)
2026 {
2027 }
2028
2029 try
2030 {
2031 night_mode = false;
2032 set_night_mode(0);
2033 draw_map();
2034 }
2035 catch (Exception e)
2036 {
2037 }
2038 }
2039 }
2040 catch (Exception e)
2041 {
2042 // e.printStackTrace();
2043 }
2044 }
2045
2046 };
2047 }
2048 catch (Exception e)
2049 {
2050 }
2051 // light sensor -------------------
2052
1960 generic_alert_box = new AlertDialog.Builder(this); 2053 generic_alert_box = new AlertDialog.Builder(this);
1961 /* 2054 /*
1962 * show info box for first time users 2055 * show info box for first time users
1963 */ 2056 */
1964 AlertDialog.Builder infobox = new AlertDialog.Builder(this); 2057 AlertDialog.Builder infobox = new AlertDialog.Builder(this);
2133 dialog_info_popup.setContentView(R.layout.info_popup); 2226 dialog_info_popup.setContentView(R.layout.info_popup);
2134 Button b_i1 = (Button) dialog_info_popup.findViewById(R.id.dialogButtonOK_i1); 2227 Button b_i1 = (Button) dialog_info_popup.findViewById(R.id.dialogButtonOK_i1);
2135 2228
2136 TextView tv_i1 = (TextView) dialog_info_popup.findViewById(R.id.text_i1); 2229 TextView tv_i1 = (TextView) dialog_info_popup.findViewById(R.id.text_i1);
2137 final String ZANAVI_MSG_PLUGIN_MARKET_LINK = "https://play.google.com/store/apps/details?id=com.zoffcc.applications.zanavi_msg"; 2230 final String ZANAVI_MSG_PLUGIN_MARKET_LINK = "https://play.google.com/store/apps/details?id=com.zoffcc.applications.zanavi_msg";
2231 final String ZANAVI_MSG_PLUGIN_FD_LINK = "https://static.zanavi.cc/app/zanavi_plugin_latest.apk";
2232
2138 final String ZANAVI_UDONATE_LINK = "http://more.zanavi.cc/donate/"; 2233 // final String ZANAVI_UDONATE_LINK = "http://more.zanavi.cc/donate/";
2139 final String ZANAVI_HOWTO_DEBUG_LINK = "http://static.zanavi.cc/be-a-testdriver/be-a-testdriver.html"; 2234 final String ZANAVI_HOWTO_DEBUG_LINK = "http://static.zanavi.cc/be-a-testdriver/be-a-testdriver.html";
2140 final String ZANAVI_HOWTO_UDONTATE_FREE_LINK = "http://static.zanavi.cc/activate-udonate/activate-udonate.html"; 2235 final String ZANAVI_HOWTO_UDONTATE_FREE_LINK = "http://static.zanavi.cc/activate-udonate/activate-udonate.html";
2141 2236
2142 if (FDBL) 2237 if (FDBL)
2143 { 2238 {
2144 tv_i1.setText(Html.fromHtml("\n<br>Help us to improve ZANavi, be a Testdriver and send in your route debug information.<br>\n<a href=\"" + ZANAVI_HOWTO_DEBUG_LINK + "\">HowTo be a Testdriver</a><br>\n<br>\n" + "And get the uDonate Version for free.<br>\n<a href=\"" + ZANAVI_HOWTO_UDONTATE_FREE_LINK + "\">get free uDonate version</a>\n" + "\n<br>\n<br>")); 2239 tv_i1.setText(Html.fromHtml("\n<br>Help us to improve ZANavi, be a Testdriver and send in your route debug information.<br>\n<a href=\"" + ZANAVI_HOWTO_DEBUG_LINK + "\">HowTo be a Testdriver</a><br>\n<br>\n" + "And get the uDonate Version for free.<br>\n<a href=\"" + ZANAVI_HOWTO_UDONTATE_FREE_LINK + "\">get free uDonate version</a>\n" + "\n<br>\n<br>" + "Install the ZANavi Plugin and always know when updated maps are available.<br>\n<a href=\"" + ZANAVI_MSG_PLUGIN_FD_LINK
2240 + "\">download here</a><br>\n"));
2145 } 2241 }
2146 else 2242 else
2147 { 2243 {
2148 tv_i1.setText(Html.fromHtml("\n<br>Help us to improve ZANavi, be a Testdriver and send in your route debug information.<br>\n<a href=\"" + ZANAVI_HOWTO_DEBUG_LINK + "\">HowTo be a Testdriver</a><br>\n<br>\n" + "And get the uDonate Version for free.<br>\n<a href=\"" + ZANAVI_HOWTO_UDONTATE_FREE_LINK + "\">get free uDonate version</a>\n" + "\n<br>\n<br>")); 2244 tv_i1.setText(Html.fromHtml("\n<br>Help us to improve ZANavi, be a Testdriver and send in your route debug information.<br>\n<a href=\"" + ZANAVI_HOWTO_DEBUG_LINK + "\">HowTo be a Testdriver</a><br>\n<br>\n" + "And get the uDonate Version for free.<br>\n<a href=\"" + ZANAVI_HOWTO_UDONTATE_FREE_LINK + "\">get free uDonate version</a>\n" + "\n<br>\n<br>" + "Install the ZANavi Plugin and always know when updated maps are available.<br>\n<a href=\""
2245 + ZANAVI_MSG_PLUGIN_MARKET_LINK + "\">download here</a><br>\n"));
2246
2149 // tv_i1.setText(Html.fromHtml("\n<br>Try the Donate Version and help us keep the mapservers running.<br>\nyou will activate the super fast index search.\n" + "<br><a href=\"" + ZANAVI_UDONATE_LINK + "\">get the donate version</a>\n<br>\n<br>")); 2247 // tv_i1.setText(Html.fromHtml("\n<br>Try the Donate Version and help us keep the mapservers running.<br>\nyou will activate the super fast index search.\n" + "<br><a href=\"" + ZANAVI_UDONATE_LINK + "\">get the donate version</a>\n<br>\n<br>"));
2150 // tv_i1.setText(Html.fromHtml("\n<br>Try the new Plugin to be notified when there are updates to your downloaded maps.\n" + "<br><a href=\"" + ZANAVI_MSG_PLUGIN_MARKET_LINK + "\">install Plugin</a>\n<br>\n<br>" + "Probier das neue Plugin damit du immer benachrichtigt wirst wenn es Kartenupdates gibt.\n<br>" + "<a href=\"" + ZANAVI_MSG_PLUGIN_MARKET_LINK + "\">Plugin installieren</a>\n<br>")); 2248 // tv_i1.setText(Html.fromHtml("\n<br>Try the new Plugin to be notified when there are updates to your downloaded maps.\n" + "<br><a href=\"" + ZANAVI_MSG_PLUGIN_MARKET_LINK + "\">install Plugin</a>\n<br>\n<br>" + "Probier das neue Plugin damit du immer benachrichtigt wirst wenn es Kartenupdates gibt.\n<br>" + "<a href=\"" + ZANAVI_MSG_PLUGIN_MARKET_LINK + "\">Plugin installieren</a>\n<br>"));
2151 } 2249 }
2152 2250
2153 try 2251 try
3211 { 3309 {
3212 // if (Navit.METHOD_DEBUG) Navit.my_func_name(0); 3310 // if (Navit.METHOD_DEBUG) Navit.my_func_name(0);
3213 3311
3214 // System.gc(); 3312 // System.gc();
3215 super.onResume(); 3313 super.onResume();
3314
3315 try
3316 {
3317 sensorManager.registerListener(lightSensorEventListener, lightSensor, (int) (8 * 1000000)); // updates approx. every 8 seconds
3318 }
3319 catch (Exception e)
3320 {
3321 }
3216 3322
3217 // get the intent fresh !! ---------- 3323 // get the intent fresh !! ----------
3218 startup_intent = this.getIntent(); 3324 startup_intent = this.getIntent();
3219 // get the intent fresh !! ---------- 3325 // get the intent fresh !! ----------
3220 3326
4404 { 4510 {
4405 4511
4406 // if COMM stuff is running, stop it! 4512 // if COMM stuff is running, stop it!
4407 ZANaviDebugReceiver.stop_me = true; 4513 ZANaviDebugReceiver.stop_me = true;
4408 4514
4515 try
4516 {
4517 sensorManager.unregisterListener(lightSensorEventListener);
4518 }
4519 catch (Exception e)
4520 {
4521 }
4522
4409 // ---- DEBUG ---- 4523 // ---- DEBUG ----
4410 // ---- DEBUG ---- 4524 // ---- DEBUG ----
4411 // ---- DEBUG ---- 4525 // ---- DEBUG ----
4412 // -- dump all callbacks -- 4526 // -- dump all callbacks --
4413 try 4527 try
5081 { 5195 {
5082 // System.out.println("share location pressed ID=" + item.getItemId()); 5196 // System.out.println("share location pressed ID=" + item.getItemId());
5083 // ------------ 5197 // ------------
5084 // ------------ 5198 // ------------
5085 // share the current location with your friends 5199 // share the current location with your friends
5086 location_coords cur_target = null; 5200 location_coords cur_target = new location_coords();
5087 try 5201 try
5088 { 5202 {
5089 geo_coord tmp = get_current_vehicle_position(); 5203 geo_coord tmp = get_current_vehicle_position();
5090 cur_target.lat = tmp.Latitude; 5204 cur_target.lat = tmp.Latitude;
5091 cur_target.lon = tmp.Longitude; 5205 cur_target.lon = tmp.Longitude;
5206
5207 if ((cur_target.lat == 0.0) && (cur_target.lon == 0.0))
5208 {
5092 // cur_target = NavitVehicle.get_last_known_pos(); 5209 cur_target = NavitVehicle.get_last_known_pos();
5210 }
5093 } 5211 }
5094 catch (Exception e) 5212 catch (Exception e)
5095 { 5213 {
5214 cur_target = null;
5215 try
5216 {
5217 cur_target = NavitVehicle.get_last_known_pos();
5218 }
5219 catch (Exception e2)
5220 {
5221 cur_target = null;
5222 }
5096 } 5223 }
5097 5224
5098 if (cur_target == null) 5225 if (cur_target == null)
5099 { 5226 {
5100 Log.e("Navit", "no location found!"); 5227 Log.e("Navit", "no location found!");
7734 if (l8 != null) 7861 if (l8 != null)
7735 { 7862 {
7736 if (l8.type == 1) 7863 if (l8.type == 1)
7737 { 7864 {
7738 Navit.OSD_nextturn.nextturn_streetname_systematic = ""; 7865 Navit.OSD_nextturn.nextturn_streetname_systematic = "";
7866 // System.out.println("street name(1)");
7739 Navit.OSD_nextturn.nextturn_streetname = NavitGraphics.CallbackGeoCalc(8, l8.b, l8.c); 7867 Navit.OSD_nextturn.nextturn_streetname = NavitGraphics.CallbackGeoCalc(8, l8.b, l8.c);
7868 // System.out.println("street name(2):" + Navit.OSD_nextturn.nextturn_streetname);
7869
7740 if (p.PREF_item_dump) 7870 if (p.PREF_item_dump)
7741 { 7871 {
7742 // -------- DEBUG ------- DEBUG --------- 7872 // -------- DEBUG ------- DEBUG ---------
7743 // -------- DEBUG ------- DEBUG --------- 7873 // -------- DEBUG ------- DEBUG ---------
7744 // -------- DEBUG ------- DEBUG --------- 7874 // -------- DEBUG ------- DEBUG ---------
9035 else if (msg.getData().getInt("Callback") == 113) 9165 else if (msg.getData().getInt("Callback") == 113)
9036 { 9166 {
9037 // cancel preview map drawing 9167 // cancel preview map drawing
9038 NavitGraphics.CallbackMessageChannel(113, "x"); 9168 NavitGraphics.CallbackMessageChannel(113, "x");
9039 } 9169 }
9170 else if (msg.getData().getInt("Callback") == 114)
9171 {
9172 // set night mode 0|1
9173 String s = msg.getData().getString("s");
9174 NavitGraphics.CallbackMessageChannel(114, s);
9175 }
9176 else if (msg.getData().getInt("Callback") == 115)
9177 {
9178 // set debug test number
9179 String s = msg.getData().getString("s");
9180 NavitGraphics.CallbackMessageChannel(115, s);
9181 }
9040 else if (msg.getData().getInt("Callback") == 9901) 9182 else if (msg.getData().getInt("Callback") == 9901)
9041 { 9183 {
9042 // if follow mode is on, then dont show freeview streetname 9184 // if follow mode is on, then dont show freeview streetname
9043 //if (!Navit.PREF_follow_gps) 9185 //if (!Navit.PREF_follow_gps)
9044 //{ 9186 //{
9093 removeDialog(msg.getData().getInt("dialog_num")); 9235 removeDialog(msg.getData().getInt("dialog_num"));
9094 } 9236 }
9095 catch (Exception e) 9237 catch (Exception e)
9096 { 9238 {
9097 } 9239 }
9240
9098 9241
9099 // exit_code=0 -> OK, map was downloaded fine 9242 // exit_code=0 -> OK, map was downloaded fine
9100 if (msg.getData().getInt("exit_code") == 0) 9243 if (msg.getData().getInt("exit_code") == 0)
9101 { 9244 {
9102 // try to use the new downloaded map (works fine now!) 9245 // try to use the new downloaded map (works fine now!)
10589 p.PREF_zoomlevel_num = prefs.getInt("zoomlevel_num", 174698); // default zoom level = 174698 // shows almost the whole world 10732 p.PREF_zoomlevel_num = prefs.getInt("zoomlevel_num", 174698); // default zoom level = 174698 // shows almost the whole world
10590 p.PREF_show_sat_status = prefs.getBoolean("show_sat_status", true); 10733 p.PREF_show_sat_status = prefs.getBoolean("show_sat_status", true);
10591 p.PREF_use_agps = prefs.getBoolean("use_agps", true); 10734 p.PREF_use_agps = prefs.getBoolean("use_agps", true);
10592 p.PREF_enable_debug_functions = prefs.getBoolean("enable_debug_functions", false); 10735 p.PREF_enable_debug_functions = prefs.getBoolean("enable_debug_functions", false);
10593 p.PREF_show_turn_restrictions = prefs.getBoolean("show_turn_restrictions", false); 10736 p.PREF_show_turn_restrictions = prefs.getBoolean("show_turn_restrictions", false);
10737 p.PREF_auto_night_mode = prefs.getBoolean("auto_night_mode", true);
10738 // System.out.println("night mode=" + p.PREF_auto_night_mode);
10594 10739
10595 try 10740 try
10596 { 10741 {
10597 // recreate the menu items 10742 // recreate the menu items
10598 Message msg = Navit_progress_h.obtainMessage(); 10743 Message msg = Navit_progress_h.obtainMessage();
10651 p.PREF_routing_profile = prefs.getString("routing_profile", "car"); 10796 p.PREF_routing_profile = prefs.getString("routing_profile", "car");
10652 p.PREF_road_priority_001 = (prefs.getInt("road_priority_001", (68 - 10)) + 10); // must ADD minimum value!! 10797 p.PREF_road_priority_001 = (prefs.getInt("road_priority_001", (68 - 10)) + 10); // must ADD minimum value!!
10653 p.PREF_road_priority_002 = (prefs.getInt("road_priority_002", (329 - 10)) + 10); // must ADD minimum value!! 10798 p.PREF_road_priority_002 = (prefs.getInt("road_priority_002", (329 - 10)) + 10); // must ADD minimum value!!
10654 p.PREF_road_priority_003 = (prefs.getInt("road_priority_003", (5000 - 10)) + 10); // must ADD minimum value!! 10799 p.PREF_road_priority_003 = (prefs.getInt("road_priority_003", (5000 - 10)) + 10); // must ADD minimum value!!
10655 p.PREF_road_priority_004 = (prefs.getInt("road_priority_004", (5 - 0)) + 0); // must ADD minimum value!! 10800 p.PREF_road_priority_004 = (prefs.getInt("road_priority_004", (5 - 0)) + 0); // must ADD minimum value!!
10801 p.PREF_night_mode_lux = (prefs.getInt("night_mode_lux", (10 - 1)) + 1); // must ADD minimum value!!
10802 p.PREF_night_mode_buffer = (prefs.getInt("night_mode_buffer", (20 - 1)) + 1); // must ADD minimum value!!
10656 10803
10657 // p.PREF_road_prio_weight_street_1_city = (prefs.getInt("road_prio_weight_street_1_city", (30 - 10)) + 10); // must ADD minimum value!! 10804 // p.PREF_road_prio_weight_street_1_city = (prefs.getInt("road_prio_weight_street_1_city", (30 - 10)) + 10); // must ADD minimum value!!
10658 10805
10659 p.PREF_traffic_speed_factor = (prefs.getInt("traffic_speed_factor", (83 - 20)) + 20); // must ADD minimum value!! 10806 p.PREF_traffic_speed_factor = (prefs.getInt("traffic_speed_factor", (83 - 20)) + 20); // must ADD minimum value!!
10660 10807
13169 Log.e("Navit", "no donate version installed"); 13316 Log.e("Navit", "no donate version installed");
13170 13317
13171 Navit_index_on_but_no_idx_files = false; 13318 Navit_index_on_but_no_idx_files = false;
13172 return false; 13319 return false;
13173 } 13320 }
13321 else
13322 {
13323 Log.e("Navit", "donate version IS installed");
13324 }
13174 13325
13175 boolean ret = false; 13326 boolean ret = false;
13176 13327
13177 // MAP_FILENAME_PATH 13328 // MAP_FILENAME_PATH
13178 File folder = new File(MAP_FILENAME_PATH); 13329 File folder = new File(MAP_FILENAME_PATH);
13218 { 13369 {
13219 13370
13220 // index for this map is missing. hack MD5 file so we can download it again 13371 // index for this map is missing. hack MD5 file so we can download it again
13221 md5_file = new File(Navit.MAPMD5_FILENAME_PATH + "/" + servername + ".md5"); 13372 md5_file = new File(Navit.MAPMD5_FILENAME_PATH + "/" + servername + ".md5");
13222 13373
13223 // System.out.println("FFNN:hack MD5:" + md5_file.getAbsolutePath() + " s=" + servername); 13374 System.out.println("FFNN:hack MD5:" + md5_file.getAbsolutePath() + " s=" + servername);
13224 13375
13225 if ((md5_file.exists()) && (md5_file.canWrite())) 13376 if ((md5_file.exists()) && (md5_file.canWrite()))
13226 { 13377 {
13227 try 13378 try
13228 { 13379 {
16028 msg.setData(b); 16179 msg.setData(b);
16029 Navit_progress_h.sendMessage(msg); 16180 Navit_progress_h.sendMessage(msg);
16030 } 16181 }
16031 } 16182 }
16032 16183
16184 public static void set_night_mode(int i)
16185 {
16186 try
16187 {
16188 // i==0 --> day mode
16189 // i==1 --> night mode
16190 NavitGraphics.CallbackMessageChannelReal(114, "" + i);
16191 }
16192 catch (Exception e)
16193 {
16194 }
16195 }
16033} 16196}

Legend:
Removed from v.50  
changed lines
  Added in v.51

   
Visit the ZANavi Wiki