• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java DeviceType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中eu.bitwalker.useragentutils.DeviceType的典型用法代码示例。如果您正苦于以下问题:Java DeviceType类的具体用法?Java DeviceType怎么用?Java DeviceType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



DeviceType类属于eu.bitwalker.useragentutils包,在下文中一共展示了DeviceType类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: supportsWallet

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public boolean supportsWallet(String userAgentHeaderValue) {
    if (StringUtils.isBlank(userAgentHeaderValue)) {
        return false;
    }
    UserAgent userAgent = new UserAgent(userAgentHeaderValue);
    if (userAgent.getOperatingSystem().getDeviceType() == DeviceType.MOBILE
            && userAgent.getOperatingSystem().getGroup() == OperatingSystem.IOS
            && userAgent.getOperatingSystem().getId() >= OperatingSystem.iOS6_IPHONE.getId()) {
        return true;
    }
    Version oldestSafariVersionWithGuaranteedSupport = new Version("6.2", "6", "2"); // Mac OS X 10.8.2 or later required to install this Safari version
    if (userAgent.getOperatingSystem() == OperatingSystem.MAC_OS_X
            && userAgent.getBrowser().getGroup() == Browser.SAFARI
            && userAgent.getBrowserVersion().compareTo(oldestSafariVersionWithGuaranteedSupport) >= 0) {
        return true;
    }
    return false;
}
 
开发者ID:AusDTO,项目名称:citizenship-appointment-server,代码行数:19,代码来源:WalletSupportService.java


示例2: isMobileOrUnknownDevice

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
private boolean isMobileOrUnknownDevice(String userAgentHeaderValue) {
    if (StringUtils.isBlank(userAgentHeaderValue)) {
        return false;
    }
    UserAgent userAgent = new UserAgent(userAgentHeaderValue);
    return userAgent.getOperatingSystem().getDeviceType() == DeviceType.MOBILE;
}
 
开发者ID:AusDTO,项目名称:citizenship-appointment-server,代码行数:8,代码来源:ConfirmationController.java


示例3: UserAgentResource

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public UserAgentResource(Browser browser, Browser browserGroup, BrowserType browserType, OperatingSystem operatingSystem, OperatingSystem operatingSystemGroup, DeviceType deviceType) {
    this.browser = browser;
    this.browserGroup = browserGroup;
    this.browserType = browserType;
    this.operatingSystem = operatingSystem;
    this.operatingSystemGroup = operatingSystemGroup;
    this.deviceType = deviceType;
}
 
开发者ID:theborakompanioni,项目名称:tbk-spring-useragentutils,代码行数:9,代码来源:UserAgentResource.java


示例4: getDeviceType

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public DeviceType getDeviceType() {
    return this.deviceType;
}
 
开发者ID:theborakompanioni,项目名称:tbk-spring-useragentutils,代码行数:4,代码来源:UserAgentResource.java


