Is their any way in gwt or gwt bootstrap to find the device on which the web app is running. Like if the device is iphone,tablet,desktop.ipad etc.,Please help.
相关问题
- How to run GWT in production mode
- Can you set the Location header in a chunked http
- Google Guava 15.0 Error with GWT 2.5.1?
- What are the advantages ManageIQ has over OpenStac
- How can I make the angular.js route the long path
相关文章
- Spring NamespaceHandler issue when launching Maven
- File Upload of more than 4GB
- Returning plain text or other arbitary file in ASP
- Annotation for GWT compiler to ignore method
- getComputedStyle like javascript function for IE8
- Uploading to Blobstore gives a Java heap OutOfMemo
- GWT ,Vaadin,SmartGwt,ExtGwt ?---from Swing [closed
- how to Change glassfish application url
Setup
GWT allows you to define properties which will be resolved during the execution of the deferred binding mechanism (part of the startup sequence of your app, see Elements of Deferred Binding here). For example, defining this in your app's
gwt.xml
file:And then supplying this in the same file:
For a full example, see MobileWebApp, a GWT sample app. Specifically, take a look at FormFactor.gwt.xml.
Usage
Once you set up your property and program its provider, there are multiple places in your app where you can reach the value of the property:
CSS:
(for more supported rules see CssResource)
In the module XML definition (e.g. for ClientFactory selection):
Java code? Only via deferred binding.
You don't need bootstrap at all to know which browser your client is running on.
Just call...
...to get the user-agent of the browser.
A list of all user-ager avaiable is provided here:
http://www.useragentstring.com/pages/All/
For instance, check for "ipad" match in user-agent String.