I think you want to search places in google places api, you can use PlaceAutocompleteFragment and get the location and search it through Latlong.
The problem you will face while just adding a Edittext is when the location is non recognizable by google maps api then it will show no place and keeps you thinking about the exact name instead PlaceAutocompleteFragment will help to guess you the exact places.
Implement - PlaceSelectionListener
and add following code
PlaceAutocompleteFragment autocompleteFragment;
PlaceSelectionListener ps;
autocompleteFragment = (PlaceAutocompleteFragment)
getFragmentManager().findFragmentById(R.id.search1);
set listner - autocompleteFragment.setOnPlaceSelectedListener(this);
public void onPlaceSelected(Place place) {
if (m_map == null) {
return;
}
g = place.getName().toString();
final LatLng latLng = place.getLatLng();
m_map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng, 21));
}
XML-
<fragment
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:name="com.google.android.gms.location.places.ui.PlaceAutocompleteFragment"
android:id="@+id/search1"
>