GWT sample for handling mobile browsers

I am working on a GWT application that should serve a different format for mobile device users. I can easily determine if a user is using a mobile browser; however, I'm not sure of the best template for handling them.

I am currently using the MVP pattern - would it be better to just pass the browser a specific view for Presenter, or is there a better method?

+3
source share
2 answers

You can configure GWT to detect which web browser you are using, as described in this question . Then, Deferred Binding , let the compiler โ€œslipโ€ the correct view of the user agent, say mobilesafari. This way, you donโ€™t have to clog your Java code with browser detection, etc.

0
source

As I did, it has different GWT modules (with their own entry point, Gin modules, even different CssResources), and then on the myapp.html page you just need to check which browser is requesting content and based on this (javascript check) the corresponding module

<script src="myapp/myapp.nocache.js"/>

or

<script src="mymobileapp/mymobileapp.nocache.js"/>
Loading

.

GIN MVP- (gwt-platform - ), , .

0

Source: https://habr.com/ru/post/1759366/


All Articles