I want to do some application to learn how to work with android and maps. So I want to make something simple, like showing on the map the schools or museums from a given city.
I think I have to use the Google Places API, so I read some things about it. I saw that I have to make some request to a rest server, and they will return me a json response. I understand that. But, what I don't understand is how can I "translate" those json responses into pinpoints on the map.
If you can guide me to some tutorials or some examples with this, I would appreciate that. I saw some links right here, on SO, but they were incomplete or not working.
Thanks
you use the json data as follows:
var a=new JSONObject(jsonData);
http://developer.android.com/resources/tutorials/views/hello-mapview.html
Use the data from a to constuct the necessary objects and add it to the map.
http://jquery-ui-map.googlecode.com/svn/trunk/demos/jquery-mobile-google-maps-places.html
Related
I am working on the FourSquare venue API.
The following API link was giving results until this morning at 3 AM:
https://api.foursquare.com/v2/venues/search?ll=-6.21944223,106.80315059&intent=browse&radius=30&client_id=XXXX&client_secret=XXXX&v=20180512&m=foursquare
but now there is an empty venue array with status code 200. There is no update on the developer website.
Please help me understand why this is happening. Thanks in advance.
I had a similar problem with my app. Up until a couple of weeks ago we were able to make requests to the Foursquare api without specifying category ids. By doing this all place categories were considered. But now if you ommit categoryId no place is returned at all. I don't know if this is a bug on the Foursquare api or just a feature change (a VERY BREAKING change).
While we don't know the real answer, try adding a "categoryId" to your request, such as:
https://api.foursquare.com/v2/venues/search?
client_id={YOUR_CLIENT_ID}
&client_secret={YOUR_CLIENT_SECRET}
&v=20130815&ll={LATITUDE},{LONGITUDE}
&limit=50
&intent=browse
&radius=50
&categoryId=4d4b7104d754a06370d81259,4d4b7105d754a06372d81259
(the indentation on the URL above is just for legibility, you should pass this URL as a single line when doing your request)
As #FelipeFerri suggested, I have added following parameter in API and it start giving the result.
https://api.foursquare.com/v2/venues/search?ll=-6.21944223,106.80315059&intent=browse&radius=30&client_id=XXXX&client_secret=XXXX&v=20180512&m=foursquare&&categoryId=4d4b7104d754a06370d81259,4d4b7105d754a06372d81259,4d4b7105d754a06373d81259,4d4b7105d754a06374d81259,4d4b7105d754a06376d81259,4d4b7105d754a06377d81259,4d4b7105d754a06375d81259,4e67e38e036454776db1fb3a,4d4b7105d754a06378d81259,4d4b7105d754a06379d81259
Thanks
Same thing happens to me. I've changed the API version (v) also without any
I need to get data from table id="maintable" from website "http://trackinn.az/GeoLoc/reports.aspx?login=ho&password=ho". I tried many methods some of them worked for other websites but not for this one. Could someone help pls?
Thanks.
You cannot get data from that table. It is being dynamically created by javascript (AJAX particularly). And I don't think there is any api wich can process javascript.
It would be possible to get data if it was a static file or the part you want would be static, but it is not.
If you are using this site to get geolocation, then use google geocoding api for this. it would be better option.
I am trying to parse a website, specifically this one It does not provide a api for that, like it does for bf4 or other titles, but the owner said that I should just parse the data.
The problem I have is that using jSoup, it retrieves the data, but if you look carefully, the website makes a new httpget and only after that the search is completed.
From what I could gather, i think it sends some paramethers in the header to.
If i just use jSoup to call that like I get some data, and where the search should be I get the message:
Please activate Javascript to see the search results.
Is there is a way to get the data? I really need this, any help is very much appreciated.
Please help
You need a javascript-capable client, e.g., HtmlUnit or Selenium.
Is there a Json - parser for java online that can help me to create Java - objects from Json-string? (I found similar one but there I can translate json-string in Java -objects only if I have url for my json-string)?
Thanks for the link, this should be easy:
upload your JSON string to a site like pastebin.com
get the RAW link, i.e. the one without the PasteBin website around)
put that into http://jsongen.byingtondesign.com
Have a look at http://jackson.codehaus.org/
But be sure that you really want to put it into Java objects, because whenever the JSON representation changes, translation will break of course.
QuickType.io is exactly what you're looking for.
For the record, I'm unaffiliated.
I have a large collection of twitter messages from the streaming twitter API saved as JSON strings in text files.
I wanted to know if anyone knew how I could convert these JSON strings into something like the Twitter4J status object for use as a simple object with getters and setters?
I was thinking about debugging the source and writing my own inject class which would mimic the input stream classes, however I wonder if there is a better way..?
Thanks!
Try DataObjectFactory#createStatus(String). It's a simple static method that returns one single twitter4j.Status object.
http://twitter4j.org/en/javadoc/twitter4j/json/DataObjectFactory.html#createStatus(java.lang.String)
You can try using Google's Protobuff or Codehause's XStream or Jackson
This thread might help
https://stackoverflow.com/questions/338586/a-better-java-json-library
Depends on what you want to do with the data. One thought that comes to mind is importing it into a database like MongoDb which already has support for importing JSON http://www.mongodb.org/display/DOCS/Import+Export+Tools . then you can proceed to analyse or convert the data further from there