Page 458 - 2
P. 458

case Image_theend:
                              imageView.setImageResource(R.drawable.image_theend);
                              break;
                       }

                   }
               };


               boolean All_setting_OK() {
                   if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != Packa
            geManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS
            _COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
                       ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATIO
            N}, REQUEST);
                       return false;
                   }
                   // 블루투스 사용가능 여부
                   if (mBluetoothAdapter == null) {
                       Log.d(tag, " 블루투스를 사용할 수 없는 기기입니다.");
                       return false;
                   }
                   // 블루투스 설정 (On/Off)
                   Log.d(tag, " 블루투스 설정시작");
                   if (!mBluetoothAdapter.isEnabled()) {
                       Intent intent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
                       getApplicationContext().startActivity(intent);
                       return false;
                   }
                   //GPS  설정 (On/Off)
                   Log.d(tag, "GPS 설정 시작");

                   if(locationManager != null)
                       if(!locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER)) {
                          Toast.makeText(getApplicationContext(), "GPS 를 켜주세요", Toast.LENGTH_SHORT).show();
                          return false;
                       }
                   //Network  설정 (On/Off)
                   Log.d(tag, "Network");
                   ConnectivityManager cm = (ConnectivityManager) getApplicationContext().getSystemService(Context.C
            ONNECTIVITY_SERVICE);
                   NetworkInfo activitynetwork = cm.getActiveNetworkInfo();
                   if (!(activitynetwork != null && activitynetwork.isConnectedOrConnecting())) {
                       Toast.makeText(getApplicationContext(), " 네트워크를 연결해주세요", Toast.LENGTH_SHORT).show();
                       imageView.setImageResource(R.drawable.image_wifix);
                       return false;
                   }
                   return true;
               }


               void GPS_set() {


                                                         - 458 -
   453   454   455   456   457   458   459   460   461   462   463