示例5: isMobileRequest

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public static boolean isMobileRequest(){
	return DeviceType.MOBILE.equals(getRequestDeviceType());
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:4,代码来源:UserAgentUtils.java


示例6: getRequestDeviceType

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public static DeviceType getRequestDeviceType(){
	UserAgent userAgent = getUserAgent();
	return userAgent.getOperatingSystem().getDeviceType();
}
 
开发者ID:wayshall,项目名称:onetwo,代码行数:5,代码来源:UserAgentUtils.java


示例7: getStbView

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
public ModelAndView getStbView(HttpServletRequest req, HttpServletResponse resp, String deviceId, 
        String mobile, String remoteType, String refresh, String uaStr, String stbViewType) {
    accessValidator.validateUserHasAccessToDevices(req, resp, true, deviceId);
    MetaStb stb = null;
    boolean ref = refresh == null ? false : Boolean.parseBoolean(refresh);
    try {
        stb = metaStbCache.getMetaStb(deviceId, ref);
    } catch (HttpRuntimeException e) {
        LOGGER.error("Failed to fetch the STB detail.", e);
    }

    ModelAndView mav;
    if (stb == null) {
        mav = new ModelAndView(NOSTB);
        mav.addObject(DEVICE_ID, deviceId);
    } else {
        boolean supported = BrowserSupport.isBrowserSupported(uaStr);
        String videoUrl = getVideoUrl(stb);
        String audioUrlOgg = getAudioUrl(stb, AudioType.OGG);
        String audioUrlMpeg = getAudioUrl(stb, AudioType.MPEG);

        Boolean mob = false;

        if (mobile == null) {
            DeviceType deviceType = UserAgent.parseUserAgentString(uaStr).getOperatingSystem().getDeviceType();
            mob = deviceType.equals(DeviceType.MOBILE) || deviceType.equals(DeviceType.TABLET);
        } else {
            mob = Boolean.parseBoolean(mobile);
        }

        if(remoteType == null) {
            remoteType = stb.getRemoteType();
        }

        Remote remote = getRemote(remoteType);

        Set <String> remoteTypes = remoteManager.getRemoteTypes();
        mav = new ModelAndView(stbViewType);

        mav.addObject(DEVICE_ID, DawgUtil.toLowerAlphaNumeric(deviceId));
        try {
            mav.addObject(REMOTE_TYPES, jsonEngine.writeToString(remoteTypes, Set.class));
        } catch (CerealException exception) {
            LOGGER.error("Cereal exception while loading remote types", exception);
        }
        mav.addObject(STB_PARAM, stb);
        mav.addObject(REMOTE_MANAGER, remoteManager);
        mav.addObject(REMOTE, remote);
        mav.addObject(SELECTED_REMOTE_TYPE, remoteType);
        mav.addObject(MOBILE, mob);
        mav.addObject(VIDEO_URL, videoUrl);
        mav.addObject(VIDEO_AVAILABLE, validUrl(videoUrl) || validUrl(stb.getHdVideoUrl()));
        mav.addObject(HD_VIDEO_URL, stb.getHdVideoUrl());
        mav.addObject(TRACE_AVAILABLE, validUrl(stb.getSerialHost()));
        mav.addObject(TRACE_HOST, stb.getSerialHost());
        mav.addObject(IR_AVAILABLE, validUrl(stb.getIrServiceUrl()) && validUrl(stb.getIrServicePort()));
        mav.addObject(SUPPORTED, supported);
        mav.addObject(IPADDRESS, stb.getIpAddress().getHostName());
        mav.addObject(AUDIO_URL_MPEG, audioUrlMpeg);
        mav.addObject(AUDIO_URL_OGG, audioUrlOgg);
    }
    return mav;
}
 
开发者ID:Comcast,项目名称:dawg,代码行数:64,代码来源:ViewController.java


示例8: getDeviceType

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
@Nonnull
public DeviceType getDeviceType() {
    return Objects.firstNonNull(getOperatingSystem().getDeviceType(), DeviceType.UNKNOWN);
}
 
开发者ID:indeedeng,项目名称:proctor-pipet,代码行数:5,代码来源:UserAgent.java


示例9: isTablet

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * Determines whether user agent is a tablet
 * @return true if tablet
 */
public boolean isTablet() {
    return DeviceType.TABLET.equals(getDeviceType()) ||
            userAgentString.contains(NEXUS_7_SIGNATURE) ||
            userAgentString.contains(KINDLE_FIRE_SIGNATURE);
}
 
开发者ID:indeedeng,项目名称:proctor-pipet,代码行数:10,代码来源:UserAgent.java


示例10: getDeviceType

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 获取设备类型
 *
 * @param request
 * @return
 */
public static DeviceType getDeviceType(HttpServletRequest request) {
	return getUserAgent(request).getOperatingSystem().getDeviceType();
}
 
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java


示例11: isComputer

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是PC
 *
 * @param request
 * @return
 */
public static boolean isComputer(HttpServletRequest request) {
	return DeviceType.COMPUTER.equals(getDeviceType(request));
}
 
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java


示例12: isMobile

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是手机
 *
 * @param request
 * @return
 */
public static boolean isMobile(HttpServletRequest request) {
	return DeviceType.MOBILE.equals(getDeviceType(request));
}
 
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java


示例13: isTablet

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是平板
 *
 * @param request
 * @return
 */
public static boolean isTablet(HttpServletRequest request) {
	return DeviceType.TABLET.equals(getDeviceType(request));
}
 
开发者ID:funtl,项目名称:framework,代码行数:10,代码来源:UserAgentUtils.java


示例14: isMobileOrTablet

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是手机和平板
 *
 * @param request
 * @return
 */
public static boolean isMobileOrTablet(HttpServletRequest request) {
	DeviceType deviceType = getDeviceType(request);
	return DeviceType.MOBILE.equals(deviceType) || DeviceType.TABLET.equals(deviceType);
}
 
开发者ID:funtl,项目名称:framework,代码行数:11,代码来源:UserAgentUtils.java


示例15: getDeviceType

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 获取设备类型
 * @param request
 * @return
 */
public static DeviceType getDeviceType(HttpServletRequest request){
	return getUserAgent(request).getOperatingSystem().getDeviceType();
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java


示例16: isComputer

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是PC
 * @param request
 * @return
 */
public static boolean isComputer(HttpServletRequest request){
	return DeviceType.COMPUTER.equals(getDeviceType(request));
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java


示例17: isMobile

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是手机
 * @param request
 * @return
 */
public static boolean isMobile(HttpServletRequest request){
	return DeviceType.MOBILE.equals(getDeviceType(request));
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java


示例18: isTablet

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是平板
 * @param request
 * @return
 */
public static boolean isTablet(HttpServletRequest request){
	return DeviceType.TABLET.equals(getDeviceType(request));
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:9,代码来源:UserAgentUtils.java


示例19: isMobileOrTablet

import eu.bitwalker.useragentutils.DeviceType; //导入依赖的package包/类
/**
 * 是否是手机和平板
 * @param request
 * @return
 */
public static boolean isMobileOrTablet(HttpServletRequest request){
	DeviceType deviceType = getDeviceType(request);
	return DeviceType.MOBILE.equals(deviceType) || DeviceType.TABLET.equals(deviceType);
}
 
开发者ID:EleTeam,项目名称:Shop-for-JavaWeb,代码行数:10,代码来源:UserAgentUtils.java



注:本文中的eu.bitwalker.useragentutils.DeviceType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java IndexingDataKeys类代码示例发布时间:2022-05-22
下一篇:
Java Trie类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap