Before posting this question I have searched a lot on this, however couldn't find any work around problem.
I have a screen with webview, I have configured webview with following settings:
1.WebPage can't scroll vertically or horizontally ,
2.Removed Zoom-In & Zoom-Out on webview
The HTML file which is displayed in webview has long text & using CSS3 content is devided into multiple columns that only accommodate screen size, displaying only that split content or say partial content from HTML page (not whole HTML page). Now I have to get that split content from webView from Java (Android) & objective-C (iOS) side without screen touch or long press, from CSS3 & JS I am not able to get it.
Is it possible to get visual text / content from webview ?
If anybody have faced such problem or knows any solution please reply it.
I am facing this problem for both Android & iOS app.
Thanks In Advance !
You could loop through the DOM with jquery, and merge the results, appending them to a hidden field.
http://api.jquery.com/each/
Then you could get that field from objective c, like this:
NSString *myFields = [self.webView stringByEvaluatingJavaScriptFromString: #"document.form1.myFields.value"];
For Android, you could try this:
Android - simple user input form web-view to back-end java with jQuery Mobile
Related
Can anybody knows how to save html5 div tag data as an image using javascript...
i am doing project using phonegap..
i just want to arrange all canvas data including image inside canvas with some text on it and save it as an full image with any format .jpg,png etc.
is there anybody know ? how to done it using html5 & javascript in android phonegap?
Let me know is there anyone who suggest me..
I believe you are looking for canvas.toDataURL or canvas.toBlob (https://developer.mozilla.org/en-US/docs/DOM/HTMLCanvasElement). This presumes you have everything in the canvas to begin with. If you are looking to throw some DOM elements on the canvas (i.e. you want a .png of the non-canvas page), you probably are looking for this answer Using HTML5/Canvas/JavaScript to take screenshots.
I am using web view to load HTML page which as background image (827 x 1102), I trying to wrap the content within the given height and width of the webView and I don't want to scroll the content at initial stage by exploring regarding this I came to know about below lines of code
mwebview.getSettings().setLoadWithOverviewMode(true);
mwebview.getSettings().setUseWideViewPort(true);
The above code is working fine on 2.2, 2.3.3 but it is adding extra space on 3.0 and higher version, you can check the attached images on different version.
I even tried by appending
<head><meta name=viewport content=target-densitydpi=device-dpi/></head>
In html file but no luck.
Motorla Xoom 3.0
Samsugn Tab 2.3.3
Any help will be appreciated
Thank you in Advance
I have a webview and i am trying to load a xml or css file in it - for example this one:
http://www.w3schools.com/xml/cd_catalog.xml
Now the xml is displayed in a very "ugly way" - all the values are being concatenated in a single string that fills the screen (unfortunately I cannot post a screenshot yet but just load the link in a webview, nothing fancy).
Is there any way to display the xml (same with css) in a nice-formatted way like it is displayed in the browser?
I have an Android WebView loaded with a html file(actually stored in some folder under sdcard) that is having one/two/three image(s). Is it possible to drag-drop any one of those images?
If its possible, below are my doubts
When i drag an image from (x1,y1) place and drop it in another (x2,y2)place, How can i change the original source file code as the image place is changed ?
When i open the same html file in next time (using default html viewer or my app), i should see the image in (x2, y2) place. Isn't it possible ?
I tried this drag ImageView inside a WebView. But it is just adding an imageview to webview. (So, when i run the same app next time, i don't see the image in the place where i dropped it in first run.) But i need to drag an image presented in source html file. So After every drag-drop, Do i need to render the webview content and create a new html file to see the image in dropped location?
Is it possible to read the android-webview content? (like we read the web page content in java).
Can anyone clear my doubts and suggest me a better way if iam going/thinking wrong?
I don't think it possible (without using some not trivial tricks) to implement the drag and drop as you wish. for the other point's you raised - if the file is on your sd - why not just parse the html file and get the pictures positions and source link and use it to implement the drag and drop on your own? after all- the html file is an xml file which contains attributes which defines positions/links/images/text
Here is why I want to do.
I have an html string extracted from a rss feed.
I want it to display nicely in a WebView embedded in my activity.
I can easily do it using the loadData() function, but the display isn't optimized for a small device : in another word I want to resize the html content not to exceed my view width.
So images, frames, tables need to be resized.
How can I do it ?
I thought I could use Google Wireless Transcoder service but it only works with urls
One option would be to use css, but it depends on the feed (each post might have different formatting / apply styles inline)
Use loadDataWithBaseURL(), with "file:///android_asset/" as the base url. Put a css file in your /project/assets folder. Inject the css file into the tag of your html.