Friday, 15 July 2011

c# - Requests POI from a location using Xamarin (Android) -


I'm trying to make with xamarin an Android app. I want the user to be able to input an address / location and get a POI. (Points of interest) near (within a certain radius).

I know that the Google Places API can do this, is Zaminin built in such a capacity for something? Can I in any way interfere with the Google Places API?

Or is there something that I do not know? Thanks for the help

Use HTTPWebRequest to create a request for Google API, code snippet :

  private void button1_Click (object sender, EventArgs e) {HttpWebRequest webRequest = WebRequest.Create (@ "https://maps.googleapis.com/maps/api/place/search/json ? location = -33.8670522,151.1957362 & amp; radius = 7500 & amp; type = library & amp; sensor = false & amp; key = AIzaSyD3jfeMZK1SWfRFDgMfxn_zrGRSjE7S8Vg ") as HttpWebRequest; WebRequest.Timeout = 20000; WebRequest.Method = "GET"; WebRequest.BeginGetResponse (New Uncompressed, webRequest); } Private Zero RequestCompleted (IAsyncResult result) {var request = (HttpWebRequest) results. AsyncState; Var response = (HttpWebResponse) request.EndGetResponse (results); (Var stream = response. {Var r using Getrsponsstrym ()) = new Strymrider (stream); Var resp = r.ReadToEnd (); }}  

The ... very simple and copy simple ...


No comments:

Post a Comment