I have a list and when I click on one item of the list, one HTML page is called like that:
webView.loadDataWithBaseURL("file:///android_asset/", content, "text/html", "utf-8", "about:blank");
Inside this webview, there is HTML5 video (I'm using this library https://github.com/cprcrack/VideoEnabledWebView). When I enter in full screen mode with the video, then return to the list and click on another item to load an HTML page, this page takes too long to load (like minutes).
This only happens on some 4.4.2 devices, on the emulator it loads quickly.
My hardwareAccelerated is enabled.
I found out that if I rotate the screen, the second page loads quickly. But I tried to reload the page ou setting to clear the view, but it didn't work.
Does anyone has any idea why this happens?
I'm also getting this error:
[ERROR:in_process_view_renderer.cc(193)] Failed to request GL process. Deadlock likely: 0
If your working on web view i would suggest to look on crosswalk and chromium. Its best way to bring in hardware acceleration into the project.
Related
I'm currently working on making hybrid-app.
(Using jquery mobile.)
I have some problems on rendering webview in the application.
There are lists and detail pages with html. when the transition happens, the screen displays white screen, a previous page for a seconds, white screen and then displays detail page. And it goes to the same when I click a back button.
is this a cache problem or hardware accelerate?
I separated css file from one whole one while the application was on service. And there was css rendering problem until i did "clear date" on mobile not "clear cache". CSS didn't seem like working at all on the page.
Is this a issue of jquery mobile? or is this also the cache problem? then why didn't it work when i did "clear cache" but "clear data"?
And what will happen if i put this?:
context.deleteDatabase("webview.db");
context.deleteDatabase("webviewCache.db");
will all data saved be deleted? like, settings people using now?
Two topics I noticed in the context of page transitions and jqm:
A) rendering of a page takes some time and have impact on the transition. If you generate/update your detailed page, wait until everything has finished before the page transition starts (can be achieved with setTimeout(..., 10)
B) unfortunately, all pages in jqm are scrolling together and are not independent from each other. I noticed that before a page transition starts, the current page is scrolled to the top. Afterwards the new page appears. Looks ugly... Unfortunately several css settings must be modified to change this behaviour.
Hope this helps,
Andreas
I have a simple Activity to show a webview and a back button. Here is the code that I use to load the URL that I want in the webview.
The webpage that I am loading in on a server online, it has a few form elements plus a few links that when clicked I need to keep loading them inside the webview.
Now the problem is very often the page loads without the images, I can see the form elements though or only blank white page. I am testing this on wifi so internet is working fine.
Why is it not loading images and how can I make sure it does? I even tried making all images in the html page have absolute paths, but that did not help.
Later Edit: I found out what was causing this. Maybe others will run into this. I had this in the manifest file android:hardwareAccelerated="true". After removing it the content inside all the webviews is loading smoothly.
Second later edit: It is terrible, I get the initial page load now, but forms are not submitting and after some going back and forward to the webview, new images do not load anymore. Is it a memory problem? How do I make it start fresh every time?
WebView wv = (WebView) findViewById(R.id.webview);
wv.getSettings().setBuiltInZoomControls(false);
wv.getSettings().setJavaScriptEnabled(true);
wv.setWebViewClient(new WebViewClient());
wv.loadUrl(filepath);
I am nearly done with my first app, but I am still working on some little issues.
My main problem is that I am loading a normal html page, but I have no access to the html code.
Now I want to center the page in the webview module, because the page is also centered, so that when I am loading the page, I have to scroll all the time to the right side and that is really anoying.
So how do I do that, that the webview modul automatically loads the page already centered and the user of the app sees the middle of the page?
You mean, you dont want horizontal scroll,for that try this :
mwebView.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
I have a couple of html forms inside of an Android app.
To hide the background image of the app on the webview the height of the html page is set to 1000px via CSS (it's also set to 100% via Java for the webview, but that does not always work).
Problem:
Form A on page 1 is rather long, the submitbutton is at the end of the page. Form B on page 2 is short.
After posting form A the app does not scroll to the top of page 2 but stays at the same position. As post B is short the user sees nothing but the empty background. Not good.
We tried the following methods:
pageUp (from the Java SDK)
scrollTo() (from the Java SDK)
insert a "<a name="top"></a>" in the html code of the forms and use "window.location.hash="top" from within the app to address the anchor
The last way works almost everywhere but not on Samsung devices (reported as broken with Samsung S2 and Ace). Are there other options we might have missed?
We ended up removing the 1000px css hack.
I'm developing an application which is mainly a webview and will display a JQTouch UI. Two of the 3 views work just fine, however, I have a view which loads another page with a form which does not work at all. This view loads up just fine but when I click the link to go to the form the link just stays highlighted and nothing happens. I have overriden all of the methods in webviewclient and webchromeclient and placed breakpoints within with no luck. None of the hooks catch when I click the links.
The part that truly confounds me is that it works in the phones browser but not in my webview. Is there a setting on webview that I may be missing which would make it act like the phones browser?
Any help or suggestions would be appreciated.
The fix for this was to override onLoadResource as the link was being treated as a resource and not a new page load. I tried calling webView.loadUrl right in the override of loadREsource but that caused an endless loop so I had to write some logic to load the url properly into my webView. This seems a bit hacked but it works.