detect ipad/iphone webview via javascript

This uses a combination of window.navigator.userAgent and window.navigator.standalone. It can distinguish between all four states relating to an iOS web app: safari (browser), standalone (fullscreen), uiwebview, and not iOS. Demo: http://jsfiddle.net/ThinkingStiff/6qrbn/ var standalone = window.navigator.standalone, userAgent = window.navigator.userAgent.toLowerCase(), safari = /safari/.test( userAgent ), ios = /iphone|ipod|ipad/.test( userAgent ); if( ios ) { if ( !standalone … Read more

How to change font face of Webview in Android?

There’s a working example of this in this project. It boils down to: In your assets/fonts folder, place the desired OTF or TTF font (here MyFont.otf) Create a HTML file that you’ll use for the WebView’s content, inside the assets folder (here inside assets/demo/my_page.html): <html> <head> <style type=”text/css”> @font-face { font-family: MyFont; src: url(“file:///android_asset/fonts/MyFont.otf”) } … Read more

Android. WebView and loadData

myWebView.loadData(myHtmlString, “text/html; charset=UTF-8″, null); This works flawlessly, especially on Android 4.0, which apparently ignores character encoding inside HTML. Tested on 2.3 and 4.0.3. In fact, I have no idea about what other values besides “base64” does the last parameter take. Some Google examples put null in there.

Cannot display HTML string

I have modified the code here: public class test extends Activity { private WebView wv; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.test); wv = (WebView) findViewById(R.id.wv); String s = “&lt;!DOCTYPE html&gt; &lt;html lang=&quot;en&quot;&gt; &lt;head&gt; &lt;meta charset=&quot;utf-8&quot;&gt; &lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=edge&quot;&gt; &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt; &lt;meta name=&quot;description&quot; content=&quot;&quot;&gt; &lt;title&gt;Saulify&lt;/title&gt; &lt;!– All the Favicons… –&gt; &lt;link rel=&quot;shortcut … Read more

dequeueBuffer: can’t dequeue multiple buffers without setting the buffer count

This is an out of memory problem as it is indicated here: 11-08 18:28:31.347: W/Adreno-ES20(4749): <gl2_surface_swap:43>: GL_OUT_OF_MEMORY android.view.Surface is making more updates then the GPU can handle. I am not sure that you can even try-catch this one. I also believe that on many devices where there is no crash the users will experience occasional … Read more