์ฃผ๋ณ ์ง์ญ ๊ฒ์ | Places API | Google for Developers
์ด์ Places API (์ ๊ท)๊ฐ ์ถ์๋๋ฉด์ ์ฐจ์ธ๋ Places API๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์ด ํ์ด์ง๋ Cloud Translation API๋ฅผ ํตํด ๋ฒ์ญ๋์์ต๋๋ค. ์๊ฒฌ ๋ณด๋ด๊ธฐ ์ฃผ๋ณ ์ง์ญ ๊ฒ์ ์ปฌ๋ ์ ์ ์ฌ์ฉํด ์ ๋ฆฌํ๊ธฐ ๋ด ํ๊ฒฝ
developers.google.com
์ ์ฅ ํ, ํค ๋ณต์ฌํ๊ธฐ
ํ๊ฒฝ์ค์ ํ๊ธฐ
https://codebunny99.tistory.com/179
์๋๋ก์ด๋ ์คํ๋์ค์์ ๊ตฌ๊ธ ๋งต ์ฌ์ฉํ๊ธฐ
๊ตฌ๊ธ๋งต ์ฌ์ฉํ๊ธฐhttps://developers.google.com/maps/documentation/places/web-service/search?hl=ko#nearby-search-and-text-search-responses ์ฅ์ ๊ฒ์ | Places API | Google for Developers์ด์ Places API (์ ๊ท)๊ฐ ์ถ์๋๋ฉด์ ์ฐจ์ธ
codebunny99.tistory.com
Manifest์์ ์์ฑํด์ฃผ๊ธฐ
<uses-permission android:name="android.permission.INTERNET"/>
๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค์น
build.gradle.kts(:app) ์์, ๋งจ ์๋ซ์ค ์์ฑ.
implementation("com.squareup.retrofit2:retrofit:2.11.0")
implementation("com.squareup.retrofit2:converter-gson:2.11.0")
implementation("com.squareup.okhttp3:logging-interceptor:4.12.0")
implementation("com.github.bumptech.glide:glide:4.16.0")
implementation("commons-io:commons-io:2.4")
config, NetworkClient ์์ฑํ๊ธฐ
config
package com.~.placeapp.config;
public class Config {
public static final String DOMAIN = "https://maps.googleapis.com";
public static final String SP_NAME = "places_app";
public static final String PLACE_API_KEY = "์์ ์ API ํค ์
๋ ฅ";
}
NetworkClient
package com.~.placeapp.api;
import android.content.Context;
import com.~.placeapp.config.Config;
import java.util.concurrent.TimeUnit;
import okhttp3.OkHttpClient;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;
public class NetworkClient {
public static Retrofit retrofit;
public static Retrofit getRetrofitClient(Context context){
if(retrofit == null){
// ํต์ ๋ก๊ทธ ํ์ธํ ๋ ํ์ํ ์ฝ๋
HttpLoggingInterceptor loggingInterceptor =
new HttpLoggingInterceptor();
loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
// ๋คํธ์ํฌ ์ฐ๊ฒฐ๊ด๋ จ ์ฝ๋
OkHttpClient httpClient = new OkHttpClient.Builder()
.connectTimeout(1, TimeUnit.MINUTES)
.readTimeout(1, TimeUnit.MINUTES)
.writeTimeout(1, TimeUnit.MINUTES)
.addInterceptor(loggingInterceptor)
.build();
// ๋คํธ์ํฌ๋ก ๋ฐ์ดํฐ๋ฅผ ๋ณด๋ด๊ณ ๋ฐ๋
// ๋ ํธ๋กํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ ๊ด๋ จ ์ฝ๋
retrofit = new Retrofit.Builder()
.baseUrl(Config.DOMAIN)
.client(httpClient)
.addConverterFactory(GsonConverterFactory.create())
.build();
}
return retrofit;
}
}
PlaceApi
package com.~.placeapp.api;
import com.~.placeapp.model.PlaceList;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Query;
public interface PlaceApi {
//ํค์๋ ๊ธฐ๋ฐ์ผ๋ก ์ฅ์ ๊ฐ์ ธ์ค๋ API
@GET("/maps/api/place/nearbysearch/json")
Call<PlaceList> getPlaceList(@Query("language") String language,
@Query("location") String location,
@Query("radius") int radius,
@Query("key") String key,
@Query("keyword") String keyword);
}
activity_main ํ๋ฉด์์ฑ
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/main"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivity">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:id="@+id/layoutTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="20dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="20dp"
android:orientation="horizontal">
<EditText
android:id="@+id/editKeyword"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="๊ฒ์์ด ์
๋ ฅ..."
android:inputType="text"
android:textSize="20sp" />
<ImageView
android:id="@+id/imgSearch"
android:layout_width="40dp"
android:layout_height="match_parent"
app:srcCompat="@drawable/search_24dp" />
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/layoutTop" />
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true" />
</RelativeLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
layout์ place_row.xml ์ถ๊ฐํ์ฌ ๋ฆฌ์ฌ์ดํด๋ฌ๋ทฐ์ ๋ค์ด๊ฐ ์นด๋๋ทฐ ์์ฑ
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<androidx.cardview.widget.CardView
android:id="@+id/cardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="10dp"
android:layout_marginTop="5dp"
android:layout_marginEnd="10dp"
android:layout_marginBottom="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/txtName"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="TextView"
android:textSize="22sp" />
<TextView
android:id="@+id/txtVicinity"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="5dp"
android:text="TextView"
android:textSize="22sp" />
</LinearLayout>
</androidx.cardview.widget.CardView>
</androidx.constraintlayout.widget.ConstraintLayout>
model ํจํค์ง ์์ฑ
Place ํด๋์ค
package com.~.placeapp.model;
import com.google.gson.JsonArray;
public class Place implements Serializable {
public String name;
public String vicinity;
public Geometry geometry;
// ์ด๋ ํด๋์ค inner class
public class Geometry implements Serializable {
public Location location;
// ์ด๋ ํด๋์ค inner class
public class Location implements Serializable {
public double lat;
public double lng;
}
}
}
PlaceList
package com.~.placeapp.model;
import java.util.ArrayList;
public class PlaceList {
public ArrayList<Place> results;
}
PlaceAdapter
package com.~.placeapp.adapter;
import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.cardview.widget.CardView;
import androidx.recyclerview.widget.RecyclerView;
import com.~.placeapp.MapActivity;
import com.~.placeapp.R;
import com.~.placeapp.model.Place;
import java.util.ArrayList;
public class PlaceAdapter extends RecyclerView.Adapter<PlaceAdapter.ViewHolder> {
Context context;
ArrayList<Place> placeArrayList;
public PlaceAdapter(Context context, ArrayList<Place> placeList) {
this.context = context;
this.placeArrayList = placeList; // ์ฌ๊ธฐ์ placeArrayList์ ์ฌ๋ฐ๋ฅด๊ฒ ํ ๋นํฉ๋๋ค.
}
@NonNull
@Override
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.place_row, parent, false);
return new ViewHolder(view);
}
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
Place place = placeArrayList.get(position);
if (place.name == null) {
holder.txtName.setText("์์ ๋ช
์์");
} else {
holder.txtName.setText(place.name);
}
if (place.vicinity == null) {
holder.txtVicinity.setText("์ฃผ์ ์์");
} else {
holder.txtVicinity.setText(place.vicinity);
}
}
@Override
public int getItemCount() {
return placeArrayList != null ? placeArrayList.size() : 0;
}
public class ViewHolder extends RecyclerView.ViewHolder {
TextView txtName;
TextView txtVicinity;
CardView cardView;
public ViewHolder(@NonNull View itemView) {
super(itemView);
txtName = itemView.findViewById(R.id.txtName);
txtVicinity = itemView.findViewById(R.id.txtVicinity);
cardView = itemView.findViewById(R.id.cardView);
cardView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(context, MapActivity.class);
int index = getAdapterPosition();
if (index != RecyclerView.NO_POSITION) {
Place place = placeArrayList.get(index);
intent.putExtra("place", place);
context.startActivity(intent);
}
}
});
}
}
}
MainActivity
package com.~.placeapp;
import android.Manifest;
import android.content.pm.PackageManager;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.ProgressBar;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.app.ActivityCompat;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;
import com.~.placeapp.adapter.PlaceAdapter;
import com.~.placeapp.api.NetworkClient;
import com.~.placeapp.api.PlaceApi;
import com.~.placeapp.config.Config;
import com.~.placeapp.model.Place;
import com.~.placeapp.model.PlaceList;
import java.util.ArrayList;
import retrofit2.Call;
import retrofit2.Callback;
import retrofit2.Response;
import retrofit2.Retrofit;
public class MainActivity extends AppCompatActivity {
LocationListener locationListener;
LocationManager locationManager;
EditText editKeyword;
ImageView imgSearch;
ProgressBar progressBar;
RecyclerView recyclerView;
ArrayList<Place> placeArrayList = new ArrayList<>();
PlaceAdapter adapter;
//ํ์ฌ ๋์ ์์น๋ฅผ ๋ํ๋ด๋ ์๋, ๊ฒฝ๋ ๋ฉค๋ฒ๋ณ์
double lat;
double lng;
String keyword;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
editKeyword = findViewById(R.id.editKeyword);
imgSearch = findViewById(R.id.imgSearch);
progressBar = findViewById(R.id.progressBar);
recyclerView = findViewById(R.id.recyclerView);
recyclerView.setHasFixedSize(true);
recyclerView.setLayoutManager(new LinearLayoutManager(MainActivity.this));
// ํ์ฌ ํฐ์ ์์น๋ฅผ ๊ฐ์ ธ์ค๋ ์ฝ๋ ์์ฑ.
// 1. ๋ก์ผ์ด์
๋งค๋์ ๋ฅผ ๊ฐ์ ธ์จ๋ค
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
// 2. ์์น๊ฐ ๋ฐ๋๋๋ง๋ค ์์น์ ๋ณด๋ฅผ ๊ฐ์ ธ์ค๋ ์ฝ๋ ์์ฑ
locationListener = new LocationListener() {
@Override
public void onLocationChanged(@NonNull Location location) {
lat = location.getLatitude();
lng = location.getLongitude();
Log.i("PLACES MAIN", "์๋ : " + lat + ", ๊ฒฝ๋ : " + lng);
}
};
// 3. ๋ก์ผ์ด์
๋งค๋์ ์, ์ฐ๋ฆฌ๊ฐ ์์ฑํ ํจ์๋ฅผ ์ ์ฉํ๋ค.
if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(MainActivity.this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION,
Manifest.permission.ACCESS_COARSE_LOCATION},
100);
return;
}
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
3000,
-1,
locationListener); //minTimeMs์ด๋ง๋ค ํ๋ฒ์ฉ ๋๋ minDistanceM๋ฏธํฐ๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ํ๋ฒ์ฉ ์คํ ์ํจ๋ค.
progressBar.setVisibility(View.GONE);
imgSearch.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
keyword = editKeyword.getText().toString().trim();
if(keyword.isEmpty()){
return;
}
getNetworkData();
}
});
}
private void getNetworkData() {
progressBar.setVisibility(View.VISIBLE);
placeArrayList.clear();
//๋คํธ์ํฌ ํธ์ถ
Retrofit retrofit = NetworkClient.getRetrofitClient(MainActivity.this);
PlaceApi api = retrofit.create(PlaceApi.class);
Call<PlaceList> call = api.getPlaceList("ko", lat+","+lng, 2000, Config.PLACE_API_KEY, keyword);
call.enqueue(new Callback<PlaceList>() {
@Override
public void onResponse(Call<PlaceList> call, Response<PlaceList> response) {
progressBar.setVisibility(View.GONE);
if(response.isSuccessful()){
PlaceList placeList = response.body();
placeArrayList.addAll(placeList.results);
adapter = new PlaceAdapter(MainActivity.this, placeArrayList);
recyclerView.setAdapter(adapter);
} else {
}
}
@Override
public void onFailure(Call<PlaceList> call, Throwable throwable) {
progressBar.setVisibility(View.GONE);
}
});
}
@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
super.onRequestPermissionsResult(requestCode, permissions, grantResults);
if (requestCode == 100) { // ์์ฒญ ์ฝ๋๊ฐ 100์ผ ๋๋ง ์ฒ๋ฆฌ
// grantResults ๋ฐฐ์ด์ ๊ธธ์ด๋ฅผ ํ์ธํ์ฌ IndexOutOfBoundsException ๋ฐฉ์ง
if (grantResults.length > 1 && grantResults[0] == PackageManager.PERMISSION_GRANTED && grantResults[1] == PackageManager.PERMISSION_GRANTED) {
// ์์น ๊ถํ์ด ์น์ธ๋์์ ๋
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED
&& ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
if (locationManager != null) { // locationManager๊ฐ null์ด ์๋์ง ํ์ธ
locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,
3000,
-1,
locationListener); // minTimeMs์ด๋ง๋ค ํ ๋ฒ์ฉ ๋๋ minDistanceM๋ฏธํฐ๊ฐ ๋ณ๊ฒฝ๋ ๋๋ง๋ค ํ ๋ฒ์ฉ ์คํ
}
}
}
}
}
}
์นด๋๋ทฐ ๋๋ฅด๋ฉด ์ง๋ ๋จ๋ MapActivity ๋ง๋ค๊ธฐ
activity_map.xml : ์ง๋๋ก ํ๋ค.
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
MapActivity.java
package com.~.placeapp;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.yujinoh.placeapp.model.Place;
public class MapActivity extends AppCompatActivity {
Place place;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_map);
place = (Place) getIntent().getSerializableExtra("place");
SupportMapFragment mapFragment =
(SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
// ์์์ ๋ฐ์์จ place ๊ฐ์ฒด์ ์ ์ฅ๋์ด ์๋ ์๋, ๊ฒฝ๋ ๊บผ๋ด์
LatLng latLng = new LatLng(place.geometry.location.lat, place.geometry.location.lng);
// 1. ์ง๋์ ์์น๋ฅผ ์ด ์๋, ๊ฒฝ๋๋ฅผ ์ค์ฌ์ผ๋ก ํด์ ์ด๋์ํจ๋ค.
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(latLng, 17));
// 2. ๋ง์ปค๋ก ํ์ํ๋ค.
MarkerOptions markerOptions = new MarkerOptions();
if(place.name == null){
markerOptions.position(latLng).title("์์ ๋ช
์์");
}else{
markerOptions.position(latLng).title(place.name);
}
googleMap.addMarker(markerOptions);
}
});
}
}
ํด๋ฆญํ๋ฉด,
์ก์ ๋ฐ์ ์ง๋ ์์ด์ฝ ํด๋ฆญํ๋ฉด, ๊ฒ์ํ ๊ณณ์ ๋ชจ๋ ์ง๋๋ก ๋ง์ปค ํ์ํ๊ฒ ํ๊ธฐ
๋ฉ๋ด๋ฅผ ๋ง๋ ๋ค.
Activity ๋ง๋ค๊ธฐ : PlaceActivity๋ก ํ์๋ค.
activity_place.xml ํ๋ฉด ์ฝ๋ : ์ง๋๋ก ํ๋ค.
<?xml version="1.0" encoding="utf-8"?>
<fragment xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:map="http://schemas.android.com/apk/res-auto"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
PlaceActivity ์์ฑํ๊ธฐ
package com.~.placeapp;
import android.os.Bundle;
import androidx.annotation.NonNull;
import androidx.appcompat.app.AppCompatActivity;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.OnMapReadyCallback;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
import com.yujinoh.placeapp.model.Place;
import java.util.ArrayList;
public class PlaceActivity extends AppCompatActivity {
Place place;
ArrayList<Place> placeArrayList;
double lat;
double lng;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_place);
// ๋ฐ์ดํฐ ๋ฐ์์ค๊ธฐ
placeArrayList = (ArrayList<Place>) getIntent().getSerializableExtra("placeArrayList");
lat = getIntent().getDoubleExtra("lat", 0);
lng = getIntent().getDoubleExtra("lng", 0);
SupportMapFragment mapFragment =
(SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map);
mapFragment.getMapAsync(new OnMapReadyCallback() {
@Override
public void onMapReady(@NonNull GoogleMap googleMap) {
// 1. ์์์ ๋ฐ์์จ place ๊ฐ์ฒด์ ์ ์ฅ๋์ด ์๋ ์๋, ๊ฒฝ๋ ๊บผ๋ด์
LatLng myLocation = new LatLng(lat, lng);
googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(myLocation, 17));
// 2. ์์์ ๋ฐ์ ์ด๋ ์ด๋ฆฌ์คํธ์ ๋ค์ด์๋ ํ๋ ์ด์ค๋ฅผ ๋ฐ๋ณต๋ฌธํด์ ๋ง์ปค๋ก ๋ง๋ ๋ค.
for( Place place : placeArrayList ){
LatLng latLng = new LatLng(place.geometry.location.lat, place.geometry.location.lng);
MarkerOptions markerOptions = new MarkerOptions();
markerOptions.position(latLng).title(place.name);
googleMap.addMarker(markerOptions);
}
}
});
}
}
GPS๊ฐ ์ค๋น๋์ด์์ง ์์๋๋ฐ, ์ง๋๋ฅผ ๋๋ฅด๋ฉด ์๋ฌ๊ฐ ๋ฐ์ํ ์ ์๋ค.
์ด๋ฌํ ์ค๋ฅ๋ฅผ ์ก๊ธฐ์ํด MainActivity์ ์๋์ ๊ฐ์ด ์์ฑํ๋ค.
(1) ๋ณ์ ์ค์
(2) ์์ง ์ค๋น๊ฐ ์๋์ ๋, ํ์ ์ฐฝ์ ๋์ด๋ค.
(3) ์ค๋น๊ฐ ๋์์ ๋์๋ ์ ๋์ํ๋๋ก true๋ก ํ๋ค