How to use google translate api for translate the content of the website inside the android Webview.
Explanation
I am showing the webpage in my application throw webview. I want to translate the web page contents based on the Locale of the android device
Please any one tell is it possible or not
Yes means how to do that
The API is now for paying developers only (sad, but inevitable), but it is available. See here: https://developers.google.com/translate/
Related
I am working on a website to simply convert it into the android app using a WebView. The website has Google Translation and I want to achieve this functionality in the android WebView app.
I have searched a lot about this but did not find a proper solution. I have enabled JavaScript, below is the code:
binding.tland.getSettings().setJavaScriptEnabled(true);
binding.tland.getSettings().setLoadWithOverviewMode(true);
binding.tland.getSettings().setUseWideViewPort(true);
binding.tland.getSettings().setDomStorageEnabled(true);
binding.tland.getSettings().setLoadsImagesAutomatically(true);
The Google Chrome App is doing what exactly I want.
you can try to use Google custom Chome tab instead of WebView when you want to have the same Google Translate feature for specific web url.
The tutorial is here: https://developer.chrome.com/docs/android/custom-tabs/integration-guide/
Is there any way to read page content (html source or DOM) from the active Chrome tab on Android devices?
Chrome for Android doesn't support extensions and there is no plans to implement Extension API on Chrome for Android in the nearest future (however, Chrome for iOS now supports App Extensions).
Some apps (for example, LastPass) can access web content inside web browser.
How can I get read access to the active web page? Are there any external Chrome APIs or something similar?
Any suggestion will be appreciated. Thanks in advance.
It seems to be possible with Android Accessibility. I think the flag you need is FLAG_REQUEST_ENHANCED_WEB_ACCESSIBILITY, so you can inject JavaScript into the website.
As you can see in this blog by lastbpass, they use the same approach. In the video at 0:53, you see the accessibility features they use.
I have created a WebView app for my android device, but I have come to a brick wall. Can anyone help.
I am trying to get Google search results from the Google search widget, passed into my Webview ?. so basically making my Webview app the native browser for my phone. is this possible ? can anyone point me in the right direction
(image of Google search widget)
I have searched all over the web, but all I can find is,
making links stay inside the Webview. But I have already done this.
How to create a Google query
I have already done these (with succession) all I need to know now is, pass Google widget results
into my Webview. fairly new to app development, but I'm learning.
You need to use google Data APIs or GDATA api.
Check this link. Select the proper api you need and read its documentation on how to use it.
You can also check the google api - java client for android or gdata -java - client
The documentation for google web search can be found here.
Hope this helps.
Use this api from google to get results
http://google.com/complete/search?output=toolbar&q=football
I am trying to creating an android dictionary app. But instead of using a database of words I am trying to leverage on the Google Custom Search API. so when the user of my android native app enters a search word in english. My native android app goes to the web and uses the Google Custom Searhc Api to get the result. But I dont know how to communicate with Google Custom Search API from an android app. Please any link. I have been search but not gotten any use one
https://developers.google.com/custom-search/json-api/v1/using_rest
I believe, this can be a good start for you. You need to use asynctasks to do your request, and the rest is up to your imagination and skills.
I am planning to create an application in android which has following features
Show Source to Destination Route
Show Reverse Route
Show Traffic Data
Show alternate Route
Store user data
apart from that i want to use some android native controls such as image button , textbox , dialog over the map.
Now after reviewing this link i am bit confuse in choosing the approach among
Google Maps API V3 in the Browser
Google Maps API V3 in a Browser Embedded in a Native Application
Native Google Maps APIs
Can anyone please help me out in choosing the right approach ?
Well, there's no simple answer to that. Every approach has its pros and cons.
Now let me state few insights that might help you in your decision (based on the idea that you want the map as a part of a native android app, not just a html5 app - correct me if I'm wrong):
You need to store user data.
If you want to store the data in the app, then I guess you can leave out the first solution. It would be very difficult (or even impossible) for you to properly maintain your data with map in a browser. The best way to maintain data is then to directly communicate with a server from the webpage and store data on the server (so you need a server backend). You can also pass some data from the webpage to an activity by registering an intent filter for your own url schema.
You don't have such problems using approach 2 and 3, where you can use android code (if you are embedding the map in a webview you can access android code by binding javascript code to android code).
You want to use android native controls.
Now you can also leave out the 1st solution, you are using browser controls there. In the 2nd solution, you can use both (the map needn't fill the entire screen and you can also place controls over the webview).
Google Maps API v3 is frequently updated and currently much more comfortable than native API. Native API wasn't much updated (not sure if it was updated at all) since Android 1.6.
From these 3 points I would prefer embedding Google Maps API V3 in a webview. Of course, I might have missed some important features of your app.