Page 455 - 2
P. 455

Log.d("BluetoothManager", " 포인트위치 :" + Points.get(i + 1).getLat() + Points.get(i + 1).get
            Lon());


                              Log.d("BluetoothManager", " 현재위치와 포인트사이의 거리" + distance(location.getLatitude(),
            location.getLongitude(), Points.get(i + 1).getLat(), Points.get(i + 1).getLon(), "meter"));



                              Point_info currentp = new Point_info("", "", "", location.getLongitude(), location.getLatitud
            e());
                              Bluetooth_Data data = new Bluetooth_Data();

                              data.setCurrent_Point(currentp);
                              data.setNext_Points(Points.get(i + 1));


                              bluetooth_manager.Write_data(data);

                              try {
                                 Thread.sleep(1000);
                              } catch (InterruptedException ie) {
                                 ie.toString();
                              }
                          }
                          Message m = new Message();
                          m.what = Image_theend;
                          handler.sendMessage(m);
                       }
                   }
                   public class JsonParser {
                       InputStream inputStream = null;
                       ByteArrayOutputStream baos = null;
                       String endx, endy, startx, starty,angle;

                       public String getJson(){
                          String param;
                          String result = null;
                          try {
                              URL url = new URL("http://apis.skplanetx.com/tmap/routes");
                              HttpURLConnection conn = (HttpURLConnection) url.openConnection();
                              conn.setRequestProperty("Host", "apis.skplanetx.com");
                              conn.setRequestProperty("appKey", "c6311b50-7799-3f45-97fc-94e969f6564e");
                              conn.setRequestProperty("Accept-Language", "ko");
                              conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");


                              //Host: apis.skplanetx.com
                              //appKey: 1234-5678-9012-3456
                              //Accept-Language: ko
                              //Content-Type: application/x-www-form-urlencoded
                              conn.setRequestMethod("POST");


                              conn.setConnectTimeout(3000);


                                                         - 455 -
   450   451   452   453   454   455   456   457   458   459   460