I’m writing an Android app which uses Javascript in a WebView for most of the UI. I’ve exposed to JS a simple interface to create temporary files. In Java, I provide a function to create a temporary file, which returns a file ID, and a set of functions to operate on temporary files given an ID. In JS, I wrap
Tag: android
Load HTML in WebView with local css and js
I am displaying a webview with a remote html content get as a string from a remote server. I store the html locally for a no connection use of my application. Moreover I also store a .js script and a .css style file locally. These files can be updated by the server. I store all these files at the following
How can I hide the Android keyboard using JavaScript?
I would like to hide the Android virtual keyboard in JavaScript. Someone suggested doing this: But this doesn’t work if the keyboard is already visible. Is this something that can be done? Answer What you need to do is create a new input field, append it to the body, focus it and the hide it using display:none. You will need
Android WebView – Setting HTML Field focus using Javascript
I have an application with just a visible WebView component to it which is used to display some dynamically generated HTML (can run Javascript too). It’s enabled for the WebView. For a few pages I am trying to set the focus of one of the input text boxes after the page load has finished – not through Body onLoad(), but
Detect a finger swipe through JavaScript on the iPhone and Android
How can you detect that a user swiped his finger in some direction over a web page with JavaScript? I was wondering if there was one solution that would work for websites on both the iPhone and an Android phone. Answer Simple vanilla JS code sample: Tested in Android.