Page 465 - 2
P. 465

TMapTapi tmaptapi = new TMapTapi(context);
                       tmaptapi.setSKPMapAuthentication("69e5f7cb-e294-3d25-8938-6e5e54d15c6d");


                       GPS_Con();

                       listView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
                          @Override
                          public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
                              if(locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
                                 Log.d("BluetoothManager", adapter.getItem(i).getPOIName() + " 이 선택됨");
                                 mjsonposer = new Tmap_invoke.JsonParser();
                                 mjsonposer.FindDir(adapter.getItem(i));
                              }
                          }
                       });
                       listView.setAdapter(adapter);


                       isInstalled = true;
                   }

                   void GPS_Con() {
                       if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) !=
            PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.permissio
            n.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                          return;
                       }
                       Log.d("BluetoothManager", " 매니저 생성됨");
                       locationManager = (LocationManager) getApplicationContext().getSystemService(Context.LOCATIO
            N_SERVICE);
                       LocationListener locationListener = new LocationListener() {..};

                       Log.d("BluetoothManager", " 리스너생성");


                       locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 10, 0, locationListene
            r);
                       Log.d("BluetoothManager", "GPS  업데이트 완료");
                   }


                   public class JsonParser {
                       InputStream inputStream = null;
                       ByteArrayOutputStream baos = null;
                       String endx, endy, startx, starty, endpoiid, endrpflag, endname;


                       public void FindDir(TMapPOIItem item) {
                          E_POI = item;
                          if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATIO
            N) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(context, Manifest.per
            mission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                              return;


                                                         - 465 -
   460   461   462   463   464   465   466   467   468   469   470