I am using Android's built in WebView to show something to the user. I also insert custom javacsript to the page user is is viewing, since it's rather complicated javascript (lets call it userscript, because it acts like you are using for an example Chrome's a userscript on specific page only) Im interested what are the differences in Chromes WebView in different devices?
I guess they are using stock "browser" rendering, but what about javascript support, css3 support etc. on different devices.
Just to be clear.
WebView on Android is actually a version of WebKit customised for the Android platform. It's not a version of Chrome.
Chrome for Android stays up to date as much as possible with desktop chrome.
On iOS I believe the WebView is a single core version of the Safari browser so has some differences.
Chrome for iOS uses this WebView to display web content.
Regarding support best thing to do it look at sites such as http://caniuse.com/
The Android WebView is the same as the "Android Stock Browser" that exists on many Android phones (but is oddly unavailable in Google's Nexus devices). This is true for rendering, JavaScript, etc. When you're looking at a site such as http://caniuse.com, the "Android" column is what you're looking for, not the "Chrome" column.
Unfortunately, testing on Chrome bears almost no relation to using a WebView on Android. Google has stated that they are working on a new WebView component that would be part of Chrome. I asked Google representatives directly when this would be available at PhoneGap Day last month, but all they could say is "it's coming".
Related
I have a question bothering me for these few days, I want to implement browser-like WebView, which has add/close tab and open multiple websites. But after I searched through many forums and documentation still couldn't find any solution for this, wondering can WebView do exactly what phone browser can do?
This is answered by the documentation.
Building web apps in WebView
If you want to deliver a web application (or just a web page) as a part of a client application, you can do it using WebView. The WebView class is an extension of Android's View class that allows you to display web pages as a part of your activity layout. It does not include any features of a fully developed web browser, such as navigation controls or an address bar. All that WebView does, by default, is show a web page.
So the answer to your question is No. The WebView class cannot do exactly what a phone browser can do.
This does not stop you from implementing missing browser features for yourself ... starting with WebView. However, the javadoc for WebView states this:
In most cases, we recommend using a standard web browser, like Chrome, to deliver content to the user. To learn more about web browsers, read the guide on invoking a browser with an intent.
And more ...
I'm looking for a way to open a URL in a web view in reader mode. Is this possible to do in a simple web view? I've looked and have found other questions about this but they have no answers.
This is simply not possible, the Webview API has been created long before this feature existed and the API does not provide a way of activating arbitrary chrome features which are added to Chrome later.
You could however use Chrome Custom Tabs, and then app users could enable it themselves if Chrome decides to show the "Show simplifed view" popup.
After a lot of research I finally ended using the following library to display my news articles in my android app
You can check this out,
Reader-Mode-Gouse-Mohiddin-Android-Link-Preview-Library
I would like kindly ask you, are there any differences between using Java code in internet browser on laptop and browser on android device ? When I use application on laptop, everything is ok, but on tablet application is not working (I can't drag and drop objects). I have tryed online diagram application http://www.diagramo.com/editor/editor.php, but is it not working with tablet browser (Google Chrome, Mozilla). Google Chrome should support HTML 5 and Java is enabled ? I found this application very useful for working on computer and tablet. Please where can be the complication in Java - in browser or in application ?
The sollution seems to be here: JavaScript mapping touch events to mouse events. It is necessary to work with touchevents and use this part of code to set up mobile touch events. Then it works.
I need to know how to use the jquery mobile with java coding in the same application, so I can merge some features not available in the jquery platform to make some advanced android application.
appreciate your responses.
First don't listen personne3000, apparently he never touched Phonegap.
It can be done with jQuery Mobile if you use it with Phonegap. Phonegap, while working as a wrapper for HTML5/JS/CSS will give you access to native JAVA code (Android only of course). Phonegap will give you access to the wide range of mobile phone compatibilities ranging from camera, sound record up to creating native tab bar for your app.
Here you will find a "iOS Getting started" tutorial for Phonegap/Cordova and here's an Android tutorial.
Here you can find basic Phonegap/Cordova API reference and this is just a basic list, much more can be found in 3rd party plugin list here.
In case you can't find functionality you need you can create your own plugin and here you will find a Phonegap plugin tutorial for Android platform. In case you are going to use an older version of Phonegap (pre Cordova) here's an older plugin creation tutorial.
I don't think you can directly use jQuery mobile to develop your app. However, you can :
Develop an Android application using Phonegap or Cordova in HTML5/Javascript, and use jQuery mobile, but you won't have access to Java
Use WebViews to display webpages with Javascript included. You might want to look at the addJavascriptInterface method.
Javascript and Java can't be mixed just like that in an application : they work very differently.
Ok to be more specific... can I program an android app in Java that has something like a web view to which I can point to local files on the phone?
I'm thinking about making an android game and i'm wondering if it can be done with a little HTML5 and Javascript that is locally stored on the phone. I heard something about a web view in Java and that is why I am wondering if it could work.
Is this even possible?
As the other answers might be correct, there is a much simpler way:
If you know html5 programming, you can do a simple Android app that has one Activity containing one WebView. In that webview you load your index.html and there you go. You can basically do anything you would do on a normal web app.
PhoneGap and Appcelerator are for cross platform development and they provide access to the hardware (vibration, sensors etc) and they give you the possibility to build the native UI with html and javascript. For a pure WebApp they are not the correct frameworks/tools I think. I might be mistaken, but a WebGL Benchmark I wrote for PCs worked out of the box in the android browser and I justed used html5 and JavaScript.
Your answer is yes, your solution is phoneGap
http://phonegap.com/
yes definitely,
check out appcelerator.com, phonegap.com etc
u can probably go to google "cross platform mobile development"
there's a few neat html javascript frameworks