Tag: webview

Android WebView Cookie Problem

I have a server that sends my android app a session cookie to be used for authenticated communication. I am trying to load a WebView with a URL pointing to that same server and I’m trying to pass in the session cookie for authentication. I am observing that it works intermittently but I have no […]

How to set the initial zoom/width for a webview

I am trying to get the WebView to have similar behavior as the android browser. The browser opens all pages in a way that tries to fit their width to the screen. However, the default behavior of the WebView is to start at a 100% pixel scale so it starts zoomed in on the top […]

Rendering HTML in a WebView with custom CSS

My app is using JSoup to download the HTML of a message board page (let’s say in this case it is a page containing the posts of a given thread). I’d like to take this HTML, strip out unwanted items, and apply custom CSS to style it to be ‘mobile’ in a WebView. Should I […]

NameNotFoundException webview

I am getting errors from Crashlytics that indicates that some devices are missing com.google.android.webview. How is that even possible? java.lang.RuntimeException: Unable to start activity ComponentInfo{com.myapp.app/com.myapp.ReaderActivity}: android.view.InflateException: Binary XML file line #29: Error inflating class com.myapp.MyWebView at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2298) at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2360) at android.app.ActivityThread.access$800(ActivityThread.java:144) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1278) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5221) at java.lang.reflect.Method.invoke(Method.java) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:899) […]

Android Webview – Webpage should fit the device screen

I have tried the following to fit the webpage based on the device screen size. mWebview.setInitialScale(30); and then set the metadata viewport <meta name=”viewport” content=”width=320, initial-scale=1.0, maximum-scale=1.0, user-scalable=no” /> <meta name=”viewport” content=”width=device-width; initial-scale=1.0; maximum-scale=1.0; minimum-scale=1.0; user-scalable=0;”/> <meta name=”viewport” content=”width=device-width, target-densityDpi=medium-dpi”/> But nothing works, webpage is not fixed to the device screen size. Can anyone tell […]

Android Webview – Completely Clear the Cache

I have a WebView in one of my Activities, and when it loads a webpage, the page gathers some background data from Facebook. What I’m seeing though, is the page displayed in the application is the same on each time the app is opened and refreshed. I’ve tried setting the WebView not to use cache […]

how to get html content from a webview?

Which is the simplest method to get html code from a webview? I have tried several methods from stackoverflow and google, but can’t find an exact method. Please mention an exact way. public class htmldecoder extends Activity implements OnClickListener,TextWatcher { TextView txturl; Button btgo; WebView wvbrowser; TextView txtcode; ImageButton btcode; LinearLayout llayout; int flagbtcode; public […]

Android. WebView and loadData

It’s possible to use following method for content’s setting of a web-view loadData(String data, String mimeType, String encoding) How to handle the problem with unknown encoding of html data?! Is there a list of encodings?! I know from my college that in my case html comes from DB and is encoded with latin-1. I try […]

Favourite content is not shown correctly on webview

I’m developing a language dictionary app. I save the favourite word into Preference. The Favourite content in the XML file looks like the following: <?xml version=’1.0′ encoding=’utf-8′ standalone=’yes’ ?> <map> <string name=”history”> dict_name::160170::hi,dict_name::157140::he-man,dict_name::184774::jet,dict_name::34527::black </string> <string name=”waitingTime”> 0 </string> <boolean name=”saveFavourite” value=”true” /> <string name=”defaultDictionary”> dict_name </string> <string name=”favourite”> dict_name::149271::go,dict_name::25481::back,dict_name::184774::jet </string> <boolean name=”saveHistory” value=”true” /> </map> […]

How to pass html string to webview on android

Hi I am parsing xml and then loading it to web view, after parsing I am creating four strings so that I could append all string to one view. I am able to get two views on the web view but not the first two strings. Pls suggest me with my code, where am I […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.