So im building an android app that gets nearby restaurants using google places api but i have a little problem with the url formatting when i using multiple keywords, when i test the url in the browser it works well but the problem when i fetch the url inside android studio which the part with brackets gets excluded from the url, So all i need is how to put brackets inside the url in android.
this is the main code for url formatting:
String keywordText;
String keyword="(Pizza)and(sushi)";
String BASE_URL="https://maps.googleapis.com/maps/api/place/nearbysearch/json?";
String API_KEY= "AIzaSyBg-iwzAjavEUVV9hOQUr0JljZHL7XFRkQ";
String ApiKey;
String locationText;
public void onLocationComplete(Location location) {
Log.e("onLocationComlete", keyword);
keywordText = "&keyword=" + keyword;
ApiKey = "&key=" + API_KEY;
radiusText = "&radius=" + radius;
locationText = "&location=" + location.getLatitude() + "," + location.getLongitude();
url = BASE_URL + locationText + radiusText + keywordText + ApiKey;
loc = location;
new FetchFromServerTask(Restaurants.this, 0).execute(url);
}
the url should i get after formatting : https://maps.googleapis.com/maps/api/place/nearbysearch/json?&location=33.2711492,35.2125282&radius=10000&keyword=(pizza)and(sushi)&key=AIzaSyBg-iwzAjavEUVV9hOQUr0JljZHL7XFRkQ
but instead i get this not working url from the console :image
is there a way to include brackets inside a url or a way to search places using multiple keywords ??