Page 453 - 2
P. 453

Point_info point_info = new Point_info(properties.getString("index"), propertie
            s.getString("description"), properties.getString("turnType"), Double.parseDouble(coordinates.getString(0)), Dou
            ble.parseDouble(coordinates.getString(1)));
                                        Points.add(point_info);
                                     }else if(feature.getJSONObject("geometry").getString("type").equals("LineString")){
                                        JSONObject geometry = feature.getJSONObject("geometry");
                                        JSONArray coordinates = geometry.getJSONArray("coordinates");
                                        TMapPolyLine tMapPolyLine = new TMapPolyLine();
                                        for(int j=0;j<coordinates.length();j++){
                                            JSONArray jsonArray = coordinates.getJSONArray(j);

                                            double lon = Double.parseDouble(jsonArray.getString(0));
                                            double lat = Double.parseDouble(jsonArray.getString(1));

                                            TMapPoint point = new TMapPoint(lat,lon);
                                            tMapPolyLine.addLinePoint(point);
                                        }
                                        Lines.add(tMapPolyLine);
                                     }
                                 }
                              }
                          } else {
                              Message m = new Message();
                              m.what = TOAST_MESSAGE;
                              m.obj = "HUD 에 연결되지 않았습니다.";
                              handler.sendMessage(m);
                          }


                       } catch (JSONException je) {
                          je.toString();
                       }
                   }
                   @Override
                   public void run() {
                       int i = 0,j = 1;
                       boolean flag_voice = true;
                       if (bluetooth_manager != null) {
                          while (bluetooth_manager.mmSocket.isConnected() && !Points.get(i).getRoad_turnType().equal
            s("201") && isdrive) {
                              Message m = new Message();
                              m.what = Image_driving;
                              handler.sendMessage(m);
                              if (ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACC
            ESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ge
            tApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GR
            ANTED) {
                                 return;
                              }




                                                         - 453 -
   448   449   450   451   452   453   454   455   456   457   458