As the user types words, Google translate will dynamically in real-time translate the text on the other side.
Try it out at translate.google.com
Now I hope to mimic this feature on a translation website I'm building. I'm using React for the development.
Thanks.
To do this, you can use the google translate API
Google provides great documentation and tutorials here
If you want to implement the asynchronous calls, you will need to make an ajax request after each word is typed
React provides great documentation and tutorials here
Related
I've integrated mediawiki api into my app, but the response of mediawiki api does not match with wiki how search results. Can anyone share your experience regarding this issue.
Note:
I haven't seen any documentation for wikihow api.
yes .wikihow has a way of hiding their base url(endpoint) so that no api call can derive data from it.the best thing to do is use libraries like scrapy to scrape the website.otherwise.mediawiki apis are not working currently
I have to include the google map API in j2me application. I want to change the route and change the center position dynamically. I have searched a lot. Now I am using google static map API but it shows the image statically. I want to show the map dynamically.
Using javascript API v3 shall I implement google map API in j2me. But one of forums I have found we can't use javascript API in j2me application. Please Give clear idea about this why we can't implement in j2me.
I haven't taken a deeper look, but I found these two links when searching Google.
http://www.developer.nokia.com/Community/Wiki/Archived:Google_Static_Maps_API_in_Java_ME
http://www.jappit.com/blog/midmaps-google-maps-java-me-library/
Whereas it is technically possible to use a static mapping API to display an map in Java ME, If you want to dynamically update the map, you would be much better off using a library which uses a tile server, caches your map tiles and overlays objects on top of it.
This should result in a much lower data traffic overhead as explained here. Only use a Map Image API if all you need is a single map image.
The dynamic mapping library I would suggest is Nokia's HERE Maps API for Java ME, as you can tell from the name, the API is specifically designed to work with Java ME devices.
The API is currently bundled with the Nokia Asha SDK 1.0, but despite this, it is in reality a separate independent plugin and has been designed to work with the full range of standard Java ME devices.
A similar Stack Overflow question answered here describes how to download it.
As a notice of affiliation, I should mention in passing that I do work for Nokia.
I have seen the two forms of reference to the Google Places Library/Service, using JavaScript vs calling the API directly, a number of times, but I don't understand the difference. The Google Docs don't describe anything about two methods of accessing the API.
For example, this question talks about 2 ways of accessing the API: OVER_QUERY_LIMIT in a loop
And it appears that there is some type of direct web access taking place in this question: Querying Google Places API using jQuery
Is this something where there was an old way that involved formatting URL parameters and the new way is by utilizing the JavaScript library calls?
FINAL SUMMARY EDIT: There are two distinct ways of requesting data from Google, as described in #Dan Nissenbaum's answer below. And since my original question, the QUERY_LIMIT question referenced above has been edited to also include more information about the two options.
Perhaps you are referring to the distinction between the Google Places API that is intended for use on the SERVER (i.e., utilizing PHP to call the Google Places API directly), and using the completely different approach of the Google Places Javascript Library in which the BROWSER executes Javascript using the Javascript library provided by Google (that internally wraps calls to the Google Places API, so that you, as a Javascript programmer, only need to understand the Javascript library provided by Google, and use that)?
Here are the two scenarios.
Scenario #1: Use the API directly. For this method, you must refer to Google's API documentation for the Google Places API: https://developers.google.com/maps/documentation/places/.
Using this API works as follows (giving a simple example only). Say you want to retrieve places within 1000 meters of latitude=-27.2531166, longitude=138.8655664. You need to hit a URL as described by the API documentation: https://developers.google.com/maps/documentation/places/#PlaceSearchRequests.
In this example, the URL looks like this (it's long):
https://maps.googleapis.com/maps/api/place/search/json?location=-27.2531166,138.8655664&radius=1000&sensor=false&key=AddYourOwnKeyHere
You need a key for your personal use, which I assume you have. There are other options you can specify, such as limiting the results to restaurants, etc.
When you hit this URL, the data will be returned in either JSON, or XML format, as specified by the text json in the URL above (use the text xml for xml). This data is returned exactly like data is returned from any URL call when you hit a URL in your browser.
You can test this by simply typing the URL directly in your browser, and see the results.
To use the API directly from code, you will need to use code that hits the external URL above within code and retrieves the results within code (for example, using the PHP CURL library, or using AJAX in Javascript).
Scenario #2: You use the Javascript library that Google provides that wraps the API, so you don't need to deal with it. I'll update the answer with more details about this, if you don't know what this is.
The docs do discuss the two different approaches. The Places Library utilizes the Google Places services from within the JavaScript Google Maps API. If you are using the Google Maps API in a browser, this is probably the approach for you:
https://developers.google.com/maps/documentation/javascript/places
There is also a web service, which allows you to query directly from your application. You query it using direct http calls to Google services. If you need access to the data on your server or a mobile device, this is the approach you want to take:
https://developers.google.com/maps/documentation/places
When I search for food (for example) in google maps, i get a bunch of businesses, each one having reviews... like in Yelp. I am trying to get those business' reviews so I can use them as training data to my NLP review classifier.
... and also does the api support only javascript? can i do something to use the API with Java?
Google dont make this available by any API.
v3 of the javascript api - only supports javascript - its designed to run in a web-browser. So makes absolutely no sense to run in java. (although can have a browser in a java app)
... other apis can be called from java.
I want to create a web application which makes use of Google maps.
Features are quite simple:
Users can login (best with FB connect)
Users can post items which are geolocated
UI consists mainly of a google map with all items
I'm looking for something implemented where you would only have to specify the nature of your items.
Any ideas?
If you're not going to make money off of it, you can use ESRI's Javascript API for free:
ArcGIS Javascript API