Friday, January 20, 2017

Re: mobile device detect and back button detect

To detect browsers/devices, the below works:

private static boolean IS_ANDROID;
private static boolean IS_IOS;
private static boolean IS_HANDHELD;
private static boolean IS_FIREFOX;
private static String VIDEO_EXTENSION = "_me.mp4";
private static String DEFAULT_IMAGE_DIRECTORY = "";

static {
 IS_ANDROID
= Window.Navigator.getUserAgent().toLowerCase().contains("android");
 IS_IOS
= Window.Navigator.getUserAgent().toLowerCase().contains("iphone") || Window.Navigator.getUserAgent().toLowerCase().contains("ipod");
 IS_HANDHELD
= IS_ANDROID || IS_IOS;
 IS_FIREFOX
= Window.Navigator.getUserAgent().toLowerCase().contains("firefox");
}


On Friday, January 20, 2017 at 7:32:39 AM UTC-8, David wrote:
In GWT, how do I detect mobile devices to get whether or not it is a Apple phone or Android phone. I also need to detect back button once uses click it. Now I used MGWT (version 2) to detect it. It doesn't work well.

Thanks,

David

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at https://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment